[New-bugs-announce] [issue25351] pyvenv activate script failure with specific bash option

s-wakaba report at bugs.python.org
Fri Oct 9 09:23:57 CEST 2015


New submission from s-wakaba:

When writing bash shellscripts, I always set options "set -ueC" for strict error checking. However, loading pyvenv's activate and deactivate scripts from bash with "-u" option, they are failure because they may refer undefined shell variables.

I hope activate script and deactivate function are enclosed like following block

_OLD_BASH_OPTIONS="$-"
set +u

### script body ##

set -$_OLD_BASH_OPTIONS
unset _OLD_BASH_OPTIONS


Another option, all shell-variables in the script change like

$SPAM -> ${SPAM:-}

----------
components: Library (Lib)
messages: 252593
nosy: s-wakaba
priority: normal
severity: normal
status: open
title: pyvenv activate script failure with specific bash option
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25351>
_______________________________________


More information about the New-bugs-announce mailing list