Python Setup Disabling Path Length Limit Pros and Cons?

Qwerty Qwerts picture Qwerty Qwerts · Aug 1, 2018 · Viewed 55.9k times · Source

I recently installed python 3.7 and at the end of the download there is the option to Disable Path Length Limit. I don't know whether or not I should do this. What are the pros and cons of doing it. Just from the sound of it you should always disable it.

Answer

khan picture khan · Oct 15, 2018

I recommend selecting that option and thereby removing the path length limit. It will potentially save you time in future on debugging an avoidable issue.

Here is an anecdote of how I came to know about it:

During the compilation of my program (C# code on a Windows machine), I started getting the following error:

error MSB3541: Files has invalid value "long\path\filename". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

This error was not allowing me to build my project and the only apparent solution to this issue was to shorten my path/file names. Turns out that this bug is a built-in limitation in NTFS (Window's File System): Why does the 260 character path length limit exist in Windows?

After a couple of decades with the limitation built into the NTFS file system, it has finally been fixed (Unix based system did not have it) in Windows 10 (https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation), but it is not enabled automatically, and needs registry (or group policy) settings to do this. The Python option allows you to disable it for Python libraries, saving you a lot of headache.

Do note that enabling this option will,

a) break compatibility of your programs on systems using older versions of Windows 10 and lower, when using long file/directory names and paths.

b) break programs on Windows 10 machines not having this option enabled, when using long file/directory names and paths.