AttributeError: NoneType has no attribute 'close'

Issue #269 resolved
Jason R. Coombs
created an issue

I recently found an error in sdist when running egg_info against a distribution with an invalid on Python 2.7.2.

PS C:\Users\jaraco\G\panoptic> ./setup egg_info
running egg_info
writing requirements to panoptic.egg-info\requires.txt
writing panoptic.egg-info\PKG-INFO
writing top-level names to panoptic.egg-info\top_level.txt
writing dependency_links to panoptic.egg-info\dependency_links.txt
writing entry points to panoptic.egg-info\entry_points.txt
reading manifest template ''
Traceback (most recent call last):
File "C:\Users\jaraco\G\panoptic\", line 46, in <module>
File "C:\Python\lib\site-packages\distribute-0.6.24-py2.7.egg\setuptools\command\", line 179, in run
File "C:\Python\lib\site-packages\distribute-0.6.24-py2.7.egg\setuptools\command\", line 310, in run
File "C:\Python\lib\site-packages\distribute-0.6.24-py2.7.egg\setuptools\command\", line 210, in read_template
File "C:\Python\lib\distutils\", line 128, in close
self.file.close ()
AttributeError: 'NoneType' object has no attribute 'close'

The error was masking the true error, which should have been:

File "C:\Python\lib\distutils\", line 201, in convert_path
raise ValueError, "path '%s' cannot end with '/'" % pathname
ValueError: path 'panoptic/htmldocs/' cannot end with '/'

It turns out that the [[|grody hack]] is patching a problem that was [[|fixed]] in recent releases of Python.

Comments (1)

  1. Log in to comment