mgedmin / mgedmin/irclog2html

UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 8: ordinal not in range(128)

Open
#24 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.