[cx-oracle-users] Can't have access to a corrupted VARCHAR2.
Brought to you by:
atuining
From: Stéphane J. <ste...@ju...> - 2018-03-16 14:00:14
|
Hello, I have a WINDOWS-1252 (cp1252) encoded Oracle database. A 6.2.1 cx_Oracle and a Python 3.6.4 distribution on Wondows. In some VARCHAR2 record of a table, I have corrupted data. When I try to select such records, I have : 'charmap' codec can't decode byte 0x90 in position 36: character maps to <undefi ned> (<class 'UnicodeDecodeError'>, UnicodeDecodeError('charmap', b'ELLE REVIENDRA VE RS NOUS - BIEN PLAC\X90\xc9S - ELLE ATTEND SON CLIENT', 36, 37, 'character maps to <undefined>'), <traceback object at 0x0000000003C6B5C8>) The \x90 character is not allowed in cp1252 encoding. Where cx_Oracle tries to convert to unicode, there is an exception. I suppose that a strict decode is used. I can't find a way to prevent or detect the crash. I can't event find a way to detect the key of the corrupted record. Is there a way to do a DECODE(..., 'IGNORE') in my Python Program or to receive the binary data like in Python 2 ? I thank you for your help. Best wishes. Stéphane |