Bug 1935886 - Python dist dep generator crashes silently when nonexisitng ghost .egg-info is passed to %python_extras_subpkg
Summary: Python dist dep generator crashes silently when nonexisitng ghost .egg-info i...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-rpm-generators
Version: 34
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Orsava
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-05 17:43 UTC by Miro Hrončok
Modified: 2021-07-01 10:20 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-08 09:24:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2021-03-05 17:43:55 UTC
When I get the python-twisted package at https://src.fedoraproject.org/rpms/python-twisted/c/0c1cdc460ff7877bd07c0305a192aec9c59f3366 and re-intorduce this line:

%{?python_extras_subpkg:%python_extras_subpkg -n python3-%{pypi_name} -i %{python3_sitearch}/Twisted-%{version}-py%{python3_version}.egg-info tls}

The generator (silently) crashes:

Traceback (most recent call last):
  File "/usr/lib/rpm/pythondistdeps.py", line 328, in <module>
    dist = Distribution(f)
  File "/usr/lib/rpm/pythondistdeps.py", line 56, in __init__
    self.normalized_name = normalize_name(self.name)
  File "/usr/lib/rpm/pythondistdeps.py", line 38, in normalize_name
    return re.sub(r'[-_.]+', '-', name).lower()
  File "/usr/lib64/python3.9/re.py", line 210, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object
Traceback (most recent call last):
  File "/usr/lib/rpm/pythondistdeps.py", line 328, in <module>
    dist = Distribution(f)
  File "/usr/lib/rpm/pythondistdeps.py", line 56, in __init__
    self.normalized_name = normalize_name(self.name)
  File "/usr/lib/rpm/pythondistdeps.py", line 38, in normalize_name
    return re.sub(r'[-_.]+', '-', name).lower()
  File "/usr/lib64/python3.9/re.py", line 210, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object

Comment 1 Miro Hrončok 2021-03-05 17:47:56 UTC
Additional info.

With python3-rpm-generators-12-1.fc34, the build actually fails with:


Error: The package name contains an extras name `tls` that was not found in the metadata.
Check if the extras were removed from the project. If so, consider removing the subpackage and obsoleting it from another.

error: Dependency tokens must begin with alpha-numeric, '_' or '/': *** PYTHON_EXTRAS_NOT_FOUND_ERROR___SEE_STDERR ***




That is also wrong. The extra is in /usr/lib/python3.9/site-packages/Twisted-21.2.0-py3.9.egg-info/requires.txt specified as follows:

...

[tls]
pyopenssl>=16.0.0
service_identity>=18.1.0
idna>=2.4

...

Comment 2 Miro Hrončok 2021-03-05 17:59:11 UTC
So, I've panicked for no reason, this was my PEBKAC.

I've added:

%{?python_extras_subpkg:%python_extras_subpkg -n python3-%{pypi_name} -i %{python3_sitearch}/Twisted-%{version}-py%{python3_version}.egg-info tls}

But the metadata is in sitelib, not sitearch, so it doe snot exists.


We should anyway make sure that if this happens:

 - the error message says: /usr/lib64/python3.9/site-packages/Twisted-21.2.0-py3.9.egg-info does not exist
 - the build fails

Both this does not have high severity.

Comment 3 Tomas Orsava 2021-06-08 09:07:04 UTC
PR has been merged: https://src.fedoraproject.org/rpms/python-rpm-generators/pull-request/40

Comment 4 Tomas Orsava 2021-06-08 09:10:21 UTC
Fixed in rawhide.

Comment 5 Tomas Orsava 2021-07-01 10:20:26 UTC
Test, ignore this message.


Note You need to log in before you can comment on or make changes to this bug.