pivotal_tools
pivotal_tools copied to clipboard
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 8383: ordinal not in range(128)
when doing pivotal_tools scrum {number} i get this error
Traceback (most recent call last):
File "/usr/local/bin/pivotal_tools", line 9, in <module>
load_entry_point('pivotal-tools==0.14', 'console_scripts', 'pivotal_tools')()
File "/usr/local/lib/python2.7/site-packages/pivotal_tools/cli.py", line 519, in main
scrum(project)
File "/usr/local/lib/python2.7/site-packages/pivotal_tools/cli.py", line 228, in scrum
bugs = project.open_bugs()
File "/usr/local/lib/python2.7/site-packages/pivotal_tools/pivotal.py", line 247, in open_bugs
return self.get_stories('type:bug state:unstarted')
File "/usr/local/lib/python2.7/site-packages/pivotal_tools/pivotal.py", line 219, in get_stories
stories_root = ET.fromstring(response.text)
File "/usr/local/Cellar/python/2.7.7_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1300, in XML
parser.feed(text)
File "/usr/local/Cellar/python/2.7.7_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1640, in feed
self._parser.Parse(data, 0)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 8383: ordinal not in range(128)
+1 :)
+1
+1
+1
Hey guys -- anyone have a PR to fix this. Happy to merge it in.
+1 ?
+1 Had the same issue with u'\u2019'. Is it just because an ASCII terminal is being used with Python. The pull request would need to filter/substitute non-ascii chars?
http://stackoverflow.com/questions/18473794/cant-print-character-u2019-in-python-from-json-object
+1
I had the same issue with accentuated characters.
I changed Line 196 : root = ET.fromstring(response.text.encode('ascii', 'ignore')) same thing with 219 : stories_root = ET.fromstring(response.text.encode('ascii', 'ignore'))
:+1: :confused:
Similar error for me:
❯ pivotal_tools show stories
Select a Project:
[1] Josephine
[2] MyPetStore
>> 1
Traceback (most recent call last):
File "/usr/local/bin/pivotal_tools", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/pivotal_tools/cli.py", line 512, in main
show_stories(project, arguments)
File "/usr/local/lib/python2.7/site-packages/pivotal_tools/cli.py", line 142, in show_stories
stories = project.get_stories(search_string)
File "/usr/local/lib/python2.7/site-packages/pivotal_tools/pivotal.py", line 219, in get_stories
stories_root = ET.fromstring(response.text)
File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1300, in XML
parser.feed(text)
File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1640, in feed
self._parser.Parse(data, 0)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2191' in position 12543: ordinal not in range(128)
Created a PR based on @PierrePaul's fix.
Hm. I just issued a PR for this, but I see there are several others that do the same thing. Is there an active fork of this project somewhere?
Looks like this fork implemented python3 support with backward compatibility, which solves a lot of issues: https://github.com/jtushman/pivotal_tools