﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19098	UnicodeDecodeError when including URLs in Windows with non-ASCII paths	artamoshin	nobody	"Including app URLs raises UnicodeDecodeError when project path contains non-ASCII characters (i.e. c:\Users\Александр\Documents\Projects')
{{{
Traceback (most recent call last):
  File ""C:\Python27\lib\wsgiref\handlers.py"", line 85, in run
    self.result = application(self.environ, self.start_response)
  File ""C:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py"", line 67, in __call__
    return self.application(environ, start_response)
  File ""C:\Python27\lib\site-packages\django\core\handlers\wsgi.py"", line 241, in __call__
    response = self.get_response(request)
  File ""C:\Python27\lib\site-packages\django\core\handlers\base.py"", line 146, in get_response
    response = debug.technical_404_response(request, e)
  File ""C:\Python27\lib\site-packages\django\views\debug.py"", line 443, in technical_404_response
    'reason': smart_str(exception, errors='replace'),
  File ""C:\Python27\lib\site-packages\django\utils\encoding.py"", line 116, in smart_str
    return str(s)
  File ""C:\Python27\lib\site-packages\django\core\urlresolvers.py"", line 235, in __repr__
    return smart_str(u'<%s %s (%s:%s) %s>' % (self.__class__.__name__, self.urlconf_name, self.app_name, self.namespace, self.regex.pattern))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 37: ordinal
 not in range(128)
}}}
because string module representation is bytesting that contains non-ASCII path, and it fails to format with u'%s' % self.urlconf_name.

My solution: convert string representation with sys.getfilesystemencoding() to Unicode."	Bug	closed	Core (URLs)	1.4	Normal	fixed	non-ascii unicode windows path UnicodeDecodeError url include		Accepted	1	0	0	0	0	0
