#126 cannot publish_file a file without name

closed-fixed
nobody
None
5
2010-01-06
2009-12-30
U
No

This is a regression of docutils 0.6:

$ cat test.py
from StringIO import StringIO
from docutils.core import publish_file
publish_file(source=StringIO('foobar'))

$ python test.py
Traceback (most recent call last):
File "test.py", line 3, in <module>
publish_file(source=StringIO('foobar'))
File "/usr/lib/pymodules/python2.5/docutils/core.py", line 362, in publish_file
enable_exit_status=enable_exit_status)
File "/usr/lib/pymodules/python2.5/docutils/core.py", line 646, in publish_programmatically
output = pub.publish(enable_exit_status=enable_exit_status)
File "/usr/lib/pymodules/python2.5/docutils/core.py", line 203, in publish
self.settings)
File "/usr/lib/pymodules/python2.5/docutils/readers/__init__.py", line 69, in read
self.parse()
File "/usr/lib/pymodules/python2.5/docutils/readers/__init__.py", line 74, in parse
self.document = document = self.new_document()
File "/usr/lib/pymodules/python2.5/docutils/readers/__init__.py", line 80, in new_document
document = utils.new_document(self.source.source_path, self.settings)
File "/usr/lib/pymodules/python2.5/docutils/utils.py", line 424, in new_document
source_path = decode_path(source_path)
File "/usr/lib/pymodules/python2.5/docutils/utils.py", line 340, in decode_path
path = path.decode(sys.getfilesystemencoding(), 'strict')
AttributeError: 'NoneType' object has no attribute 'decode'

Discussion

  • Günter Milde

    Günter Milde - 2010-01-06

    utils.decode_path() now tolerates path == None

     
  • Günter Milde

    Günter Milde - 2010-01-06
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks