2009-12-23 06:15:25 |
Philip Peitsch |
description |
There is a missing import sys command in the setup.py. This means that if an install is attempted with the setup.py, the resulting error is actually thrown by missing the sys.exit() command, rather than just notifying that the config cannot be found.
The output of the incorrect version is:
~$ python setup.py install
running install
ERROR: Can't find demoproject/demoprojectconfig.py
Traceback (most recent call last):
File "setup.py", line 92, in <module>
cmdclass={'install': InstallAndUpdateDataDirectory}
File "/usr/lib/python2.6/dist-packages/DistUtilsExtra/auto.py", line 92, in setup
distutils.core.setup(**attrs)
File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "setup.py", line 72, in run
previous_value = update_data_path(self.prefix + '/share/demoproject/')
File "setup.py", line 43, in update_data_path
sys.exit(1)
With the fix in place, the behaviour becomes
~$ python setup.py install
running install
ERROR: Can't find demoproject/demoprojectconfig.py
The fix is rather straightforward, being to import the sys module in the setup.py file. |
There is a missing import sys command in the setup.py. This means that if an install is attempted with the setup.py, an exception is thrown by missing the sys.exit() command, rather than just notifying that the config cannot be found.
The output of the incorrect version AFTER REMOVING THE demoprojectconfig.py file is:
~$ python setup.py install
running install
ERROR: Can't find demoproject/demoprojectconfig.py
Traceback (most recent call last):
File "setup.py", line 92, in <module>
cmdclass={'install': InstallAndUpdateDataDirectory}
File "/usr/lib/python2.6/dist-packages/DistUtilsExtra/auto.py", line 92, in setup
distutils.core.setup(**attrs)
File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "setup.py", line 72, in run
previous_value = update_data_path(self.prefix + '/share/demoproject/')
File "setup.py", line 43, in update_data_path
sys.exit(1)
With the fix in place, the behaviour becomes
~$ python setup.py install
running install
ERROR: Can't find demoproject/demoprojectconfig.py
The fix is rather straightforward, being to import the sys module in the setup.py file.
|
|