Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert_path fails with empty pathname #36804

Closed
adalvi mannequin opened this issue Jun 26, 2002 · 5 comments
Closed

convert_path fails with empty pathname #36804

adalvi mannequin opened this issue Jun 26, 2002 · 5 comments
Labels
stdlib Python modules in the Lib dir

Comments

@adalvi
Copy link
Mannequin

adalvi mannequin commented Jun 26, 2002

BPO 574235
Nosy @loewis
Files
  • dutil.patch: patch to return pathname if it is false
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2002-08-13.17:50:07.000>
    created_at = <Date 2002-06-26.19:48:03.000>
    labels = ['library']
    title = 'convert_path fails with empty pathname'
    updated_at = <Date 2002-08-13.17:50:07.000>
    user = 'https://bugs.python.org/adalvi'

    bugs.python.org fields:

    activity = <Date 2002-08-13.17:50:07.000>
    actor = 'nnorwitz'
    assignee = 'nnorwitz'
    closed = True
    closed_date = None
    closer = None
    components = ['Distutils']
    creation = <Date 2002-06-26.19:48:03.000>
    creator = 'adalvi'
    dependencies = []
    files = ['533']
    hgrepos = []
    issue_num = 574235
    keywords = []
    message_count = 5.0
    messages = ['11341', '11342', '11343', '11344', '11345']
    nosy_count = 3.0
    nosy_names = ['loewis', 'nnorwitz', 'adalvi']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue574235'
    versions = []

    @adalvi
    Copy link
    Mannequin Author

    adalvi mannequin commented Jun 26, 2002

    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.

    @adalvi adalvi mannequin closed this as completed Jun 26, 2002
    @adalvi adalvi mannequin assigned nnorwitz Jun 26, 2002
    @adalvi adalvi mannequin added the stdlib Python modules in the Lib dir label Jun 26, 2002
    @adalvi adalvi mannequin closed this as completed Jun 26, 2002
    @adalvi adalvi mannequin assigned nnorwitz Jun 26, 2002
    @adalvi adalvi mannequin added the stdlib Python modules in the Lib dir label Jun 26, 2002
    @nnorwitz
    Copy link
    Mannequin

    nnorwitz mannequin commented Jun 27, 2002

    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.

    @nnorwitz
    Copy link
    Mannequin

    nnorwitz mannequin commented Aug 11, 2002

    Logged In: YES
    user_id=33168

    Martin, could you please review this patch? Should this be
    implemented?

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Aug 11, 2002

    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.

    @nnorwitz
    Copy link
    Mannequin

    nnorwitz mannequin commented Aug 13, 2002

    Logged In: YES
    user_id=33168

    Checked in as distutils/util.py 1.70 and 1.65.6.1.
    Thanks!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants