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

Paul Arnold report at bugs.python.org
Mon Aug 9 07:51:26 CEST 2010


New submission from Paul Arnold <paul at barfoo.net>:

In Python 3.1, xdrlib.Packer().pack_fstring() throws a TypeError if called with a str() (an encoded string bytes() works just fine).

>>> xdrlib.Packer().pack_fstring(6, "foobar")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.1/xdrlib.py", line 81, in pack_fstring
    data = data + (n - len(data)) * b'\0'
TypeError: Can't convert 'bytes' object to str implicitly

----------
components: None
messages: 113386
nosy: arnoldp
priority: normal
severity: normal
status: open
title: xdrlib.Packer().pack_fstring throws a TypeError when called with a str()
type: crash
versions: Python 3.1

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


More information about the Python-bugs-list mailing list