blows up when the % character is used in a passphrase #12

Closed
opened 2018-01-05 05:33:38 +00:00 by import_bot · 2 comments
Collaborator

when using the new encryption_passphrase option if there is a '%' character in the value we get a exception:

borgmatic
Traceback (most recent call last):
File "/usr/local/bin/borgmatic", line 9, in
load_entry_point('atticmatic==0.1.6', 'console_scripts', 'borgmatic')()
File "/usr/local/lib/python3.4/dist-packages/atticmatic/command.py", line 64, in main
config = parse_configuration(args.config_filename, backend.CONFIG_FORMAT)
File "/usr/local/lib/python3.4/dist-packages/atticmatic/config.py", line 123, in parse_configuration
for section_format in config_format
File "/usr/local/lib/python3.4/dist-packages/atticmatic/config.py", line 123, in
for section_format in config_format
File "/usr/local/lib/python3.4/dist-packages/atticmatic/config.py", line 99, in parse_section_options
for option in section_format.options
File "/usr/lib/python3.4/collections/init.py", line 56, in init
self.__update(*args, **kwds)
File "/usr/lib/python3.4/_collections_abc.py", line 583, in update
for key, value in other:
File "/usr/local/lib/python3.4/dist-packages/atticmatic/config.py", line 100, in
if parser.has_option(section_format.name, option.name)
File "/usr/lib/python3.4/configparser.py", line 773, in get
d)
File "/usr/lib/python3.4/configparser.py", line 374, in before_get
self._interpolate_some(parser, option, L, value, section, defaults, 1)
File "/usr/lib/python3.4/configparser.py", line 423, in _interpolate_some
"found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: 'somelongpasswordwith%init'


Imported from Taiga issue 11 (done). Created on 2015-09-03T21:09:23+0000 by Dennis Roberts.

when using the new encryption_passphrase option if there is a '%' character in the value we get a exception: borgmatic Traceback (most recent call last): File "/usr/local/bin/borgmatic", line 9, in <module> load_entry_point('atticmatic==0.1.6', 'console_scripts', 'borgmatic')() File "/usr/local/lib/python3.4/dist-packages/atticmatic/command.py", line 64, in main config = parse_configuration(args.config_filename, backend.CONFIG_FORMAT) File "/usr/local/lib/python3.4/dist-packages/atticmatic/config.py", line 123, in parse_configuration for section_format in config_format File "/usr/local/lib/python3.4/dist-packages/atticmatic/config.py", line 123, in <genexpr> for section_format in config_format File "/usr/local/lib/python3.4/dist-packages/atticmatic/config.py", line 99, in parse_section_options for option in section_format.options File "/usr/lib/python3.4/collections/__init__.py", line 56, in __init__ self.__update(*args, **kwds) File "/usr/lib/python3.4/_collections_abc.py", line 583, in update for key, value in other: File "/usr/local/lib/python3.4/dist-packages/atticmatic/config.py", line 100, in <genexpr> if parser.has_option(section_format.name, option.name) File "/usr/lib/python3.4/configparser.py", line 773, in get d) File "/usr/lib/python3.4/configparser.py", line 374, in before_get self._interpolate_some(parser, option, L, value, section, defaults, 1) File "/usr/lib/python3.4/configparser.py", line 423, in _interpolate_some "found: %r" % (rest,)) configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: 'somelongpasswordwith%init' --- Imported from Taiga issue 11 (done). Created on 2015-09-03T21:09:23+0000 by Dennis Roberts.
import_bot added the
bug
label 2018-01-05 05:33:39 +00:00
Author
Collaborator

Looks like this a limitation of the built-in Python ConfigParser we're using, in that it's trying to do variable interpolation when it hits the "%" character: https://docs.python.org/2/library/configparser.html#ConfigParser.ConfigParser

The fix might be switching to the RawConfigParser.


Comment on 2015-09-04T04:19:55+0000 by Dan Helfman.

Looks like this a limitation of the built-in Python ConfigParser we're using, in that it's trying to do variable interpolation when it hits the "%" character: https://docs.python.org/2/library/configparser.html#ConfigParser.ConfigParser The fix might be switching to the RawConfigParser. --- Comment on 2015-09-04T04:19:55+0000 by Dan Helfman.
Author
Collaborator

This should be fixed in release 0.1.7, now available.


Comment on 2015-09-06T23:41:04+0000 by Dan Helfman.

This should be fixed in release 0.1.7, now available. --- Comment on 2015-09-06T23:41:04+0000 by Dan Helfman.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#12
No description provided.