Skip to content

Strange additional characters in Oracle error messages. #489

@mpf82

Description

@mpf82

Environment

  • Python: 3.4.3 64bit
  • pyodbc: 4.0.18+
  • OS: Windows 10 64bit
  • DB: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
  • driver: Oracle 12.02.00.01

Issue

When I recently upgraded from pyodbc 4.0.17 to 4.0.24 I noticed that I received additional characters in Oracle error messages.

For example the query SELECT FROM dual; (note the missing *) will return ('HY000', '[HY000] [Oracle][ODBC][Ora]ORA-00936: missing expression\n (936) (SQLExecDirectW)') in pyodbc 4.0.17.

(When I say "return" in this context, I mean it is throwing an exception with this message)

In pyodbc 4.0.18 (and also the latest 4.0.24) the same query returns ('HY000', '[HY000] [Oracle][ODBC][Ora]ORA-00936: missing expression\n\x00\x00\x00\x00\x00\x00\x00ᾨգ\x00\x00\x00\x00\x00\x00\uec28昝\x00\x00鋈թ\x00\x00ຂ昘\x00\x00㙐\x00\x00\x00\ueed0¾\x00\x00\ueed4¾\x00\x00\x00\x00\x00\x00㙐\x00 (936) (SQLExecDirectW)')

In the 4.0.18 release notes I have found:

Fix Unicode error messages that were sometimes garbled in the past.

But it seems from this version on, the error messages now contain additional garbage data, at least in Oracle.

I have also tried various combinations of setencoding and setdecoding, but this strange "extra data" was never successfully unscrambled.

AFAICT, everything else (INSERT / UPDATE / DELETE / ...) is working fine.

Edit:

I am not sure if this related to issue #369 because, as you can see, the first part of the error is perfectly readable, and that's basically all there is to the error.

This issue is about extra data that is contained in the exception, that does not seem to be part of the actual error message.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions