Read-only files cause PermissionError with python plugin
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
Low
|
Larry Price |
Bug Description
snapcraft version 2.21+17.10
When building my snap using the python plugin, I get the following error:
Traceback (most recent call last):
File "/usr/bin/
snapcraft.
File "/usr/lib/
return run(args, project_options)
File "/usr/lib/
lifecycle.
File "/usr/lib/
snap = execute('prime', project_options)
File "/usr/lib/
_Executor(
File "/usr/lib/
self.
File "/usr/lib/
getattr(part, step)()
File "/usr/lib/
self.
File "/usr/lib/
r'#
File "/usr/lib/
search_pattern, replacement)
File "/usr/lib/
with open(file_path, 'r+') as f:
PermissionError: [Errno 13] Permission denied: '/home/
The file libertine-lxc-sudo is installed as readonly. The error is caused by the python plugin's indiscriminate r+ open of every file. Easy fix by adding an "except PermissionError" around the open or checking for write permissions on the file.
description: | updated |
Changed in snapcraft: | |
milestone: | none → 2.24 |
assignee: | nobody → Larry Price (larryprice) |
status: | New → In Progress |
importance: | Undecided → Low |
status: | In Progress → Fix Committed |
Changed in snapcraft: | |
status: | Fix Committed → Fix Released |
See PR: https:/ /github. com/snapcore/ snapcraft/ pull/892