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

SourceForge.net noreply at sourceforge.net
Mon May 3 21:32:02 EDT 2004


Bugs item #947405, was opened at 2004-05-04 11:32
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: Open
Resolution: None
Priority: 5
Submitted By: Mark Hammond (mhammond)
Assigned to: Thomas Heller (theller)
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 :)

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

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