Skip to content

Semicolon/Hashtag chars in values should not start comments #56

@mixmastamyk

Description

@mixmastamyk

Using configparser = "3.1.0"

I have a Python tool that I ported to Rust.

I'm using semicolons (shell commands) in the values in my config.ini. That works in Python, but not in your Rust library.

The reason it seems is that Python ConfigParser only recognizes comment chars when they start a line. In a value, they are part of the value. e.g.:

# cat config.ini
[section]
; This is a comment, but not below:
foo = bar; baz

Python CP output:

section: {'foo': 'bar; baz' ...}

Rust CP output:

section: {"foo": Some("bar") ...}

Please match the Python CP way of handling comments. My Rust port is somewhat broken until this can be fixed. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions