Skip to content

TIMESTAMP problem with the coding ... #320

Closed

Description

@Strelok2015Strelok
  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()

Activity

  1. methane commented on Mar 3, 2015

    @methane
    Member

    Do you use use_unicode=False?

  2. Strelok2015Strelok commented on Mar 3, 2015

    @Strelok2015Strelok
    Author

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

  3. methane commented on Mar 3, 2015

    @methane
    Member

    OK. I got it.

  4. reopened this on Mar 3, 2015
  5. methane commented on Mar 3, 2015

    @methane
    Member

    Don't close this until I fix it.

  6. locked as resolved and limited conversation to collaborators on Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions