Skip to content

Commit a974d09

Browse files
author
Paul Tagliamonte
committed
Bugfix for non-ascii chars using encode
1 parent c7ff4c7 commit a974d09

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2012-06-29 Paul Tagliamonte <[email protected]>
2+
3+
* sunlight/services/openstates.py:
4+
- Encode all URL pararms before they get to urlencode, in the event a
5+
non-ascii name is passed as a kwarg.
6+
* Bump release to 1.1.4
7+
18
2012-05-14 Paul Tagliamonte <[email protected]>
29

310
* sunlight/services/openstates.py:

sunlight/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"""
1212

1313
__appname__ = "sunlight"
14-
__version__ = "1.1.3"
14+
__version__ = "1.1.4"
1515

1616
import sunlight.services.openstates
1717
import sunlight.services.capitolwords

sunlight/services/openstates.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ def district_boundary(self, boundary_id, **kwargs):
178178
# API impl methods
179179

180180
def _get_url(self, objs, apikey, **kwargs):
181+
nargs = {}
182+
for arg in kwargs:
183+
nargs[arg] = kwargs[arg].encode('utf-8')
184+
kwargs = nargs
185+
181186
# Gate for any None's in the query. This is usually a problem.
182187
if None in objs:
183188
raise BadRequestException("`None' passed to the URL encoder (%s)" %

0 commit comments

Comments
 (0)