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

Code out of box works for while then gives this error #9

Open
ghost opened this issue Jul 9, 2012 · 1 comment
Open

Code out of box works for while then gives this error #9

ghost opened this issue Jul 9, 2012 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 9, 2012

using linux box sqlite

[21:15:00] INFO::PyCrawler - Starting (http://www.dmoz.org)...
[21:15:00] ERROR::PyCrawler - EXCEPTION: 'ascii' codec can't decode byte 0xc3 in position 31: ordinal not in range(128)
Traceback (most recent call last):
File "PyCrawler.py", line 88, in
crawl()
File "PyCrawler.py", line 70, in crawl
if not cdb.checkCrawled(q):
File "/home/oguz/Desktop/taraa/query.py", line 84, in checkCrawled
s = select([self.crawl_table]).where(self.crawl_table.c.address == unicode(url))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 31: ordinal not in range(128)

@theanti9
Copy link
Owner

If you do a search for this error, you'll find that this probably has something to do with the charset that the database uses (particularly if you're using it with mysql, i believe that is the driver i saw the post about with this similar error). You can read about it here:

http://stackoverflow.com/questions/10264774/unicodedecodeerror-ascii-codec-cant-decode-byte-0x96-in-position-10-ordinal

I'm actually not real sure about how to set that with SQLAlchemy, but I'm sure it's in the documentation somewhere. I don't really have time to work on this project right now unfortunately but I believe this fix is pretty simple. If you wouldn't mind, i'd love for you to fork it and make any changes you see fit to solve this, the other issue you opened, or any others you find, and I can merge them back later.

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

No branches or pull requests

1 participant