Skip to content

Commit

Permalink
Cast _download_suffix to str before concatenation
Browse files Browse the repository at this point in the history
If the `_download_suffix` was not loaded before, the concatenate operation will fail with `TypError` exception:

Traceback (most recent call last):
  File "/tmp/main.py", line 90, in <module>
    depgraph.display_problems()
  File "/home/arkq/.local/lib/python3.10/site-packages/_emerge/depgraph.py", line 10756, in display_problems
    self._show_circular_deps(self._dynamic_config._circular_deps_for_display)
  File "/home/arkq/.local/lib/python3.10/site-packages/_emerge/depgraph.py", line 10075, in _show_circular_deps
    self.display(handler.merge_list)
  File "/home/arkq/.local/lib/python3.10/site-packages/_emerge/depgraph.py", line 10263, in display
    return display(self, mylist, favorites, verbosity)
  File "/home/arkq/.local/lib/python3.10/site-packages/_emerge/resolver/output.py", line 863, in __call__
    self.verbose_size(pkg, None, pkg_info)
  File "/home/arkq/.local/lib/python3.10/site-packages/_emerge/resolver/output.py", line 318, in verbose_size
    myfilesdict = db.getfetchsizes(pkg.cpv, **kwargs)
  File "/home/arkq/.local/lib/python3.10/site-packages/portage/dbapi/porttree.py", line 1012, in getfetchsizes
    mystat = os.stat(file_path + _download_suffix)
TypeError: can only concatenate str (not "_LazyImportFrom") to str
  • Loading branch information
arkq committed Jun 27, 2024
1 parent 4d17764 commit 05d3e58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/portage/dbapi/porttree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ def getfetchsizes(self, mypkg, useflags=None, debug=0, myrepo=None):

if mystat is None:
try:
mystat = os.stat(file_path + _download_suffix)
mystat = os.stat(file_path + str(_download_suffix))
except OSError:
pass

Expand Down

0 comments on commit 05d3e58

Please sign in to comment.