Catkin plugin: empty segment added to PYTHONPATH

Bug #1714333 reported by Kyle Fazzari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
High
Kyle Fazzari

Bug Description

The Catkin plugin puts something along the following lines into the environment:

    export PYTHONPATH=foo:$PYTHONPATH

Which apparently is a bad thing, because if $PYTHONPATH is empty, that puts an empty segment on the PYTHONPATH which Python interprets as `.`, thus adding the current working directory to it. There are some modules that walk the PYTHONPATH (e.g. pkg_resources), and the current working directory is often inaccessible to the snap in confinement. No idea why Python works this way, but then again, I feel that way a lot toward Python. This needs to be fixed in the Catkin plugin to only append the current PYTHONPATH if it's actually set.

Kyle Fazzari (kyrofa)
Changed in snapcraft:
status: New → In Progress
assignee: nobody → Kyle Fazzari (kyrofa)
importance: Undecided → High
Revision history for this message
Kyle Fazzari (kyrofa) wrote :
Changed in snapcraft:
milestone: none → 2.35
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.