#1112: simfactory's option parser termination option values on ";" ------------------------+--------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: defect | Status: new Priority: minor | Milestone: Component: SimFactory | Version: Keywords: | ------------------------+--------------------------------------------------- I have (on my local machine horizon.tapir.caltech.edu):
{{{ rhaas@horizon:/mnt/data/rhaas/postdoc/gr/ET_trunk$ tail -n2 simfactory/etc/defs.local.ini [horizon.tapir.caltech.edu] user = rhaas3 ; missing }}}
and get
{{{ rhaas@horizon:/mnt/data/rhaas/postdoc/gr/ET_trunk$ sim print-mdb-entry horizon.tapir.caltech.edu | grep rhaas sourcebasedir = /mnt/data/rhaas/postdoc/gr basedir = /home/rhaas/data/postdoc/runs user = rhaas3 email = rhaas }}}
ie. the option parser truncates the option value for "user" at the ";" character (seem to treat it as a comment marger like "#").
This makes it impossible to have a ";" eg. in the envsetup command. I tried escaping the ";" with backslashes and double quotes. No luck. In my specific case I wanted to do:
hash module && module purge ; bash ...
ie clear all module information if the module command exists (I have a workaround for this particular application).
#1112: simfactory's option parser terminates option values on ";" -------------------------+-------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: defect | Status: new Priority: minor | Milestone: Component: SimFactory | Version: Resolution: | Keywords: -------------------------+--------------------------------------------------
#1112: simfactory's option parser terminates option values on ";" -------------------------+-------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: defect | Status: new Priority: minor | Milestone: Component: SimFactory | Version: Resolution: | Keywords: -------------------------+--------------------------------------------------
Comment (by eschnett):
Yes, both # and ; are treated as comment characters. We can change this -- see pyini.py, function Parse.
Traditionally, semicolons indicate the begin of a comment in ini files. However, it may be that this semicolon needs to be at the beginning of a line to do so, which we currently don't enforce.
#1112: simfactory's option parser terminates option values on ";" -------------------------+-------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: defect | Status: new Priority: minor | Milestone: Component: SimFactory | Version: Resolution: | Keywords: -------------------------+--------------------------------------------------
Comment (by rhaas):
Beginning of the line would work for me. Or the possibility of escaping the semicolon. Not being able to enter it at all makes certain bash command lines awkward.
I attach a a patch. Additionally we might also consider allowing for '#' to be escaped (if we ever find ourself in a situation where one needs '#' as part of an option value), eg. http://stackoverflow.com/questions/1706198/python-how-to-ignore-comment- lines-when-reading-in-a-file
#1112: simfactory's option parser terminates option values on ";" -------------------------+-------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: defect | Status: new Priority: minor | Milestone: Component: SimFactory | Version: Resolution: | Keywords: -------------------------+--------------------------------------------------
Comment (by eschnett):
This patch just removes ";" as comment character. The ini file format actually specifies that only ";" is a comment character, if it is the first character in a line. Do we really want to deviate from the standard here?
#1112: simfactory's option parser terminates option values on ";" -------------------------+-------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: defect | Status: new Priority: minor | Milestone: Component: SimFactory | Version: Resolution: | Keywords: -------------------------+--------------------------------------------------
Comment (by rhaas ):
There is a separate check for comment characters at the beginning of the line in line 655 of the source code (pyini.py). I am not touching that :-)
#1112: simfactory's option parser terminates option values on ";" -------------------------+-------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: defect | Status: review Priority: minor | Milestone: Component: SimFactory | Version: Resolution: | Keywords: -------------------------+-------------------------------------------------- Changes (by eschnett):
* status: new => review
#1112: simfactory's option parser terminates option values on ";" -------------------------+-------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: defect | Status: review Priority: minor | Milestone: Component: SimFactory | Version: Resolution: | Keywords: -------------------------+--------------------------------------------------
Comment (by eschnett):
Please apply.
#1112: simfactory's option parser terminates option values on ";" -------------------------+-------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: defect | Status: reviewed_ok Priority: minor | Milestone: Component: SimFactory | Version: Resolution: | Keywords: -------------------------+-------------------------------------------------- Changes (by eschnett):
* status: review => reviewed_ok
#1112: simfactory's option parser terminates option values on ";" -------------------------+-------------------------------------------------- Reporter: rhaas | Owner: eschnett Type: defect | Status: closed Priority: minor | Milestone: Component: SimFactory | Version: Resolution: fixed | Keywords: -------------------------+-------------------------------------------------- Changes (by rhaas):
* status: reviewed_ok => closed * resolution: => fixed
Comment:
Applied as rev 1830 of simfactory.
trac@lists.einsteintoolkit.org