zestsoftware / zest.releaser

Python software releasing made easy and repeatable
https://zestreleaser.readthedocs.io
GNU General Public License v2.0
198 stars 62 forks source link

prerelease mangles UTF-8 in the changelog #254

Closed mgedmin closed 6 years ago

mgedmin commented 6 years ago

Steps to reproduce:

Expected result

Actual result

reinout commented 6 years ago

When I try it, I get this git diff output:

diff --git a/CHANGES.rst b/CHANGES.rst
index caab284..b803dc5 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -3,7 +3,7 @@ Changes

 .. currentmodule:: objgraph

-3.1.2 (unreleased)
+3.1.2 (2017-11-24)
 ------------------

 - Correct UTF-8 mojibake in the changelog and switch all links to HTTPS.
diff --git a/objgraph.py b/objgraph.py
index 22fdd20..f12db95 100755
--- a/objgraph.py
+++ b/objgraph.py
@@ -54,7 +54,7 @@ except ImportError:
 __author__ = "Marius Gedminas (marius@gedmin.as)"
 __copyright__ = "Copyright (c) 2008-2017 Marius Gedminas and contributors"
 __license__ = "MIT"
-__version__ = '3.1.2.dev0'
+__version__ = '3.1.2'
 __date__ = "2017-10-30"

So: looks fine. I've installed zest.releaser with python 2.7 and I'm running it on OSX. Are you running it with python 3, for instance?

There's some code in zest.releaser that tries to keep everything working even with accented characters, though this is of course a difficult area.

mgedmin commented 6 years ago

I'm running on Python 2.7. I did a pip install -U zest.releaser before trying to reproduce and filing this bug.

mgedmin commented 6 years ago

Hm, if I run prerelease -v, I see

...
DEBUG: Checking CHANGES.rst
...
DEBUG: utf-8  confidence = 0.505
...
DEBUG: Detected encoding of CHANGES.rst with chardet: ISO-8859-1
...

which could be relevant?

FWIW my locale is

LANG=lt_LT.UTF-8
LANGUAGE=
LC_CTYPE=lt_LT.UTF-8
LC_NUMERIC="lt_LT.UTF-8"
LC_TIME="lt_LT.UTF-8"
LC_COLLATE="lt_LT.UTF-8"
LC_MONETARY="lt_LT.UTF-8"
LC_MESSAGES="lt_LT.UTF-8"
LC_PAPER="lt_LT.UTF-8"
LC_NAME="lt_LT.UTF-8"
LC_ADDRESS="lt_LT.UTF-8"
LC_TELEPHONE="lt_LT.UTF-8"
LC_MEASUREMENT="lt_LT.UTF-8"
LC_IDENTIFICATION="lt_LT.UTF-8"
LC_ALL=
mgedmin commented 6 years ago

Oh my, see #255 for my theory of why this is happening.

reinout commented 6 years ago

Thanks for #255, I've released 6.13.2 with your fix!