question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intended behaviour of add_pathlist_to_PYTHONPATH not clear

See original GitHub issue

What is the intended behaviour is of the function add_pathlist_to_PYTHONPATH() in spyder.utils.misc? That function is used in the unittest plugin, but I’m not sure what it is supposed to do and whether it is used correctly in the plugin.

This is prompted by the following comment in PR spyder-ide/spyder-unittest#150 (but I remember that I was puzzled by this in the past):

I’m not sure if this isn’t a logic flaw in add_pathlist_to_PYTHONPATH: I think if ipyconsole is False it should look for PYTHONPATH not in the actual OS environment but in the passed-in env list.

This function is ten years old and added in commit eeb594aec07ac6d854177179fcf226febd3379e3 by Pierre.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jitseniesencommented, Oct 20, 2020

It looks much better now, thanks!

0reactions
ccordoba12commented, Oct 20, 2020

Great! I think the original intent of that function was the one I left in PR #14022.

The problem is I hijacked it to use it in our kernelspec several years ago.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python subprocess Popen environment PATH? - Stack Overflow
I meant to say that the directory from which python is executed, that directory is added to pythonpath. Here in the 2nd case,...
Read more >
Using PYTHONPATH — Functional MRI methods
The PYTHONPATH variable has a value that is a string with a list of directories that Python should add to the sys.path directory...
Read more >
site — Site-specific configuration hook — Python 3.11.1 ...
Non-existing items are never added to sys.path , and no check is made that the item refers to a directory rather than a...
Read more >
How to set $PATH persistently? #527 - fish-shell/fish ... - GitHub
I try set -U PATH ~/.cabal/bin $PATH which sets it in the shell I type it in, but not any new shells I...
Read more >
Understanding the Python Path Environment Variable in Python
PYTHONPATH variable includes various directories as a string to be added to the sys.path directory list. So, with PYTHONPATH, users can import ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found