[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

Please let me know if you are able to reproduce this issue.

--

___
Python tracker 
<https://bugs.python.org/issue46084>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

my c drive and h drive are both internal drives and I run the python script 
from my user directory on my c drive.  Not sure if that makes any difference.  
Just trying to think of things that might help you reproduce and fix this.

--

___
Python tracker 
<https://bugs.python.org/issue46084>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

when I run the following command:

python "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py" 
"C:\\"

I get this output:

...
Traceback (most recent call last):
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", 
line 54, in 
main(sys.argv[0:])
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", 
line 30, in main
for file in get_files_in_dir(source):
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", 
line 11, in get_files_in_dir
yield from get_files_in_dir(entry.path)
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", 
line 11, in get_files_in_dir
yield from get_files_in_dir(entry.path)
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", 
line 11, in get_files_in_dir
yield from get_files_in_dir(entry.path)
  [Previous line repeated 19 more times]
  File "H:\Users\LindaJim\Documents\AWS Python Learning\test_dir_scan_dir.py", 
line 9, in get_files_in_dir
for entry in os.scandir(source):
FileNotFoundError: [WinError 3] The system cannot find the path specified: 
'C:\\Users\\Jim\\Documents\\jschw_uiowtv3_old\\AppData\\Local\\Google\\Chrome\\User
 
Data\\Default\\Extensions\\nenlahapcbofgnanklpelkaejcehkggg\\0.1.823.675_0\\notifications\\pages\\Cashback\\components\\CashBackResolve\\components\\RewardsActivation\\components\\CashbackSectionSimple'

when I run the following command:

python "H:\Users\LindaJim\Documents\AWS Python Learning\test_os_walk.py" "C:\\"

I get this:

...
file is  C:\winutils\bin\winutils.exe
End time is  2021-12-15.13:11:54
Duration is  0:06:05

I don't think this should happen, right?

--

___
Python tracker 
<https://bugs.python.org/issue46084>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

the issue is with the scandir script, not the os_walk script.  I tried to 
upload the scandir python script before, but I guess it didn't upload.  When I 
was running the two scripts, I used an input of C:\\ as the input parameter.  
Hope that helps.

--
Added file: https://bugs.python.org/file50495/test_dir_scan_dir.py

___
Python tracker 
<https://bugs.python.org/issue46084>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

do you have this registry entry set to 1: 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled 
set to 1.  It works if you do.  What version of windows do you have?  I have 
version 21H2 (OS Build 19044.1387).  I don't have windows 11 yet.

--

___
Python tracker 
<https://bugs.python.org/issue46084>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

yes, I do.  
C:\Users\Jim\Documents\jschw_uiowtv3_old\AppData\Local\Google\Chrome\User 
Data\Default\Extensions\nenlahapcbofgnanklpelkaejcehkggg\0.1.823.675_0\notifications\pages\Cashback\components\CashBackResolve\components\RewardsActivation\components\CashbackSectionSimple

it's over the 260 character limit that's the default for windows 10.

--

___
Python tracker 
<https://bugs.python.org/issue46084>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


Jim Schwartz  added the comment:

Here's the second file that works just fine under python 3.9 (by the way, I am 
using Windows 64-bit).  I didn't test this on later python versions, however, 
nor did I test it on 32-bit versions.  I see that many people on the internet 
have said to change the working directory as a work around.  Could this 
possibly be why?

--
Added file: https://bugs.python.org/file50493/test_os_walk.py

___
Python tracker 
<https://bugs.python.org/issue46084>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not

2021-12-15 Thread Jim Schwartz


New submission from Jim Schwartz :

Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not. 
 I've enclosed sample scripts that compare the two and have returned the 
results.  the windows 10 registry entry to extend the path names fixes this 
issue 
(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled
 set to 1).  I've enclosed a scripts that proved this occurs and can be used 
for testing. I have a script that does the same thing using os_walk, but I 
can't attach two scripts to this Issue.

--
components: IO, Tests, Windows
files: test_dir_scan_dir.py
messages: 408607
nosy: jschwar313, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk 
does not
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file50492/test_dir_scan_dir.py

___
Python tracker 
<https://bugs.python.org/issue46084>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com