Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Parsing environment= now allows characters commonly found in paths to…

… be in an unquoted value.
  • Loading branch information...
commit 3e1d49d8ada88b5fee341785b24e3fb4eefd95b3 1 parent 48c044f
Mike Naberezny mnaberez authored
17 CHANGES.txt
View
@@ -1,11 +1,26 @@
Next release
+ - When parsing "environment=" in the config file, changes introduced in
+ 3.0a8 prevented Supervisor from parsing some characters commonly
+ found in paths unless quoting was used as in this example:
+
+ environment=HOME='/home/auser'
+
+ Supervisor once again allows the above line to be written as:
+
+ environment=HOME=/home/auser
+
+ Alphanumeric characters, "_", "/", ".", "+", "-", "(", and ")" can all be
+ used as a value without quoting. If any other characters are neeed in the
+ value, please quote it as in the first example above. Thanks to Paul
+ Heideman for reporting this issue.
+
- Supervisor will now look for its config file in locations relative to the
executable path, allowing it to be used more easily in virtual
environments. If sys.argv[0] is '/path/to/venv/bin/supervisorctl',
supervisor will now look for it's config file in
'/path/to/venv/etc/supervisord.conf' and '/path/to/venv/supervisord.conf'
- in addition to the other standard locations.
+ in addition to the other standard locations. Patch by Chris Rossi.
3.0a8 (2010-01-20)
5 src/supervisor/datatypes.py
View
@@ -84,7 +84,10 @@ def dict_of_key_value_pairs(arg):
""" parse KEY=val,KEY2=val2 into {'KEY':'val', 'KEY2':'val2'}
Quotes can be used to allow commas in the value
"""
- tokens = list(shlex.shlex(arg))
+ lexer = shlex.shlex(arg)
+ lexer.wordchars += '/.+-()'
+
+ tokens = list(lexer)
tokens_len = len(tokens)
D = {}
6 src/supervisor/tests/test_datatypes.py
View
@@ -115,6 +115,12 @@ def test_dict_of_key_value_pairs_handles_commas_inside_quotes(self):
expected = {'foo': 'bar,baz', 'baz': 'q,ux'}
self.assertEqual(actual, expected)
+ def test_dict_of_key_value_pairs_handles_unquoted_non_alphanum(self):
+ actual = datatypes.dict_of_key_value_pairs(
+ 'HOME=/home/auser,FOO=/.foo+(1.2)-_/')
+ expected = {'HOME': '/home/auser', 'FOO': '/.foo+(1.2)-_/'}
+ self.assertEqual(actual, expected)
+
def test_dict_of_key_value_pairs_allows_trailing_comma(self):
actual = datatypes.dict_of_key_value_pairs('foo=bar,')
expected = {'foo': 'bar'}
Please sign in to comment.
Something went wrong with that request. Please try again.