[ python-Bugs-1306484 ] compile() converts "filename" parameter to StringType

SourceForge.net noreply at sourceforge.net
Wed Sep 28 06:49:37 CEST 2005


Bugs item #1306484, was opened at 2005-09-28 06:49
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=1306484&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parser/Compiler
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Vágvölgyi Attila (wigy)
Assigned to: Nobody/Anonymous (nobody)
Summary: compile() converts "filename" parameter to StringType

Initial Comment:
The builtin compile() signature looks like:

  compile(string, filename, kind[, flags[, dont_inherit]])

The string parameter can be either StringType or
UnicodeType, but the filename parameter will be
converted to StringType, so if there are non-ascii
characters in the unicode object passed, it raises
UnicodeEncodeError.

This can be an issue on filesystems having utf-8
filenames, or when using non-English names for the
backtrace beautification.

The attached file contains a unit test that will
succeed when the bug is resolved. I saw the error in
2.3 and 2.4, maybe it is there for all releases?

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

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


More information about the Python-bugs-list mailing list