Fix alembic.ini
templates to match configparser
file format.
#1397
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the
alembic.ini
templates, I moved the inline comment aboutversion_path_separator
to their own lines as required byconfigparser
.Description
In a recent project, I included the following configuration values in my
alembic.ini
. Note that the last line is the default line from the current genericalembic.ini
template.When running
alembic check
, I encountered:It seemed that the comment in the last line was being included as part of the parsed config value, which should be
os
.Alembic currently uses
configparser.ConfigParser
from the standard libary to parsealembic.ini
files. The defaultconfigparser
file format requires that comments be on their own lines, although this can be customized. I changed the three copies of this line in Alembic'salembic.ini
templates to remove the inline comments. In my case, this change fixed theValueError
.This issue could also be fixed by changing the default instance of
ConfigParser
, usinginline_comment_prefixes=("#",)
. I imagine, however, that it might be better to use the default file format.Checklist
This pull request is:
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
Fixes: #<issue number>
in the commit messageinclude a complete example of how the feature would look.
Fixes: #<issue number>
in the commit messageHave a nice day!