Potential incorrect sys.path munging inside tasks
See original GitHub issueDescription
Problem:
- sys.path at fabfile module level seems to be fine
- However, inside fabfile tasks/functions, sometimes sys.path appears to lose the first element, possibly only when that element is the empty string (i.e. when your cwd is in sys.path)
- This does not appear reproducible all the time, but was noticed by an IRC user and confirmed by (IIRC) Morgan shortly thereafter.
- The only place in the code Fabric modifies or mentions sys.path is
fabric.main.load_fabfile
.
To do:
- Test
load_fabfile
(right now, seems best way is to use dependency injection so we don’t have to try mocking eg__import__
[which doesn’t appear to work anyway]) to try and nail down the edge case - If bug is found, fix it!
Originally submitted by Jeff Forcier (bitprophet) on 2010-11-12 at 09:18pm EST
Closed as Worksforme on 2011-03-10 at 01:08pm EST
Issue Analytics
- State:
- Created 12 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
How to prepend a path to sys.path in Python? - Stack Overflow
by prepending the path to Ubuntu's Python package (for my machine, this happens in usr/local/lib/python2. 7/dist-packages/easy-install.
Read more >With Enum34 installed on python3.6+, pip picks up ... - GitHub
The reason is that __main__.py has code which changes sys.path in case we are running pip from a wheel. That code appears to...
Read more >PEP 587 "Python Initialization Configuration": 3rd version
of the configuration: configure where Python looks for modules (sys.path). I added PyWideStringList_Insert() to allow to prepend a path in ...
Read more >Configuration Reference - Puppet
Valid values are true (autosigns all certificate requests; not recommended), false (disables autosigning certificates), or the absolute path to a file. The file ......
Read more >PEP 302 – New Import Hooks - Python Enhancement Proposals
It has very complex semantics and responsibilities. __import__ gets called even for modules that are already in sys.modules , which is ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ok found one:
In the meantime is there a workaround to make
fabric.contrib.django.settings_module()
actually work as per the docs?