[Bug 1155839] New: Python 3.8 regression: endless loop in shutil.copytree
http://bugzilla.opensuse.org/show_bug.cgi?id=1155839 Bug ID: 1155839 Summary: Python 3.8 regression: endless loop in shutil.copytree Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: tchvatal@suse.com Reporter: suse-beta@cboltz.de QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- The following test script works with Python 3.7 (and older), but triggers an endless loop with Python 3.8 (as currently available in Staging:A) #!/usr/bin/python3 import shutil import os os.mkdir('/dev/shm/t') os.mkdir('/dev/shm/t/policygroups') with open('/dev/shm/t/policygroups/pol', 'w+') as f: f.write('pol') shutil.copytree('/dev/shm/t/policygroups', '/dev/shm/t/policygroups/somevendor/1.0') The important point is probably that 'policygroups' 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: [ 18s] + python3 /home/abuild/rpmbuild/SOURCES/test.py [ 18s] Traceback (most recent call last): [ 18s] File "/home/abuild/rpmbuild/SOURCES/test.py", line 15, in <module> [ 18s] shutil.copytree('/dev/shm/t/policygroups', '/dev/shm/t/policygroups/somevendor/1.0') [ 18s] File "/usr/lib/python3.8/shutil.py", line 547, in copytree [ 18s] return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks, [ 18s] File "/usr/lib/python3.8/shutil.py", line 486, in _copytree [ 18s] copytree(srcobj, dstname, symlinks, ignore, copy_function, ... [ 20s] copytree(srcobj, dstname, symlinks, ignore, copy_function, [ 20s] File "/usr/lib/python3.8/shutil.py", line 547, in copytree [ 20s] return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks, [ 20s] File "/usr/lib/python3.8/shutil.py", line 449, in _copytree [ 20s] os.makedirs(dst, exist_ok=dirs_exist_ok) [ 20s] File "/usr/lib/python3.8/os.py", line 206, in makedirs [ 20s] head, tail = path.split(name) [ 20s] File "/usr/lib/python3.8/posixpath.py", line 104, in split [ 20s] sep = _get_sep(p) [ 20s] File "/usr/lib/python3.8/posixpath.py", line 42, in _get_sep [ 20s] if isinstance(path, bytes): [ 20s] RecursionError: maximum recursion depth exceeded while calling a Python object [ 20s] error: Bad exit status from /var/tmp/rpm-tmp.GsRcIW (%build) You can find the full build log in OBS home:cboltz:branches:openSUSE:Factory:Rings:1-MinimalX/copytree I also linked the package into home:cboltz/copytree where it happily builds for current Factory (with Python 3.7) and several Leap releases. BTW: In case you wonder how I found this bug - this testscript is a simplified version of an AppArmor testcase. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1155839 http://bugzilla.opensuse.org/show_bug.cgi?id=1155839#c1 --- Comment #1 from Christian Boltz <suse-beta@cboltz.de> --- Also reported upstream at https://bugs.python.org/issue38688 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1155839 http://bugzilla.opensuse.org/show_bug.cgi?id=1155839#c3 --- Comment #3 from Christian Boltz <suse-beta@cboltz.de> --- For the records - the SR in comment #2 fixed a different python 3.8 issue (in the libapparmor configure script) and mentioned that it will _not_ fix this bug. On the positive side, there's a proposed patch for this bug upstream: https://github.com/python/cpython/pull/17098 (currently waiting for CLA paperwork) -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1155839 http://bugzilla.opensuse.org/show_bug.cgi?id=1155839#c4 Christian Boltz <suse-beta@cboltz.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mcepl@suse.com --- Comment #4 from Christian Boltz <suse-beta@cboltz.de> --- *** Bug 1158295 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1155839 http://bugzilla.opensuse.org/show_bug.cgi?id=1155839#c5 --- Comment #5 from Christian Boltz <suse-beta@cboltz.de> --- FYI: In the meantime, https://github.com/python/cpython/pull/17098 was merged and also backported to the 3.8 branch. Please apply that patch to the openSUSE package. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com