Last modified: 2013-12-27 23:32:23 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T18716, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16716 - UnicodeEncodeError in profiling script report.py
UnicodeEncodeError in profiling script report.py
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Ori Livneh
http://noc.wikimedia.org/cgi-bin/repo...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-19 23:10 UTC by Siebrand Mazeland
Modified: 2013-12-27 23:32 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Siebrand Mazeland 2008-12-19 23:10:50 UTC
Given URL gives incomplete output, ending with the following error report:

dbg = 0, comparedformat = '\n<tr class="data"><td class="name">%s</td>\n<td>%...td><td>%.1f</td><td>%.1f</td><td>%.1f</td>\n</tr>\n', name = u'MessageCache::get-accesskey-n-\u304a\u77e5\u3089\u305b', name.replace = <built-in method replace of unicode object>, event = {'count': 1220, 'cpu': 0.074995999999999993, 'cpusq': 0.00052499999999999997, 'onecpu': 6.1472131147540985e-05, 'onereal': 8.372131147540983e-05, 'real': 0.10213999999999999, 'realsq': 6.4999999999999994e-05}, callcount = 4.7277100580675178e-05, countdiff = 0, realpct = 1.9333504993955514e-08, realpctdiff = 0, onereal = 8.372131147540983e-05, onerealdiff = 0

UnicodeEncodeError: 'ascii' codec can't encode characters in position 65-68: ordinal not in range(128) 
      args = ('ascii', u'\n<tr class="data"><td class="name">MessageCache:...0</td><td>0.0</td><td>0.1</td><td>0.0</td>\n</tr>\n', 65, 69, 'ordinal not in range(128)') 
      encoding = 'ascii' 
      end = 69 
      object = u'\n<tr class="data"><td class="name">MessageCache:...0</td><td>0.0</td><td>0.1</td><td>0.0</td>\n</tr>\n' 
      reason = 'ordinal not in range(128)' 
      start = 65
Comment 1 Brion Vibber 2008-12-19 23:51:27 UTC
Looks like the script needs to be told to output UTF-8, otherwise Python's defaulting to ASCII and it barfs on some of the print statements...

http://svn.wikimedia.org/viewvc/mediawiki/trunk/udpprofile/web/report.py?view=markup
Comment 2 Siebrand Mazeland 2011-05-14 09:19:31 UTC
Tim temporarily fixed this by using try/except so that the lines with issues are skipped. Will be overwritten by puppet.
Comment 3 Nemo 2012-08-23 18:39:55 UTC
Maybe Asher knows how to get report.py to behave?
Comment 4 Gerrit Notification Bot 2013-12-27 23:22:16 UTC
Change 104159 had a related patch set uploaded by Ori.livneh:
Make report.py set the default system encoding to UTF-8

https://gerrit.wikimedia.org/r/104159
Comment 5 Gerrit Notification Bot 2013-12-27 23:25:24 UTC
Change 104159 merged by Ori.livneh:
Make report.py set the default system encoding to UTF-8

https://gerrit.wikimedia.org/r/104159
Comment 6 Siebrand Mazeland 2013-12-27 23:27:54 UTC
Thanks for the fix! Nice surprise after 5 years :).

URL gives Permission denied now.
Comment 7 Siebrand Mazeland 2013-12-27 23:32:23 UTC
Updated URL.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links