[New-bugs-announce] [issue46678] Invalid cross device link in Lib/test/support/import_helper.py

Jason Wilkes report at bugs.python.org
Mon Feb 7 15:30:36 EST 2022


New submission from Jason Wilkes <notarealdeveloper at gmail.com>:

In Lib/test/support/import_helper.py, the function make_legacy_pyc makes a call to os.rename which can fail when the source and target live on different devices. This happens (for example) when PYTHONPYCACHEPREFIX is set to a directory on a different device from where temporary files are stored. Replacing os.rename with shutil.move fixes it. Will submit a PR.

----------
components: Tests
messages: 412791
nosy: notarealdeveloper
priority: normal
severity: normal
status: open
title: Invalid cross device link in Lib/test/support/import_helper.py
type: behavior
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46678>
_______________________________________


More information about the New-bugs-announce mailing list