This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: isabspath receiving path value of None in distutils.dist.py
Type: behavior Stage: resolved
Components: Build Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: holdenweb, jordannh, ned.deily
Priority: normal Keywords: patch

Created on 2014-02-28 16:18 by jordannh, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue20809-nontype-object-has-no-attribute-startswith.patch jordannh, 2014-02-28 16:21 Patch for the issue review
Messages (6)
msg212457 - (view) Author: <--This Guy (jordannh) Date: 2014-02-28 16:18
So far I've noticed this is only reproducible when running quickly with python2.7. Still, the error message seems like it would be confusing to new users to Python.

user@host:~/foo/bar/project$ sudo python setup.py install
DEBUG: Adding /foo/bar/project to system path.
ERROR: Python module settings not found
ERROR: Python module settings not found
.... # basically, more DistUtilsExtra errors...
running install
DEBUG: Adding /foo/bar/project to system path.
running build
running build_py
running build_scripts
running build_i18n
DEBUG: Desktop files: ['project.desktop.in']
intltool-update -p -g ryode
running build_icons
running build_help
running install_lib
copying build/lib/__init__.py -> /usr/local/lib/python2.7/site-packages
copying build/lib/ryode/__init__.py -> /usr/local/lib/python2.7/site-packages/ryode
byte-compiling /usr/local/lib/python2.7/site-packages/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/site-packages/ryode/__init__.py to __init__.pyc
running install_scripts
copying build/scripts-2.7/project -> /usr/local/bin
changing mode of /usr/local/bin/project to 775
running install_data
copying build/share/applications/project.desktop -> /usr/local/share/applications
running install_egg_info
Removing /usr/local/lib/python2.7/site-packages/project-0.1-py2.7.egg-info
Writing /usr/local/lib/python2.7/site-packages/project-0.1-py2.7.egg-info
Traceback (most recent call last):
  File "setup.py", line 144, in <module>
    cmdclass={'install': InstallAndUpdateDataDirectory}
  File "/usr/local/lib/python2.7/site-packages/python_distutils_extra-2.38-py2.7.egg/DistUtilsExtra/auto.py", line 100, in setup
    distutils.core.setup(**attrs)
  File "/usr/local/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 116, in run
    target_data = '/' + os.path.relpath(self.install_data, self.root) + '/'
  File "/usr/local/lib/python2.7/posixpath.py", line 437, in relpath
    start_list = [x for x in abspath(start).split(sep) if x]
  File "/usr/local/lib/python2.7/posixpath.py", line 367, in abspath
    if not isabs(path):
  File "/usr/local/lib/python2.7/posixpath.py", line 61, in isabs
    return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
msg212464 - (view) Author: Steve Holden (holdenweb) * (Python committer) Date: 2014-02-28 19:17
I hope the title change is helpful. It's not clear from the report what module is being installed, or even whether that is a relevant factor.
msg212465 - (view) Author: Steve Holden (holdenweb) * (Python committer) Date: 2014-02-28 19:17
Typo, sorry
msg212466 - (view) Author: Steve Holden (holdenweb) * (Python committer) Date: 2014-02-28 19:18
Further typo, sorry again.
msg212467 - (view) Author: Steve Holden (holdenweb) * (Python committer) Date: 2014-02-28 19:21
The submitted patch does not approach the issue, since the real question is WHY is the function being passed a None argument in the first place. Without extensive testing there would be no guarantees that this change would not result in breakage elsewhere.
msg212471 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-02-28 19:59
The particular error you see is caused by code in the setup.py file of the project you are installing. I suggest you figure out what's going on there:

File "setup.py", line 116, in run
    target_data = '/' + os.path.relpath(self.install_data, self.root) + '/'
History
Date User Action Args
2022-04-11 14:57:59adminsetgithub: 65008
2014-02-28 19:59:55ned.deilysetstatus: open -> closed

nosy: + ned.deily
messages: + msg212471

resolution: not a bug
stage: resolved
2014-02-28 19:21:11holdenwebsetmessages: + msg212467
2014-02-28 19:18:08holdenwebsetmessages: + msg212466
title: isabspath receiving path value of None in ditdutils.dist.py -> isabspath receiving path value of None in distutils.dist.py
2014-02-28 19:17:39holdenwebsetmessages: + msg212465
title: isabspath receiving path value on None in ditdutils.dist.py -> isabspath receiving path value of None in ditdutils.dist.py
2014-02-28 19:17:16holdenwebsetnosy: + holdenweb

messages: + msg212464
title: isabspath fails if path is None -> isabspath receiving path value on None in ditdutils.dist.py
2014-02-28 16:21:23jordannhsetfiles: + issue20809-nontype-object-has-no-attribute-startswith.patch
keywords: + patch
2014-02-28 16:18:36jordannhcreate