1. Takahiro MINAMI
  2. sphinx-smzkw

Commits

Takayuki Shimizukawa  committed 66db2a4

fixed again: multibyte filename handling.

  • Participants
  • Parent commits 40c9407
  • Branches 1.0.7-ja

Comments (0)

Files changed (1)

File sphinx/cmdline.py

View file
 * with filenames, write these.""" % (__version__, argv[0])
 
 
+def unicode_abspath(path):
+    return unicode(path, sys.getfilesystemencoding())
+
+
 def main(argv):
     if not color_terminal():
         # Windows' poor cmd box doesn't understand ANSI sequences
     try:
         opts, args = getopt.getopt(argv[1:], 'ab:t:d:c:CD:A:ng:NEqQWw:P')
         allopts = set(opt[0] for opt in opts)
-        srcdir = confdir = unicode(path.abspath(args[0]), sys.getfilesystemencoding())
+        srcdir = confdir = unicode_abspath(args[0])
         if not path.isdir(srcdir):
             print >>sys.stderr, 'Error: Cannot find source directory.'
             return 1
             print >>sys.stderr, ('Error: Source directory doesn\'t '
                                  'contain conf.py file.')
             return 1
-        outdir = unicode(path.abspath(args[1]), sys.getfilesystemencoding())
+        outdir = unicode_abspath(args[1])
         if not path.isdir(outdir):
             print >>sys.stderr, 'Making output directory...'
             os.makedirs(outdir)
         elif opt == '-t':
             tags.append(val)
         elif opt == '-d':
-            doctreedir = path.abspath(val)
+            doctreedir = unicode_abspath(val)
         elif opt == '-c':
-            confdir = path.abspath(val)
+            confdir = unicode_abspath(val)
             if not path.isfile(path.join(confdir, 'conf.py')):
                 print >>sys.stderr, ('Error: Configuration directory '
                                      'doesn\'t contain conf.py file.')