I'm creating charts using pygal in python and the script works fine in one machine but produces unicode decode error in the second one. No idea why.
#TCreating pygal charts
pie_chart = pygal.Pie(style=DarkSolarizedStyle, legend_box_size = 20)
pie_chart.title = 'Github/Jenkins-Migration Status Chart (in %)'
pie_chart.add('Intro', int(intro))
pie_chart.add('In Progress', int(in_progress) )
pie_chart.add('Parallel', int(parallel))
pie_chart.add('ParallelBuild', int(parallelBuild))
pie_chart.add('Complete', int(complete))
pie_chart.render_to_file("../../../../../usr/share/nginx/html/TeamFornax/githubMigration/OverallProgress/overallProgress.svg")
Works in one but gives error in second :
Traceback (most recent call last): File "migrationcharts.py", line 187, in <module>
pie_chart.render_to_file("../../../../../usr/share/nginx/html/TeamFornax/githubMigration/OverallProgress/overallProgress.svg")
File "/usr/lib/python2.6/site-packages/pygal/ghost.py", line 149, in render_to_file
f.write(self.render(is_unicode=True, **kwargs))
File "/usr/lib/python2.6/site-packages/pygal/ghost.py", line 112, in render
.render(is_unicode=is_unicode))
File "/usr/lib/python2.6/site-packages/pygal/graph/base.py", line 293, in render
is_unicode=is_unicode, pretty_print=self.pretty_print)
File "/usr/lib/python2.6/site-packages/pygal/svg.py", line 271, in render
self.root, **args)
File "/usr/lib64/python2.6/xml/etree/ElementTree.py", line 1010, in tostring
return string.join(data, "")
File "/usr/lib64/python2.6/string.py", line 318, in join
return sep.join(words)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 40: ordinal not in range(128)
Ran pdb and got this :
Traceback (most recent call last):
File "/usr/lib64/python2.6/pdb.py", line 1296, in main
pdb._runscript(mainpyfile)
File "/usr/lib64/python2.6/pdb.py", line 1215, in _runscript
self.run(statement)
File "/usr/lib64/python2.6/bdb.py", line 372, in run
exec cmd in globals, locals
File "<string>", line 1, in <module>
File "migrationcharts.py", line 185, in <module>
pie_chart.render_to_file("../../../../../usr/share/nginx/html/TeamFornax/githubMigration/OverallProgress/overallProgress.svg")
File "/usr/lib/python2.6/site-packages/pygal/ghost.py", line 149, in render_to_file
f.write(self.render(is_unicode=True, **kwargs))
File "/usr/lib/python2.6/site-packages/pygal/ghost.py", line 112, in render
.render(is_unicode=is_unicode))
File "/usr/lib/python2.6/site-packages/pygal/graph/base.py", line 293, in render
is_unicode=is_unicode, pretty_print=self.pretty_print)
File "/usr/lib/python2.6/site-packages/pygal/svg.py", line 271, in render
self.root, **args)
File "/usr/lib64/python2.6/xml/etree/ElementTree.py", line 1010, in tostring
return string.join(data, "")
File "/usr/lib64/python2.6/string.py", line 318, in join
return sep.join(words)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 40: ordinal not in range(128)
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program