## page was renamed from MoinMoinBugs/RecentChnagesProblemForUnicodeAttachmentNames = Description = Bug became obvious after upgrading from Python 2.4.1 to 2.4.2 since urllib.unquote was changed in the Python standard library. == Steps to reproduce == 1. Upload attachment with non-ascii name like `äöü.txt` 2. Look at RecentChanges == Details == Important part of traceback showing the error: {{{ D:\Home\MoinMoin\macro\RecentChanges.py in format_comment(request=, line=) 29 if line.action[:3] == 'ATT': 30 import urllib 31 filename = urllib.unquote(line.extra) 32 if line.action == 'ATTNEW': 33 comment = _("Upload of attachment '%(filename)s'.") % {'filename': filename} filename undefined, urllib = , urllib.unquote = , line = , line.extra = u'br%C3%BCckner_sapporo_20050930.doc' C:\Python24\Lib\urllib.py in unquote(s=u'br%C3%BCckner_sapporo_20050930.doc') 1059 item = res[i] 1060 try: 1061 res[i] = _hextochr[item[:2]] + item[2:] 1062 except KeyError: 1063 res[i] = '%' + item res = [u'br', u'C3', u'BCckner_sapporo_20050930.doc'], i = 1, global _hextochr = {'00': '\x00', '01': '\x01', '02': '\x02', '03': '\x03', '04': '\x04', '05': '\x05', '06': '\x06', '07': '\x07', '08': '\x08', '09': '\t', ...}, item = u'C3' UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128) __doc__ = 'Unicode decoding error.' __getitem__ = > __init__ = > __module__ = 'exceptions' __str__ = > args = ('ascii', '\xc3', 0, 1, 'ordinal not in range(128)') encoding = 'ascii' end = 1 object = '\xc3' reason = 'ordinal not in range(128)' start = 0 }}} Bug is not reproducible in this Wiki! || '''!MoinMoin Version''' || 1.3.4 || || '''OS and Version''' || Win XP Pro SR2 || || '''Python Version''' || 2.4.2 ( no Bug with 2.4.1) || || '''Server Setup''' || Apache 2.0.54, modpython 3.2.0b || == Workaround == * Apply following patch to `recentChanges.py` {{attachment:Fix.txt}} = Discussion = Please upgrade to 1.3.5. I'm not sure it will work there, but we can't support old versions of 1.3. A similar patch like you suggest was made in 1.5 branch few weeks ago. * Thanks Nir. Upgrading will not help. The 1.3.4 and 1.3.5 releases have the same problem in `recentChanges.py`. For me there is no need to upgrade since the problem is solved. Good to hear that this problem is already fixed in 1.5. I am really looking forward to the 1.5 release! You will have to apply similar patch to info action code, or Unicode attachments names in the page history will be displayed in a wrong way, or may raise the same exception that you get with Python 2.4.2. * You are right. The Code for the info in AttachFile.py is also buggy. But it will not raise an exception with Python 2.4.2 and thus is less severe. * Also history in wikiaction.py has to be fixed! (also gives no exception, but displays names in wrong way) You can get the patches used in 1.5 with tla: {{{ tla get arch@arch.thinkmo.de--2003-archives/moin--main--1.3--patch-925 tla get arch@arch.thinkmo.de--2003-archives/moin--main--1.3--patch-932 }}} = Plan = ## This part is for Moin``Moin developers: * Priority: * Assigned to: ThomasWaldmann * Status: should be fixed in 1.5 patch-103 ---- ## If you are a moin core developer, replace the category to Category* in these cases: ## Category MoinMoinNoBug - if this is not a bug. ## Category MoinMoinBugConfirmed - if you can confirm the bug on current code. ## Category MoinMoinBugFixed - after the bug is fixed in current code. CategoryMoinMoinBugFixed