* PYTHONPATH anomaly
@ 2016-09-04 17:21 Hartmut Goebel
2016-09-07 9:17 ` Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Hartmut Goebel @ 2016-09-04 17:21 UTC (permalink / raw)
To: Guix-devel
Hi,
Introduction:
today I kept struggling with obscure failing tests with a python
package: some of the test-files kept failing to import the very package,
while others succedes. It figured out that one of the test-files did
manipulate sys.path, so the test-files loaded earlier did raise the
import error and those loaded afterwards passed.
Trying to reproduce this in a venv, did not succeed. Say: the test pass.
As reason for this difference I discovered that in guix the current path
is not part of sys.path, while in the venv it is.
Questions:
1) Is it intended that the current dir is not part of sys.path?
2) Where is this patched into?
3) Why does this problem not occur when running "setup.py test"
4) Related: Shouldn't "build/lib" (resp. the related one for extension
packages) be preppended to sys.path? As this is where the build python
files are.
--
Regards
Hartmut Goebel
| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PYTHONPATH anomaly
2016-09-04 17:21 PYTHONPATH anomaly Hartmut Goebel
@ 2016-09-07 9:17 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2016-09-07 9:17 UTC (permalink / raw)
To: Hartmut Goebel; +Cc: Guix-devel
Hello!
Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
> Questions:
>
> 1) Is it intended that the current dir is not part of sys.path?
I don’t know about the specifics of Python here, but it’s always a
security problem to put “.” in a search path: users could end up
arbitrary code that just happens to be in $PWD.
So it’s probably intended.
Ludo’.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-07 9:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-04 17:21 PYTHONPATH anomaly Hartmut Goebel
2016-09-07 9:17 ` Ludovic Courtès
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).