This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: distutils.file_util.move_file unpacks wrongly an exception
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: berker.peksag Nosy List: Claudiu.Popa, berker.peksag, dstufft, eric.araujo, python-dev
Priority: normal Keywords: patch

Created on 2014-08-11 12:38 by Claudiu.Popa, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
distutils_unpacking_exception.patch Claudiu.Popa, 2014-08-11 12:38 review
issue22182.patch Claudiu.Popa, 2014-08-11 12:45 review
Messages (5)
msg225184 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-08-11 12:38
Hi. When os.rename fails inside distutils.file_util.move_file, the exception is unpacked using ``(num, msg) = e``. While this was valid in Python 2, in Python 3 it should be ``e.args``. The attached patched fixes this.
msg225185 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-08-11 12:45
Mm, it seems there's another instance of unpacking later on, when os.unlink fails. Here's the updated patch.
msg225894 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-08-25 20:21
LGTM. The second test should be named different, but I will fix it myself. Thanks for the patch!
msg226049 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-29 04:08
New changeset a3452677a386 by Berker Peksag in branch '3.4':
Issue #22182: Use e.args to unpack exceptions correctly in distutils.file_util.move_file.
http://hg.python.org/cpython/rev/a3452677a386

New changeset f01413758114 by Berker Peksag in branch 'default':
Issue #22182: Use e.args to unpack exceptions correctly in distutils.file_util.move_file.
http://hg.python.org/cpython/rev/f01413758114
msg226050 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-08-29 04:10
Thanks Claudiu.
History
Date User Action Args
2022-04-11 14:58:06adminsetgithub: 66378
2014-08-29 04:10:21berker.peksagsetstatus: open -> closed
resolution: fixed
messages: + msg226050

stage: commit review -> resolved
2014-08-29 04:08:54python-devsetnosy: + python-dev
messages: + msg226049
2014-08-25 20:21:19berker.peksagsetversions: + Python 3.4
nosy: + berker.peksag

messages: + msg225894

assignee: berker.peksag
stage: patch review -> commit review
2014-08-25 09:00:34Claudiu.Popasetstage: patch review
2014-08-11 12:45:29Claudiu.Popasetfiles: + issue22182.patch

messages: + msg225185
2014-08-11 12:38:56Claudiu.Popacreate