Can't have access to a corrupted VARCHAR2.
Stéphane JULIEN <stephane-W5t6FLjSki/[email protected]> Fri, 16 Mar 2018 14:58:13 +0100
| Newsgroups | gmane.comp.python.db.cx-oracle |
|---|---|
| Message-ID | <[email protected]> |
--===============4983113126635814731==
Content-Type: multipart/alternative;
boundary="=_72f585aaa8022e25871035d7764698fd"
--=_72f585aaa8022e25871035d7764698fd
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8
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
--=_72f585aaa8022e25871035d7764698fd
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3DUTF-8" /></head><body style=3D'font-size: 10pt; font-family: Verdana,Gen=
eva,sans-serif'>
<p>Hello,</p>
<p>I have a WINDOWS-1252 (cp1252) encoded Oracle database. A 6.2.1 cx_Oracl=
e and a Python 3.6.4 distribution on Wondows.</p>
<p>In some VARCHAR2 record of a table, I have corrupted data. When I try to=
select such records, I have :</p>
<p>'charmap' codec can't decode byte 0x90 in position 36: character maps to=
<undefi<br />ned><br />(<class 'UnicodeDecodeError'>, UnicodeD=
ecodeError('charmap', b'ELLE REVIENDRA VE<br />RS NOUS - BIEN PLAC<strong>\=
x90</strong>\xc9S - ELLE ATTEND SON CLIENT', 36, 37, 'character maps<br />t=
o <undefined>'), <traceback object at 0x0000000003C6B5C8>)</p>
<p>The \x90 character is not allowed in cp1252 encoding. Where cx_Oracle tr=
ies to convert to unicode, there is an exception. I suppose that a strict d=
ecode is used.</p>
<p>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.</p>
<p>Is there a way to do a <strong>decode(..., 'IGNORE')</strong> in my Pyth=
on Program or to receive the binary data like in Python 2 ?</p>
<p>I thank you for your help.</p>
<p>Best wishes.</p>
<div>
<div class=3D"pre" style=3D"margin: 0; padding: 0; font-family: monospace">=
Stéphane<br /><br /></div>
</div>
</body></html>
--=_72f585aaa8022e25871035d7764698fd--
--===============4983113126635814731==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--===============4983113126635814731==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
--===============4983113126635814731==--