try:
    import io
except ImportError:
    import io.StringIO as StringIO
test_ini = """
[some_section]
messages.welcome=Hello World
messages.bye=bye
"""
config = configparser.ConfigParser()
config.readfp(io.StringIO(test_ini))
print(config.items('some_section'))
How to read multiline .properties file in python