Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Better identification of broken Distribution objects #508

Open
Labels
help wantedExtra attention is needed
@henryiii

Description

@henryiii

Currently, I'm getting an error on Python 3.8 and 3.9 inpypa/build#820:

docker run --rm -it python:3.9 bashpip install toxgit clone https://github.com/pypa/buildcd buildtox -e py39 -- -k test_metadata_path_no_prepare -v
...File "/build/.tox/py39/lib/python3.9/site-packages/importlib_metadata/compat/py39.py", line 23, in normalized_namereturn Prepared.normalize(getattr(dist,"name",None)or dist.metadata['Name'])  File"/build/.tox/py39/lib/python3.9/site-packages/importlib_metadata/__init__.py", line889, innormalizereturn re.sub(r"[-_.]+","-", name).lower().replace('-','_')  File"/usr/local/lib/python3.9/re.py", line210, insubreturn _compile(pattern, flags).sub(repl, string, count)TypeError:expected string or bytes-like object

The problem isdist.__dict__={'_path': PosixPath('/build/tests/packages/test-no-prepare/test_no_prepare.egg-info')}. I think this is tripping up ontests/packages/test-no-prepare/test_no_prepare.egg-info/ and the local backend. But I don't know what updated to cause this to start happening.

Regardless of the solution, though, I think the handling here for a missing name should be better, there wasn't any useful info in the error message to tell me about thedist that was failing. I had to addprint(f"{dist.__dict__=}") to see it. Or maybe the normalize name could return None, and let the failure happen elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp