[issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()

Benjamin Peterson report at bugs.python.org
Thu Apr 14 15:03:48 CEST 2011


Benjamin Peterson <benjamin at python.org> added the comment:

2011/4/14 Filip Gruszczyński <report at bugs.python.org>:
>
> Filip Gruszczyński <gruszczy at gmail.com> added the comment:
>
> Actually documentation doesn't say that it supports only bytes, but:
>
> "The following methods support packing strings, bytes, and opaque data:"
>
> Also under python2 you can easily do this:
>
> In [1]: import xdrlib
>
> In [2]: p = xdrlib.Packer()
>
> In [3]: p.pack_string('some str')
>
> In [4]: p.pack_string(u'some str')

I doubt u"美", will, though.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9544>
_______________________________________


More information about the Python-bugs-list mailing list