suds.sax.text.Text objects with unicode cannot be encoded when used in lists
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
suds (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
When a unicode string received from a python-suds call is saved in a django database an exception is generated in this line of /usr/lib/
This appears to be a bug in the suds.sax.text.Text class used inside of params. I reproduced the problem in a few lines of code:
#!/usr/bin/env python
from suds.sax.text import Text
v=Text(u'Bl\xe5')
print v
print [ v ]
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: python-suds 0.4.1-2ubuntu1
ProcVersionSign
Uname: Linux 3.2.0-35-generic i686
NonfreeKernelMo
ApportVersion: 2.0.1-0ubuntu17.1
Architecture: i386
Date: Thu Jan 17 13:09:54 2013
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
MarkForUpload: True
PackageArchitec
ProcEnviron:
LANGUAGE=en_US:en
TERM=screen
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: suds
UpgradeStatus: Upgraded to precise on 2012-05-08 (253 days ago)
Changed in suds (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → Medium |
I took a look on the source of suds.sax.text.Text and tried to remove everything unrelated to the bug. I found that the following lines of the suds.sax.text.Text implementation is everything necessary to reproduce the problem.
class Text(unicode):
def __repr__(self):
s = [self]
return ''.join(s)
I haven't spotted the bug in those lines of code. Does anybody else spot the bug right away?