Comments (15)
Ah. My bad. The script's call to "tempfile" fails
(http://manpages.ubuntu.com/manpages/lucid/man1/tempfile.1.html), so it
doesn't generate the temporary file for the old prompt, and everything falls
apart from there.
I'll change this to something more standard. It looks like mktemp is the
favoured way of doing the same thing?
If you swap that line in activate.fish (line 49), from:
set -l oldpromptfile (tempfile)
to:
set -l oldpromptfile (mktemp)
does it start working for you?
Original Comment By: Christopher Nilsson
from virtualenv.
I've pushed some updates to my fork, over at:
http://bitbucket.org/otherchirps/virtualenv .
It should now use mktemp, instead of tempfile. Hopefully that's more
widespread. Also, should mktemp be unavailable, it will fallback to a simple
prompt change. (There'll still be an error, complaining about mktemp not being
found, but at least it won't just bomb out without letting you know the
virtual env vars are "in play".)
From what I can tell, it seems to fix the problem.
Please review. If all is well, I'll send a pull request.
Original Comment By: Christopher Nilsson
from virtualenv.
Works like a charm.
Original Comment By: Wilfred
from virtualenv.
On OSX, mktime
doesn't work like on linux (not the same arguments). The only
portable way is to use python: python -c 'import tempfile;print(tempfile.mkstemp()[1])'
Original Comment By: chs
from virtualenv.
Ah...
I don’t have a Mac available, so perhaps someone else can confirm this for me.
Judging by the docs it looks that on Mac OS X (and in turn, some of the
BSDs), mktemp
requires a mandatory argument. Either you have to supply a
full filename template, or use the -t
flag, which will append the given
filename pattern to the $TMPDIR
. eg. "mktemp -t foo.XXX
" gives
"/tmp/foo.ulG
".
For linux & friends using the GNU Coreutils implementation (which is what
I tested under), mktemp
doesn’t require any arguments, since it will happily
assume an implicit -t
with a default value.
Spinning up a python interpreter, as suggested, would work well. However, it’s
probably lighter to simply supply the optional arguments (eg. “mktemp -t tmp.oldpromptcontents.XXXX
”, or something), since this should work across all
these platforms as well. I’ve uploaded this change to my fork, as before. Let
me know if it works for you or not.
Of course, if my reading of this is wrong, calling on python will probably be
the best way to go. Definitely portable. And since we’re trying to activate a
virtualenv, it’s a safe bet python is available. :)
/ManPages/man1/mktemp.1.html
invocation.html#mktemp-invocation
Original Comment By: Christopher Nilsson
from virtualenv.
it work with mktemp -t tmp.oldpromptcontents.XXXX
from virtualenv.
+1 would be great to see this patched
from virtualenv.
Fixed in 9be1f43 - thanks @dsc.
from virtualenv.
Sorry I didn't reply earlier -- I couldn't get to the bottom of the reason for the changes to ez_setup.py
and then it fell off my plate. Great to see it merged into master!
from virtualenv.
I'm still having a problem with this, heres what I get when running . bin/activate.fish with both fish 1.23.1 and beta r2 fishfish and virtualenv 1.8.2:
fish: Could not locate end of block. The 'end' command is missing, misspelled or a ';' is missing.
/private/tmp/.psub.99273.11049 (line 1): function _old_fish_prompt
^
in . (source) call of file '/private/tmp/.psub.99273.11049',
called on line 50 of file '/env/research_experiment/django_apache/bin/activate.fish',
in . (source) call of file '/env/research_experiment/django_apache/bin/activate.fish',
called on standard input,
function − function ‐ create a function
function ‐ create a function
# snipped fish man page on function
.: Error while reading file '/private/tmp/.psub.99273.11049'
fish: Unknown command '_old_fish_prompt'
/env/research_experiment/django_apache/bin/activate.fish (line 57): _old_fish_prompt
^
in command substitution
called on line 69 of file '/env/research_experiment/django_apache/bin/activate.fish',
in function 'fish_prompt',
called on standard input,
in command substitution
called on standard input,
Environment is successfully set up though, and prompt changes to a blue (env_name). Every command works but throws:
(django_apache)virtualenv --version
1.8.2
fish: Unknown command '_old_fish_prompt'
/env/research_experiment/django_apache/bin/activate.fish (line 57): _old_fish_prompt
^
in command substitution
called on line 69 of file '/env/research_experiment/django_apache/bin/activate.fish',
in function 'fish_prompt',
called on standard input,
in command substitution
called on standard input,
Something I need to change, or a bug?
from virtualenv.
I'm getting the same errors as skeet70
from virtualenv.
confirmed, same error. i'm on snow leopard, virtualenv 1.8.2 and python 2.6.
from virtualenv.
Keeps throwing error below in every command.
Mountain Lion running virtualenv 1.9.1
.: Error encountered while sourcing file ' -- psub -Q -o hf --':
.: Value too large to be stored in data type
fish: Unknown command '_old_fish_prompt'
/Users/matheus/Desktop/work/env/bin/activate.fish (line 57): _old_fish_prompt
^
in command substitution
called on line 69 of file '/Users/matheus/Desktop/work/env/bin/activate.fish',
in function 'fish_prompt',
called on standard input,
in command substitution
called on standard input,
from virtualenv.
For Fish users I would recommend to just move to Virtual Fish, it works really great. I never got this to work but Virtual Fish works flawlessly.
from virtualenv.
I'll check it out. Thanks :)
from virtualenv.
Related Issues (20)
- sdist is missing tasks/make_zipapp.py HOT 3
- Missing file: activation/bash/activate.sh HOT 2
- RuntimeError: no .dist-info python3.9 macos HOT 1
- Move to PyPA org on PyPI? HOT 11
- Add PKG_CONFIG_PATH to variables set by venv activate HOT 1
- Extra Closing Parenthesis in the Code
- deactivate command not available in shell scripts or sub-shells (activate script does not export "deactivate") HOT 1
- `try-first-with` behaves differently for `--python` full paths and version specs HOT 3
- post-create hooks for discoverers/discovery HOT 1
- not work properly with pywin32 HOT 2
- Update for platformdirs v4 HOT 14
- pytest fails in five units HOT 14
- tests/unit/create/test_creator.py::test_create_no_seed --creator venv fails on Python 3.13 HOT 7
- cpython3_win_embed test failures with Python 3.13 HOT 6
- mkvirtualenv fails with: ModuleNotFoundError: No module named 'platformdirs' HOT 3
- venv base-executable path does not resolve symlinks using realpath() HOT 2
- Values in `pyvenv.cfg` do not reflect the real paths on case insensitive file systems HOT 5
- Virtualenv should support workon command by default. HOT 3
- https://bootstrap.pypa.io/virtualenv/3.11/virtualenv.pyz returns "Error 503 No healthy backends" HOT 3
- (Bitcoin wallet )15RFhHGkrB8F3TTtt4KgsyB5Mn3UQrGQnz
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from virtualenv.