Closed e3krisztian closed 9 years ago
Good find! Can you try updating configparser (pip install configparser
, the version that ships with python 2.7 is too old to handle utf-8 properly here, i think) ?
After installing a configparser
it works! (I have renamed .bumpversion.cfg
for the check)
Then we're probably out of luck fixing this bug in bumpversion. Python 3 includes the updated version of configparser (the one that handles utf-8 correctly), so it will fade away with more people moving towards Python 3.
Have fun with bumpversion!
This was quick!
I'll surely remember this configparser
vs ConfigParser
issue.
It was just shocking at first that it does not even print the help on a recent-ish ubuntu for me (14.04.2 LTS). Fortunately it is not a blocker.
I will use bumpversion
as I am quite sure it is the currently best solution for inserting versions into projects!
Thanks!
Isn't it possible to add configparser
as a dependency for bumpversion?
@coredumperror Yes, that would certainly be possible. However, currently bumpversion doesn't have a single dependency and I'd like to treat an updated version of configparser as optional.
The best approach here is probably to catch UnicodeDecodeError
s when using the old ConfigParser
and print an error message along the lines of "Can't read the config file because you're using non-ascii characters and didn't update configparser. Use pip install -U configparser to fix" ?
It was my first use (attempt):
Checking what can be the problem in
bumpversion/__init__.py
, around line 695 the candidate problem source is that I have run it in a project directory with an existingsetup.cfg
:and it is indeed a utf-8 file, with non-ascii characters (my accented name) in it. It is a project that was originally packaged with pbr - had declarative packaging definition.
Temporary workaround: I have created a
.bumpversion.cfg
file and now it shows the help.