scraperwiki / dumptruck

Painlessly move data in and out of a SQLite database.
http://sensiblecode.io
BSD 2-Clause "Simplified" License
43 stars 11 forks source link

What's the policy on Unicode keys? #2

Closed frabcus closed 12 years ago

frabcus commented 12 years ago

If I use UTF-8 characters as a key:

https://gist.github.com/2489849

Then I get this error:

Traceback (most recent call last): File "./test.py", line 7, in dt.insert({"name": "Super Digger", "payload": 10, "英国": "yes"}) File "/Library/Python/2.7/site-packages/dumptruck/dumptruck.py", line 199, in insert self.create_table(data, table_name) File "/Library/Python/2.7/site-packages/dumptruck/dumptruck.py", line 186, in create_table );""" % (quote(table_name), quote(k), get_column_type(startdata[k])), commit = False) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 47: ordinal not in range(128)

It should probably just work. Failing that, it should give a more useful error.

Likewise, other unicode everywhere.

tlevine commented 12 years ago

It works a little bit better now; now it just returns in the wrong format.

tlevine commented 12 years ago

This is fixed. I haven't uploaded a new version to PyPI though.