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

pa-philadelphia María Quiñones-Sánchez page contains unicode chars #9

Closed
rchekaluk opened this issue Aug 19, 2013 · 1 comment
Closed

Comments

@rchekaluk
Copy link

Error when Billy scrapes this page:

02:05:18 INFO scrapelib: GET -
http://philadelphiacitycouncil.net/council-members/councilwoman-maria-d-quinones-sanchez-7th-district/councilwoman-maria-d-quinones-sanchez-contact/
Traceback (most recent call last):
File "/u/apps/virtualenvs/billy/src/billy/billy/ext/ansistrm.py", line 56, in emit
stream.write(message)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 45:
ordinal not in range(128)
Logged from file init.py, line 177

Here are the obvious non-ascii chars I can see, indeed the first one is Unicode point F1:

Not certain, but I'm wondering if Billy might be constrained to the ascii character set:

billy$ find . -type f -print | xargs grep ascii | egrep -v git
./billy/importers/bills.py:            r.encode('ascii', 'replace') for r in remaining]))
./billy/importers/committees.py:            logger.debug("No matches for %s" % member['name'].encode('ascii',
./billy/web/api/emitters.py:                           ensure_ascii=False)
./billy/web/api/emitters.py:        return obj.encode("ascii", "replace")
./billy/scrape/bills.py:        return filename.encode('ascii', 'replace')
./billy/scrape/legislators.py:        return filename.encode('ascii', 'replace')
./billy/scrape/legislators.py:        return filename.encode('ascii', 'replace')
./billy/utils/fulltext.py:        text = text.encode('ascii', 'ignore')
./billy/utils/fulltext.py:        text = text.decode('utf8', 'ignore').encode('ascii', 'ignore')
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