#663 Could not execute prep: 'NoneType' object has no attribute 'replace'
Closed: Fixed by onosek. Opened by churchyard.

When there is no spec file (i.e. the package was retired), fedpkg prep ends with:

Could not execute prep: 'NoneType' object has no attribute 'replace'

It took me a while to out what's happening. Could it please say:

Could not execute prep: There is no spec file.

instead?

Traceback here:

$ fedpkg --debug --verbose prep
Could not execute prep: 'NoneType' object has no attribute 'replace'
Traceback (most recent call last):
  File "/usr/bin/fedpkg", line 33, in <module>
    sys.exit(load_entry_point('fedpkg==1.44', 'console_scripts', 'fedpkg')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/fedpkg/__main__.py", line 89, in main
    sys.exit(client.args.command())
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pyrpkg/cli.py", line 2808, in prep
    self.sources()
  File "/usr/lib/python3.11/site-packages/pyrpkg/cli.py", line 2888, in sources
    self.cmd.sources(outdir, force)
  File "/usr/lib/python3.11/site-packages/pyrpkg/__init__.py", line 2223, in sources
    if not os.path.exists(self.sources_filename):
                          ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pyrpkg/__init__.py", line 1173, in sources_filename
    self.path, self.layout.sources_file_template.replace("{0.repo_name}", self.repo_name))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'replace'

python3-rpkg-1.66-2.fc37.noarch


Commit 1108810b fixes this issue

Thanks

A moment ago I have found, that the fix broke the retire function. So it will need additional repair.

Commit 791fd03b fixes this issue

Metadata Update from @onosek:
- Issue set to the milestone: 1.67

Metadata
Related Pull Requests