UnicodeDecodeError on some queries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pg8000 |
Incomplete
|
Undecided
|
Unassigned | ||
Ubuntu |
Invalid
|
Undecided
|
Unassigned |
Bug Description
During certain queries for unknown reasons (unknown because I haven't taken much time to investigate why some queries work fine) I get UnicodeDecodeError errors on line 120 in protocol.py (in Parse class' serialize() method) when the query string happens to be in unicode.
Here's the stack trace
File "tabletest.py", line 17, in <module>
tColumns = table.all_columns()
File "/Library/
return self.manager.
File "/Library/
cursor.
File "/Library/
self.
File "/Library/
self.
File "/Library/
self._stmt = PreparedStateme
File "/Library/
self.
File "/Library/
return fn(self, *args, **kwargs)
File "/Library/
self.
File "/Library/
data = msg.serialize()
File "/Library/
val = struct.pack("!i", len(val) + 4) + val
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 3: ordinal not in range(128)
I solved this problem by changing line 112 of protocol.py to the following:
val = self.ps + "\x00" + self.qs.
I'm running OS X 10.5.4 Leopard, so this may not have appeared on other platforms.
Changed in pg8000: | |
status: | New → Incomplete |
This doesn't seem to be an Ubuntu issue.