[ python-Bugs-947405 ] os.utime() raises bad exception for unicode filenames

SourceForge.net noreply at sourceforge.net
Tue May 4 04:11:00 EDT 2004


Bugs item #947405, was opened at 2004-05-04 11:32
Message generated for change (Comment added) made by mhammond
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=947405&group_id=5470

Category: Windows
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Mark Hammond (mhammond)
Assigned to: Mark Hammond (mhammond)
Summary: os.utime() raises bad exception for unicode filenames

Initial Comment:
os.utime handles unicode filenames - but when it raises
an exception, it always uses the 'char *' filename. 
When unicode is passed to this function, the 'char *'
is garbage.

For example:
python -c "import os;os.utime(u'\xe', None)"
Traceback (most recent call last):
  File "<string>", line 1, in ?
OSError: [Errno 2] No such file or directory: '\x05'

Note the bad filename.  Once this patch is applied, the
output is:
Traceback (most recent call last):
  File "<string>", line 1, in ?
OSError: [Errno 2] No such file or directory: u'\xe'

The patch is against the 2.3 tree, but still applies
against the head.  I believe this should be checked
into both places (and am happy to do it :)

----------------------------------------------------------------------

>Comment By: Mark Hammond (mhammond)
Date: 2004-05-04 18:11

Message:
Logged In: YES 
user_id=14198

Fixed!
2.3:
Checking in posixmodule.c;
new revision: 2.300.8.9; previous revision: 2.300.8.8

head:
new revision: 2.317; previous revision: 2.316

----------------------------------------------------------------------

Comment By: Thomas Heller (theller)
Date: 2004-05-04 17:35

Message:
Logged In: YES 
user_id=11105

Patch looks good, if you ask me. Please check in quickly, so
that this goes into 2.3.4.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=947405&group_id=5470



More information about the Python-bugs-list mailing list