Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 884071 - sys-apps/portage - handle PermissionError from lockfile() portage.package.ebuild.fetch.fetch()?
Summary: sys-apps/portage - handle PermissionError from lockfile() portage.package.ebu...
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
Depends on:
Reported: 2022-12-02 22:54 UTC by emdee_is
Modified: 2022-12-03 02:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---

Perplexing traceback from media-libs/virglrenderer-0.10.1 (virgilrenderer.out,1.98 KB, text/x-maxima-out)
2022-12-02 22:54 UTC, emdee_is
context diff for non-python programmers (,773 bytes, patch)
2022-12-03 00:57 UTC, emdee_is
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description emdee_is 2022-12-02 22:54:21 UTC
Created attachment 839195 [details]
Perplexing traceback from media-libs/virglrenderer-0.10.1

If the file lock at L1267 of portage/package/ebuild/ 
 file_lock = lockfile(myfile_path, wantnewlockfile=1, **lock_kwargs)
fails the user ends up with a perplexing double traceback (attached).

There should be an Exception clause added to the try: that signals
useful information back to the user:
                except Exception as e:
                            "!!! Unable to lock file  "
                            "%s \n"
                            "!!!   %s\n"
                        % (str(e), myfile,),
                    return 0
Comment 1 emdee_is 2022-12-03 00:57:41 UTC
Created attachment 839201 [details, diff]
context diff for non-python programmers
Comment 2 Mike Gilbert gentoo-dev 2022-12-03 02:47:11 UTC
I guess we don't really expect to get a PermissionError when creating a lock file. If that happens, something has probably gone horribly wrong.

The traceback doesn't seem too "perplexing" to me, and would actually be quite useful in debugging an error that should really never happen.