Bug #80679 | Python Connector escape() errors out on dates | ||
---|---|---|---|
Submitted: | 9 Mar 2016 22:13 | Modified: | 16 Nov 2022 19:36 |
Reporter: | Sam King | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / Python | Severity: | S3 (Non-critical) |
Version: | 2.1.3 | OS: | Ubuntu |
Assigned to: | CPU Architecture: | Any | |
Tags: | escape |
[9 Mar 2016 22:13]
Sam King
[10 Mar 2016 7:47]
Chiranjeevi Battula
Hello Sam King, Thank you for the bug report. Verified this behavior on MySQL Connector/Python 2.1.3. Thanks, Chiranjeevi.
[10 Mar 2016 7:48]
Chiranjeevi Battula
Output: Traceback (most recent call last): File "D:\Python\80679.py", line 9, in <module> dbconn.converter.escape(datetime.datetime.now().date()) File "C:\Python27\lib\site-packages\mysql\connector\conversion.py", line 145, in escape value = value.replace('\\', '\\\\') TypeError: an integer is required
[16 Nov 2022 19:36]
Philip Olson
Posted by developer: Fixed as of the upcoming MySQL Connector/Python 8.0.32 release, and here's the proposed changelog entry from the documentation team: Using MySQLConverter.escape() on datetime objects raised this error: TypeError: an integer is required. Now it does not attempt to escape values that are not bytes or string types. Thank you for the bug report.