Skip to content

Conversation

@diogosilva30
Copy link
Contributor

@diogosilva30 diogosilva30 commented Aug 1, 2025

I noticed this bug where any string with a dollar sign $ is being treated as env var and then fails when trying to load such env var. Saw the problem is the regex is missing an anchor at start ˆ. Adding this will make sure value needs to start with $ and not randomly in middle of string.

Example of failure:

MY_PW: <L/f\U<Uj2{.S95@^$Rx

When trying to load with config parser:

Error reading configuration file: Environment variable <L/f\U<Uj2{.S95@^$Rx was not found

I've added unit tests to cover this scenario

diosil1@root python-config-parser % python test_configparser.py 
............
----------------------------------------------------------------------
Ran 12 tests in 0.002s

OK

@BrunoSilvaAndrade please review this?

@joaosouzacoder joaosouzacoder added the bug Something isn't working label Aug 1, 2025
@BrunoSilvaAndrade
Copy link
Owner

Hi @diogosilva30, sure thing, the pr is being reviewed and will be merged if everything is alright

@BrunoSilvaAndrade
Copy link
Owner

BrunoSilvaAndrade commented Aug 1, 2025

@joaosouzacoder can u review this?

@joaosouzacoder
Copy link
Collaborator

@diogosilva30 first of all, thank you for your contribution and for using our library.

I just reviewed the PR and I’m approving it.

@joaosouzacoder joaosouzacoder merged commit 16a8c01 into BrunoSilvaAndrade:develop Aug 1, 2025
5 checks passed
@BrunoSilvaAndrade
Copy link
Owner

BrunoSilvaAndrade commented Aug 1, 2025

The v3.1.6 has been released

@diogosilva30
Copy link
Contributor Author

diogosilva30 commented Aug 4, 2025

Thank you both for fast review and all the work in put in for this library 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants