Pyodbc Exception Args Has Some Unidentified Characters
I am trying to log the pyodbc exception to a log file, the problem is, using the standard python logging, the code produces another exception related to encoding some unidentified
Solution 1:
You can get rid of them by encoding explicitly so that you can use errors="replace"
or ignore
The resulting bytes will not be pretty but they will be logged.
logging.error("Exception: " + str(ex.args[1].encode(encoding='charmap', errors='replace')))
Baca Juga
- Raise Imgurclienterror('json Decoding Of Response Failed.') Imgurpython.helpers.error.imgurclienterror: Json Decoding Of Response Failed
- Requests Module Missingschema Error In Tkinter Gui Due To Inability To Fill Variable Before Execution Of Mainloop: How To Resolve This?
- How To Install Cx_oracle On El Capitan
Post a Comment for "Pyodbc Exception Args Has Some Unidentified Characters"