[ python-Bugs-993766 ] bdist_dumb and --relative on Windows fails
SourceForge.net
noreply at sourceforge.net
Wed Feb 2 18:16:06 CET 2005
Bugs item #993766, was opened at 2004-07-19 15:03
Message generated for change (Comment added) made by lacouture
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=993766&group_id=5470
Category: Distutils
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Mark Hammond (mhammond)
Assigned to: Nobody/Anonymous (nobody)
Summary: bdist_dumb and --relative on Windows fails
Initial Comment:
The following setup.py file:
"""
from distutils.core import setup, Extension
setup(name="foo", scripts= ["foo.py"])
"""
(plus any 'foo.py') fails when creating a .zip binary
on windows:
>setup.py bdist_dumb --relative
running bdist_dumb
...
error: build\bdist.win32\dumb\e:src\python-2.3-cvs:
Invalid argument
----------------------------------------------------------------------
Comment By: Patrice LACOUTURE (lacouture)
Date: 2005-02-02 18:16
Message:
Logged In: YES
user_id=1120079
BTW, the patch shown in my previous comment applies to
distutils/dir_util.py from Python 2.4.
226c226
< path = drive + path[1:]
---
> path = path[1:]
----------------------------------------------------------------------
Comment By: Patrice LACOUTURE (lacouture)
Date: 2005-02-02 17:43
Message:
Logged In: YES
user_id=1120079
It seems related to the function ensure_relative
(distutils/dir_utils.py, line 217), that keeps the drive
name in the relative path built.
>>> ensure_relative("C:\Python24")
"C:Python24"
It is called by bdist_dumb to manage the relative path
properly, but fails so.
I can't guess what was the original intent (maybe for some
other OS, maybe just a simple error?), but the following
change seems to fix the issue:
$ diff --from-file=dir_util.old.py dir_util.py
226c226
< path = drive + path[1:]
---
> path = path[1:]
(just skip the drive name and the initial os.sep if any).
The ensure_relative() function is only used by bdist_dumb,
so I believe this change is safe, unless the "bogus" line
had some hidden intent I couldn't figure (other OS???).
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=993766&group_id=5470
More information about the Python-bugs-list
mailing list