Closed coredumperror closed 8 years ago
Oh my, this is worse than I thought. After finally getting my .bumpversion.cfg
file fully set up, I realized that quotes shouldn't be included in those settings at all, because they get included verbatim into the setting value. For example:
message = "Bumped version to 7.x-{new_version}"
That will cause the git commit message to be "Bumped version to 7.x-{new_version}"
, with the quotes around it. Thank goodness for --dry-run
!
That seems like it probably shouldn't happen, especially since the documentation includes those quote marks.
Yes, you're right. Want to submit a pull request ?
That stack trace is probably a duplicate of #105, but we should probably include code in bumpversion itself to safeguard against that bug in configparser.
So I'm trying to put together a pull request to fix the unicode error, but the test framework itself seems to suffer from the same problem. I'm not familiar with tox and pytest, so I'm probably doing something wrong, but I can't get it to write out a .bumpversion.cfg
that has smartquotes in it. The call to tmpdir.join(".bumpversion.cfg").write()
fails with:
UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 114: ordinal not in range(128)
On another note, do you think it'd be better to update the documentation to remove the quotes, or update the parser to strip them? I this this is really a documentation bug hiding within this unicode problem, making itself look like a code bug.
@coredumperror The documentation is ambiguous, let's fix that. The test suite is in python, so it handles unicode the same way, yes. Lots of stuff is better in Python 3 :)
So what, if anything, can I do to make it possible to test unicode-containing config files in Python 2.7?
IIRC this is fixed in #112, if not please re-open.
On the PyPI page for bumpversion, the documented defaults for settings which take strings surround the strings with smartquotes. These can't be copied directly to a
.bumpversion.cfg
file because you'll get this error if you do so:I would like to request that all these smart quotes (and other other non-ascii characters in the docs) be replaced with ascii-compatible characters.
EDIT: Unfortunately, after some more testing, it looks like this is actually PyPI's fault, rather than yours. Copying the default strings from the github display of the README gives real quotes. Maybe you could add some de-smartification code to the parser? Though that seems really silly.
TL;DR F*$% "smart" quotes.