Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

ValueError: invalid literal for int() with base 10: "b'0'" #107

Open
jmilagroso opened this issue Jan 17, 2018 · 4 comments
Open

ValueError: invalid literal for int() with base 10: "b'0'" #107

jmilagroso opened this issue Jan 17, 2018 · 4 comments

Comments

@jmilagroso
Copy link

Using BIT on mysql/mariadb

@iamwithnail
Copy link

iamwithnail commented Jan 17, 2018

Two suggestions, without seeing the DB that you're using it on.

When I've had this in the past it's been because the column setting on the originating database was a CharField (Char/Varchar) rather than an int. Can you supply the schema for the original table, and the full traceback? Ignore this, I didn't read the incredibly short issue properly. :D

Second thought - Are you using Python 2 or 3? You might run into problems if you've used Six to convert code and then using this module - if you're on python three then you might need to do a PR to add handling for that. Afaict and in the docs, it's only tested on 2.6 and 2.7. The bytestream flag should be ignored in Python2 and six won't convert it, which might lead to problems here.

In order to ease the 2.x-to-3.x transition, the b'...' literal syntax was backported to Python 2.6, in order to allow distinguishing binary strings (which should be bytes in 3.x) from text strings (which should be str in 3.x). The b prefix does nothing in 2.x, but tells the 2to3 script not to convert it to a Unicode string in 3.x.

It does look as though it's not picking up the bit field correctly when reading the data types, though.

@jmilagroso
Copy link
Author

jmilagroso commented Jan 18, 2018

Hi @iamwithnail.

I am using 2.7 version.

I ended up using the nodejs version of this. (1 problem though, it doesn't seem to import the partitions on tables)

Thanks!

@tmysik
Copy link

tmysik commented Oct 23, 2018

Any hint to solve this issue, please? Thanks.

@ssu1980
Copy link

ssu1980 commented Oct 27, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants