I am new to Python.
I have the following config file
test.conf
path=Dtest.appender\=console
Following is the python code in which I read a config from .conf file using ConfigParser
from ConfigParser import SafeConfigParser
def func(config=SafeConfigParser):
with open("test.conf") as stream
stream = StringIO("[env]\n" + stream.read())
config.readfp(stream)
for item in config.items('env'):
print(item)
If I print the config value I read it prints as follows with an extra backslash.
('path', 'Dtest.appender\\=console')
Why does this happen? How can I solve this problem?