zsh-workers
 help / color / mirror / code / Atom feed
* Crash with virtualenvwrapper_lazy.sh
@ 2014-08-27 20:07 Daniel Hahler
  0 siblings, 0 replies; only message in thread
From: Daniel Hahler @ 2014-08-27 20:07 UTC (permalink / raw)
  To: Zsh Hackers' List

I have noticed a strange crash during completion, when using virtualenvwrapper's [1] lazy setup.

It does not happen when running zsh inside of zsh (SHLVL=2), or when running it inside of gdb, which makes it hard to debug/trace.
It also does not happen with ~/.zshrc moved away.


TEST CASE:

% source virtualenvwrapper_lazy.sh

This will setup:
compctl -K virtualenvwrapper_load workon

% which virtualenvwrapper_load
virtualenvwrapper_load () {
	if [ -z $VIRTUALENVWRAPPER_LAZY_LOADED ]
	then
		source "$VIRTUALENVWRAPPER_SCRIPT"
		VIRTUALENVWRAPPER_LAZY_LOADED=1 
	fi
}

When using TAB after "workon" then, zsh will crash.


I could track it down to the function `mkvirtualenv`, where commenting parts of the function body  won't crash zsh.
I could not pin-point it to a specific line, but e.g. `workon "$envname"` is involved.

This also happens when commenting the `virtualenvwrapper_initialize` function, and therefore $VIRTUALENVWRAPPER_SCRIPT (virtualenvwrapper.sh) gets only parsed/sourced.

The expected behavior would be that zsh won't crash, and another pressing of TAB is required to get the completions (this is expected, because sourcing virtualenvwrapper.sh will setup the correct/final completion for "workon").

This is a problem that has been confirmed multiple times (e.g. in https://github.com/robbyrussell/oh-my-zsh/issues/2355), which makes it likely that some oh-my-zsh setting is involved.

I have tested it with the latest version of Zsh (Git master).

Please let me know if I can provide more information.

Also, any help with debugging this would be appreciated, of course.


virtualenvwrapper source files:
 - virtualenvwrapper_lazy.sh: https://bitbucket.org/dhellmann/virtualenvwrapper/raw/866ef2e9992dbd8df1996fb9e296d8a7ad2cf08c/virtualenvwrapper_lazy.sh
 - virtualenvwrapper.sh: https://bitbucket.org/dhellmann/virtualenvwrapper/raw/866ef2e9992dbd8df1996fb9e296d8a7ad2cf08c/virtualenvwrapper.sh

1: https://bitbucket.org/dhellmann/virtualenvwrapper


Thanks,
Daniel.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-27 20:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-27 20:07 Crash with virtualenvwrapper_lazy.sh Daniel Hahler

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).