#513 unhelpful error if sources file does not exist
Closed: Fixed 3 years ago by onosek. Opened 3 years ago by orion.

I often use fedpkg to build local rpm packages that do not have the full layout. Currently if there is no sources file present I get this unhelpful error running fedpkg local:

Could not execute local: 'NoneType' object has no attribute 'startswith'

Backtrace:

Traceback (most recent call last):
  File "/usr/bin/fedpkg", line 9, in <module>
    load_entry_point('fedpkg==1.38', 'console_scripts', 'fedpkg')()
  File "/usr/lib/python2.7/site-packages/fedpkg/__main__.py", line 87, in main
    sys.exit(client.args.command())
  File "/usr/lib/python2.7/site-packages/pyrpkg/cli.py", line 2164, in local
    self.sources()
  File "/usr/lib/python2.7/site-packages/pyrpkg/cli.py", line 2598, in sources
    self.cmd.sources(outdir)
  File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 2075, in sources
    if not os.path.exists(self.sources_filename):
  File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 1099, in sources_filename
    return os.path.join(self.path, self.layout.sources_file_template)
  File "/usr/lib64/python2.7/posixpath.py", line 75, in join
    if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'

this is because sources_file_template is None.

It would be nice to still be able to do fedpkg local in directories without a sources file.


This change (under code-review) should help:
https://pagure.io/rpkg/pull-request/512

Until then, try workaround touch sources in the repo directory.

ah, thanks. I should have checked the pull requests as well...

Metadata Update from @onosek:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

3 years ago

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

a year ago

Login to comment on this ticket.

Metadata