Author ldconejo
Recipients ldconejo
Date 2018-03-19.18:28:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1521484111.52.0.467229070634.issue33105@psf.upfronthosting.co.za>
In-reply-to
Content
Windows has a maximum path length limitation of 260 characters. This limitation, however, can be bypassed in the scenario described below. When this occurs, os.isfile() will return false, even when the affected file does exist. For Windows systems, the behavior should be for os.isfile() to return an exception in this case, indicating that maximum path length has been exceeded.

Sample scenario:

1. Let's say you have a folder, named F1 and located in your local machine at this path:

C:\tc\proj\MTV\cs_fft\Milo\Fries\STL\BLNA\F1\

2. Inside of that folder, you have a log file with this name:

This_is_a_really_long_file_name_that_by_itself_is_not_capable_of_exceeding_the_path_length_limitation_Windows_has_in_pretty_much_every_single_version_of_Wind.log

3. The combined length of the path and the file is exactly 260 characters, so Windows lets you get away with it when the file is initially created and/or placed there.

4. Later, you decide to make the F1 folder available on your network, under this name:

\\tst\tc\proj\MTV\cs_fft\Milo\Fries\STL\BLNA\F1\

5. Your log file continues to be in the folder, but its full network path is now 263 characters, effectively violating the maximum path length limitation.

6. If you use os.listdir() on the networked folder, the log file will come up.

7. Now, if you try os.path.isfile(os.path.join(networked_path,logfile_name)) it will return false, even though the file is indeed there and is indeed a file.
History
Date User Action Args
2018-03-19 18:28:31ldconejosetrecipients: + ldconejo
2018-03-19 18:28:31ldconejosetmessageid: <1521484111.52.0.467229070634.issue33105@psf.upfronthosting.co.za>
2018-03-19 18:28:31ldconejolinkissue33105 messages
2018-03-19 18:28:31ldconejocreate