[issue19570] distutils' Command.ensure_dirname fails on Unicode

Sascha Peilicke report at bugs.python.org
Wed Nov 13 14:11:57 CET 2013


New submission from Sascha Peilicke:

Encountered an isssue with Unicode paths when invoking Sphinx' distutils command (i.e. 'setup.py build_sphinx'): 

$ python setup.py build_sphinx
running build_sphinx
error: 'source_dir' must be a directory name (got `doc/source`)

...
(Pdb) l
 96                 for root, dirnames, filenames in os.walk(guess):
 97                     if 'conf.py' in filenames:
 98                         return root
 99             return None
100     
101  ->     def finalize_options(self):
102             if self.source_dir is None:
103                 self.source_dir = self._guess_source_dir()
104                 self.announce('Using source directory %s' % self.source_dir)
105             self.ensure_dirname('source_dir')
106             if self.source_dir is None:
(Pdb) n
> /usr/lib/python2.7/site-packages/sphinx/setup_command.py(102)finalize_options()
-> if self.source_dir is None:
(Pdb) n
> /usr/lib/python2.7/site-packages/sphinx/setup_command.py(105)finalize_options()
-> self.ensure_dirname('source_dir')
(Pdb) s
--Call--
> /usr/lib64/python2.7/distutils/cmd.py(266)ensure_dirname()
-> def ensure_dirname(self, option):
(Pdb) s
...
--Call--
> /usr/lib64/python2.7/distutils/cmd.py(253)_ensure_tested_string()
-> def _ensure_tested_string(self, option, tester,
(Pdb) 
> /usr/lib64/python2.7/distutils/cmd.py(255)_ensure_tested_string()
-> val = self._ensure_stringlike(option, what, default)


Command.ensure_dirname (likewise ensure_filename) fails because _ensure_stringlike only tests for isistance(..., str) rather than isinstance(..., types.StringTypes).

----------
components: Distutils
files: distutils-ensure_stringlike-unicode.patch
keywords: patch
messages: 202741
nosy: saschpe
priority: normal
severity: normal
status: open
title: distutils' Command.ensure_dirname fails on Unicode
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file32594/distutils-ensure_stringlike-unicode.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19570>
_______________________________________


More information about the Python-bugs-list mailing list