[Shtoom] unicode filename breaks incoming calls
Matthias Urlichs
smurf at smurf.noris.de
Wed Apr 6 18:30:48 CEST 2005
Hi,
Adrien Di Mascio:
> tests for type(fp) == type('') but since fp is a unicode string, this
> piece of code thinks that if it is not a string, it must be an open
> file.
>
The correct way to do that is probably to check whether it has a read()
method. Alternately, you can check if it's an instance of basestring.
The types module is somewhat deprecated.
--
Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf at smurf.noris.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/shtoom/attachments/20050406/7c1d3a41/attachment.pgp>
More information about the Shtoom
mailing list