Wrong OSError message from os.rename() when dst is a non-empty directory

Bug #1264618 reported by Jason Gerard DeRose
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python3.4 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Under Python 3.3, if renaming a directory with `os.rename()` when the destination is an existing, non-empty directory, like this:

os.rename('/tmp/foo', '/tmp/bar')

You'll get an OSError with a message like this:

OSError: [Errno 39] Directory not empty: '/tmp/bar'

However, in the current Python 3.4.0b1 package in Trusty, this error message will contain the source directory name instead of the destination directory name, like this:

OSError: [Errno 39] Directory not empty: '/tmp/foo'

I've attached a test case, which also covers renaming directories relative to an open directory descriptor. This test case works on Python 3.3, fails on Python 3.4.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: python3.4 3.4~b1-0ubuntu3
ProcVersionSignature: Ubuntu 3.12.0-7.15-generic 3.12.4
Uname: Linux 3.12.0-7-generic x86_64
ApportVersion: 2.12.7-0ubuntu3
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Dec 27 19:57:28 2013
SourcePackage: python3.4
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jason Gerard DeRose (jderose) wrote :
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

I didn't find an existing upstream up for this, so I filed one: http://bugs.python.org/issue20093

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Hmm, originally I didn't think this was related, but it may be after all: http://bugs.python.org/issue16074

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Note this problem is still present in Python 3.4 Beta3

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Note this is still present in the final 3.4.0-1 Ubuntu package.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python3.4 (Ubuntu):
status: New → Confirmed
Changed in python3.4 (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Medium
milestone: none → trusty-updates
Revision history for this message
Matthias Klose (doko) wrote :
Changed in python3.4 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.