Message355981
The following test script works with Python 3.7 (and older), but triggers an endless loop with Python 3.8:
#!/usr/bin/python3
import shutil
import os
os.mkdir('/dev/shm/t')
os.mkdir('/dev/shm/t/pg')
with open('/dev/shm/t/pg/pol', 'w+') as f:
f.write('pol')
shutil.copytree('/dev/shm/t/pg', '/dev/shm/t/pg/somevendor/1.0')
The important point is probably that 'pg' gets copied into a subdirectory of itsself. While this worked in Python up to 3.7, doing the same in Python 3.8 runs into an endless loop:
# python3 /home/abuild/rpmbuild/SOURCES/test.py
Traceback (most recent call last):
File "/home/abuild/rpmbuild/SOURCES/test.py", line 15, in <module>
shutil.copytree('/dev/shm/t/pg', '/dev/shm/t/pg/somevendor/1.0')
File "/usr/lib/python3.8/shutil.py", line 547, in copytree
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
File "/usr/lib/python3.8/shutil.py", line 486, in _copytree
copytree(srcobj, dstname, symlinks, ignore, copy_function,
...
copytree(srcobj, dstname, symlinks, ignore, copy_function,
File "/usr/lib/python3.8/shutil.py", line 547, in copytree
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
File "/usr/lib/python3.8/shutil.py", line 449, in _copytree
os.makedirs(dst, exist_ok=dirs_exist_ok)
File "/usr/lib/python3.8/os.py", line 206, in makedirs
head, tail = path.split(name)
File "/usr/lib/python3.8/posixpath.py", line 104, in split
sep = _get_sep(p)
File "/usr/lib/python3.8/posixpath.py", line 42, in _get_sep
if isinstance(path, bytes):
RecursionError: maximum recursion depth exceeded while calling a Python object
I also reported this at https://bugzilla.opensuse.org/show_bug.cgi?id=1155839 |
|
Date |
User |
Action |
Args |
2019-11-04 21:21:38 | cboltz | set | recipients:
+ cboltz |
2019-11-04 21:21:38 | cboltz | set | messageid: <1572902498.64.0.957640730326.issue38688@roundup.psfhosted.org> |
2019-11-04 21:21:38 | cboltz | link | issue38688 messages |
2019-11-04 21:21:38 | cboltz | create | |
|