JuliaPy / JuliaPy/PythonCall.jl

Completely disable outside python

Open
#234 26 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
1.1k
Forks
86
Avg merge
1d 22h
Merged PRs (30d)
3

Description

```julia
Package Version Build Channel Size
───────────────────────────────────────────────────────────────────────
Reinstall:
───────────────────────────────────────────────────────────────────────

o libstdcxx-ng 11.3.0 h239ccf8_18 conda-forge Cached
o python 3.10.6 h582c2e5_0_cpython conda-forge Cached

Summary:

Reinstall: 1 packages

Total download: 0 B

───────────────────────────────────────────────────────────────────────

Transaction starting
Changing libstdcxx-ng-11.3.0-h239ccf8_18 ==> libstdcxx-ng-11.3.0-h239ccf8_18
Changing python-3.10.6-h582c2e5_0_cpython ==> python-3.10.6-h582c2e5_0_cpython
Transaction finished
Python path configuration:
PYTHONHOME = '/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt'
PYTHONPATH = '/cvmfs/sft-nightlies.cern.ch/lcg/views/dev4/Wed/x86_64-centos7-gcc11-opt/lib/python3.9/site-packages/itk:/cvmfs/sft-nightlies.cern.ch/lcg/views/dev4/Wed/x86_64-centos7-gcc11-opt/python:/cvmfs/sft-nightlies.cern.ch/lcg/views/dev4/Wed/x86_64-centos7-gcc11-opt/lib:/cvmfs/sft-nightlies.cern.ch/lcg/views/dev4/Wed/x86_64-centos7-gcc11-opt/lib/python3.9/site-packages'
program name = '/home/jiling/.julia/dev/WVZAnalysis/.CondaPkg/env/bin/python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/home/jiling/.julia/dev/WVZAnalysis/.CondaPkg/env/bin/python'
sys.base_prefix = '/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt'
sys.base_exec_prefix = '/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt'
sys.platlibdir = 'lib'
sys.executable = '/home/jiling/.julia/dev/WVZAnalysis/.CondaPkg/env/bin/python'
sys.prefix = '/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt'
sys.exec_prefix = '/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt'
sys.path = [
'/cvmfs/sft-nightlies.cern.ch/lcg/views/dev4/Wed/x86_64-centos7-gcc11-opt/lib/python3.9/site-packages/itk',
'/cvmfs/sft-nightlies.cern.ch/lcg/views/dev4/Wed/x86_64-centos7-gcc11-opt/python',
'/cvmfs/sft-nightlies.cern.ch/lcg/views/dev4/Wed/x86_64-centos7-gcc11-opt/lib',
'/cvmfs/sft-nightlies.cern.ch/lcg/views/dev4/Wed/x86_64-centos7-gcc11-opt/lib/python3.9/site-packages',
'/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt/lib/python310.zip',
'/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt/lib/python3.10',
'/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt/lib/python3.10/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
```

The outside environment setup a pretty intrusive set of environment variables, how to protect against it?

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is named. Start by examining the reported Python path configuration and the interaction with external PYTHONHOME and PYTHONPATH variables. Done should mean that an outside environment cannot redirect the Python environment used by PythonCall, with a regression test covering the reported contamination.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia, python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.