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: convert_path fails with empty pathname
Type: Stage:
Components: Distutils Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: adalvi, loewis, nnorwitz
Priority: normal Keywords:

Created on 2002-06-26 19:48 by adalvi, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
dutil.patch nnorwitz, 2002-06-27 02:02 patch to return pathname if it is false
Messages (5)
msg11341 - (view) Author: Aneesh Dalvi (adalvi) Date: 2002-06-26 19:48
In distutils/util.py, in the function convert_path, I find I 
have to add the following two lines:

def convert_path (pathname):
    ...
    if os.sep == '/':
        return pathname
>>    if pathname=='':
>>        return pathname

This is required when installing piddle-1.0.15 on a Win32 
platform.  It is required under Python 2.1.2 as well as 
2.2.1.

I don't know if it is something specific to piddle, Win32, 
or something else.
msg11342 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2002-06-27 02:02
Logged In: YES 
user_id=33168

This approach seems reasonable.
I've attached a patch.
I'm not sure why an empty path would
be passed, but I suppose it can't hurt to check.
msg11343 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2002-08-11 15:33
Logged In: YES 
user_id=33168

Martin, could you please review this patch?  Should this be
implemented?
msg11344 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-08-11 21:07
Logged In: YES 
user_id=21627

I've checked piddle, and the traceback is

Traceback (most recent call last):
  File "setup.py", line 28, in ?
    packages = ['piddle', 'piddle.piddleGTK',
'piddle.piddleSVG', 'piddle.piddleTK2'] )
  File "/usr/local/lib/python2.3/distutils/core.py", line
140, in setup
    dist.run_commands()
  File "/usr/local/lib/python2.3/distutils/dist.py", line
886, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python2.3/distutils/dist.py", line
906, in run_command
    cmd_obj.run()
  File
"/usr/local/lib/python2.3/distutils/command/install.py",
line 504, in run
    self.run_command(cmd_name)
  File "/usr/local/lib/python2.3/distutils/cmd.py", line
334, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python2.3/distutils/dist.py", line
906, in run_command
    cmd_obj.run()
  File
"/usr/local/lib/python2.3/distutils/command/install_data.py",
line 61, in run
    dir = convert_path(f[0])
  File "/usr/local/lib/python2.3/distutils/util.py", line
85, in convert_path
    assert pathname
AssertionError

(the assertion is a local change). This in turn results from

      data_files = [ ('piddle/pilfonts', pilfontsList),
                     ('piddle', ['src/piddle/python.gif']),
                     ('', ['src/piddle.pth']) ],

i.e. it tries to install piddle.pth into install_dir.

So the change is ok, although I'm not sure whether
install_data's usage of convert_path is correct. E.g. it
tries to support absolute paths, which are rejected in
convert_path.
msg11345 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2002-08-13 17:50
Logged In: YES 
user_id=33168

Checked in as distutils/util.py 1.70 and 1.65.6.1.
Thanks!
History
Date User Action Args
2022-04-10 16:05:27adminsetgithub: 36804
2002-06-26 19:48:03adalvicreate