UnicodeDecodeError in UnicodeReflectionTest
Bug #230825 reported by
Mathieu Fenniak
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pg8000 |
Confirmed
|
Medium
|
Mathieu Fenniak |
Bug Description
In SQLAlchemy's engine.
'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128)
This could be related to pg8000 treating Pg's SQL_ASCII encoding as the same as "ascii", while the documentation states that they are slightly different. sql_ascii should treat bytes 128-256 as unknown bytes.
Changed in pg8000: | |
assignee: | nobody → mfenniak |
importance: | Undecided → Medium |
milestone: | none → sqlalchemy |
status: | New → Confirmed |
To post a comment you must log in.
I ran into something very similar. Here is the query:
select 'mm1_4_0', region_usage from mm1_4_0. region_ timestamp union all region_ timestamp union all region_ timestamp union all region_ timestamp union all region_ timestamp union all region_ timestamp
select 'mm1_4_5', region_usage from mm1_4_5.
select 'mm1_4_8', region_usage from mm1_4_8.
select 'mm1_4_a', region_usage from mm1_4_a.
select 'mm1_4_d', region_usage from mm1_4_d.
select 'mm1_4_f', region_usage from mm1_4_f.
The region_ timestamp. region_ usage column is declared to be of type char, and it always stores one of 'A', 'B', 'I'.
Here is the pg8000 part of the stack:
File "/home/ jao/osh- 1.0.0/osh/ external/ pg8000/ dbapi.py" , line 304, in execute _execute( operation, args) jao/osh- 1.0.0/osh/ external/ pg8000/ dbapi.py" , line 309, in _execute cursor. execute( new_query, *new_args) jao/osh- 1.0.0/osh/ external/ pg8000/ interface. py", line 297, in execute nt(self. connection, query, statement_name="", *[type(x) for x in args]) jao/osh- 1.0.0/osh/ external/ pg8000/ interface. py", line 98, in __init__ _parse_ row_desc = self.c. parse(self. _statement_ name, statement, types) jao/osh- 1.0.0/osh/ external/ pg8000/ protocol. py", line 857, in _fn jao/osh- 1.0.0/osh/ external/ pg8000/ protocol. py", line 963, in parse _send(Parse( statement, qs, param_types)) jao/osh- 1.0.0/osh/ external/ pg8000/ protocol. py", line 905, in _send jao/osh- 1.0.0/osh/ external/ pg8000/ protocol. py", line 120, in serialize
self.
File "/home/
self.
File "/home/
self._stmt = PreparedStateme
File "/home/
self.
File "/home/
return fn(self, *args, **kwargs)
File "/home/
self.
File "/home/
data = msg.serialize()
File "/home/
val = struct.pack("!i", len(val) + 4) + val
UnicodeDecodeError: 'ascii' codec can't decode byte 0xac in position 3: ordinal not in range(128)