Teradata / PyTd

A Python Module to make it easy to script powerful interactions with Teradata Database in a DevOps friendly way.
MIT License
108 stars 43 forks source link

Unicode Decode Error on Ubuntu #102

Closed naveenrc closed 6 years ago

naveenrc commented 6 years ago

The query is successful. It returns the row count but not the data, which gives Unicode Decode error on Ubuntu. Ubuntu is inside a docker container if it helps.

File "/usr/local/lib/python3.5/dist-packages/teradata/udaexec.py", line 824, in fetchone return self.cursor.fetchone() File "/usr/local/lib/python3.5/dist-packages/teradata/util.py", line 121, in fetchone return next(self, None) File "/usr/local/lib/python3.5/dist-packages/teradata/util.py", line 163, in next values = next(self.iterator) File "/usr/local/lib/python3.5/dist-packages/teradata/tdodbc.py", line 1157, in rowIterator indicators, rowIndex) File "/usr/local/lib/python3.5/dist-packages/teradata/tdodbc.py", line 1131, in _getRow bufSize * rowIndex)) File "/usr/local/lib/python3.5/dist-packages/teradata/tdodbc.py", line 142, in _outputStr return unicode(s.raw.partition(b'\00')[0], 'utf8') UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 0: invalid continuation byte

naveenrc commented 6 years ago

Had to change the encoding to latin-1 in tdodbc.py _outputstr