UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 8: ordinal not in range(128)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 89
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
I've an UWSGI-based irclog2html deployment that fails to render the index page with the following error:
```
Traceback (most recent call last):
File "/opt/irclog2html/local/lib/python2.7/site-packages/irclog2html/irclogserver.py", line 213, in application
dir_listing(stream, chan_path)
File "/opt/irclog2html/local/lib/python2.7/site-packages/irclog2html/irclogserver.py", line 116, in dir_listing
% (quote_plus(channel.name), escape(channel.name)),
File "/opt/irclog2html/local/lib/python2.7/site-packages/irclog2html/irclog2html.py", line 354, in escape
s = s.replace('&', '&').replace('<', '<').replace('>', '>').replace('"', '"')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 8: ordinal not in range(128)
```
This is on Python 2.7.
My irclogs tree has a directory named `'#gnome-'$'\020''�s��'$'\177'`, which is a result of a terrible irssi accident, I expect.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with irclogserver.py at dir_listing and irclog2html.py at escape, then reproduce the index-page failure using the malformed directory name described in the report. Trace how the channel name is passed into quote_plus and escape; done means the index renders without this UnicodeDecodeError while handling that directory name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100