Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.8.0 generates "Invalid line" error on blank lines in file #340

Closed
KenWhitesell opened this issue Oct 18, 2021 · 5 comments · Fixed by #339
Closed

Version 0.8.0 generates "Invalid line" error on blank lines in file #340

KenWhitesell opened this issue Oct 18, 2021 · 5 comments · Fixed by #339
Assignees
Labels
bug Something isn't working

Comments

@KenWhitesell
Copy link

A blank line in an env file causes Django's manage.py to show "Invalid line" messages. This occurs even if no sub-command is specified.

An error is also thrown on a line beginning with an octothorpe ("#") - something that we use to comment those files.

The Usage docs don't specifically state that these are legal lines. However, the example further down on that page uses them within the example.

@devel-pa
Copy link

Looks like the feature that displays invalid lines, a nice one, doesn't take in account the fact that there are also empty or commented lines. An invalid line is skipped anyway, so those lines where treated as invalid, now just annoyingly shown.

https://github.com/joke2k/django-environ/blob/main/environ/environ.py#L825

@KenWhitesell
Copy link
Author

Is there an "official" opinion as to whether those types of lines are -

  1. Officially considered "invalid" and therefore should be logged?
  2. Officially "invalid" but not logged (conditional test added before line 825)?
  3. Officially "valid", and should be part of the regex identifying valid lines?
  4. Filtered out (ignored) before the regex test at line 813?

@sergeyklay sergeyklay self-assigned this Oct 18, 2021
@sergeyklay sergeyklay added the bug Something isn't working label Oct 18, 2021
@sergeyklay
Copy link
Collaborator

This was a feature that got into the release without proper attention. I'll fix this in the next release.

@sergeyklay sergeyklay linked a pull request Oct 19, 2021 that will close this issue
@sergeyklay
Copy link
Collaborator

Fixed in develop branch. I'll release a hotfix ASAP. Thank you for reporting.

@sergeyklay
Copy link
Collaborator

Just released v0.8.1:

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 a pull request may close this issue.

3 participants