Generating a unique filename in the face of unicode filename
"Martin v. Löwis"
martin at v.loewis.de
Sun Jun 14 11:52:32 EDT 2009
More information about the Python-list mailing list
Sun Jun 14 11:52:32 EDT 2009
- Previous message (by thread): Generating a unique filename in the face of unicode filename
- Next message (by thread): frustrating failure of 'break' statement ( novice )
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> where line 175 is the assignment to self.unique_name. After a little > back-and-forth with his user it turns out that her computer's hostname > contains non-ASCII data, so presumably self.hostname is a unicode object. Most likely, it is not. It's rather the hostname encoded in the ANSI code page. > It works for Frank on his Windows box as well. Any ideas how to properly > Unicode-proof this code? You should first decode the gethostname result, using the locale's encoding; expect this decoding to fail possibly, so the "ignore" error handler might be your best choice. Regards, Martin
- Previous message (by thread): Generating a unique filename in the face of unicode filename
- Next message (by thread): frustrating failure of 'break' statement ( novice )
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list