Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMESTAMP problem with the coding ... #320

Closed
Strelok2015Strelok opened this issue Mar 2, 2015 · 4 comments · Fixed by #456
Closed

TIMESTAMP problem with the coding ... #320

Strelok2015Strelok opened this issue Mar 2, 2015 · 4 comments · Fixed by #456

Comments

@Strelok2015Strelok
Copy link

  File "/usr/local/lib/python3.4/dist-packages/pymysql/converters.py", line 264, in convert_mysql_timestamp
    timestamp += "0"*(14-len(timestamp)) # padding
TypeError: can't concat bytes to str

print(type(timestamp)):
b'2015-01-13 04:37:49' <class 'bytes'>

Temporarily solved the problem this way:

    if isinstance(timestamp, bytes):
        timestamp = timestamp.decode()
@methane
Copy link
Member

methane commented Mar 3, 2015

Do you use use_unicode=False?

@Strelok2015Strelok
Copy link
Author

Yes, I used use_unicode = False
Thank you, this has helped to solve the problem:
&use_unicode=True

@methane
Copy link
Member

methane commented Mar 3, 2015

OK. I got it.

@methane
Copy link
Member

methane commented Mar 3, 2015

Don't close this until I fix it.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants