vaab / gitchangelog

Creates a changelog from git log history.
Other
584 stars 139 forks source link

setup.cfg contains ascii characters #110

Open aboe76 opened 5 years ago

aboe76 commented 5 years ago

When I tried to build gitchangelog on opensuse build service to create a rpm package I got the following error:

[   44s] + /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s'
[   44s] error in setup command: Error parsing /home/abuild/rpmbuild/BUILD/gitchangelog-3.0.3/setup.cfg: UnicodeDecodeError: ascii
[   45s] error: Bad exit status from /var/tmp/rpm-tmp.uoa9fR (%build)
[   45s] 
[   45s] 
[   45s] RPM build errors:
[   45s]     Bad exit status from /var/tmp/rpm-tmp.uoa9fR (%build)
[   45s] 
[   45s] lamb12 failed "build python-gitchangelog.spec" at Sat Dec  8 20:53:43 UTC 2018.

On further investigation I found that setup.cfg contains the following ascii characters: <b7>

these are the extra whitespaces after the following lines: line 5 line 9 line 14 line 35 line 39 line 60

all after the = sign

This is only with the package from pypi,

vaab commented 5 years ago

Thanks for your interest for gitchangelog and your report.

I can't find any chars in setup.cfg in the git sources NOR in the gitchangelog-3.0.3.tar.gz available on the pypi. Please note that the whl file does not contain any setup.cfg.

I can confirm that there are spaces (hex: 20) and tabs (hex: 09) that were added automatically by the packager on the lines you've mentioned. I have to mention that this is added by the packager.

Do you have good reason to think that this is causing the UnicodeDecodeError ? Why are you pointing to these ? Sorry if you thought having made this obvious in your previous comment, but it is not clear for me yet.

I have not seen any b7 chars BTW.

aboe76 commented 5 years ago

@vaab I was debugging it on my end with vim on a linux system to see If I could find the characters, maybe I have set the wrong encoding to show the ascii chars...

The reason to address this here is the build server I'm using build.opensuse.org won't allow me to change the environment in which it builds...

This is the location to view the actual build: https://build.opensuse.org/package/show/home:aboe76/python-gitchangelog

vaab commented 5 years ago

Ok, if we forget about b7 (still don't now where you find this... no files have this char in the whole files provided in the tar.gz), I can give you clues about why this could happen: setup.cfg is full ascii, and is refering to README.rst (full ascii) and a generated CHANGELOG.rst that is in utf-8, mostly to write correctly names of some authors of some commits.

To be honest, this doesn't happen nowhere in my testbeds (that includes a lot of installation procedures). And I'm not sure what would be the right way to go for you here. You can try to confirm first that this is coming from there by blanking out the CHANGELOG.rst in the tar.gz before installing it (not sure what you can do or what are the policies for RPM building, but you should be able to have distribution patches, don't you ?)

If this solves the problem, then this means we've nailed it. The second step would be to replace chars with unaccentuated ones in CHANGELOG.rst. This could be scripted, and applied automatically to newer release each time.

Of course, I won't change the content of the CHANGELOG.rst in the main release to make it ASCII compatible for a few reasons, amongst them, I like to properly write the names of the contributors, pushing forward usage of utf-8 is another reason, it also serves as a good test for me to check that gitchangelog handles properly coding/decoding schemes and more specifically is proficient in utf-8.

BTW, another solution (if you can use it), is to use the wheel package instead of the tar.gz. This package doesn't include any CHANGELOG.rst. Or last but not least: use the github repository source code directly. Don't forget to ./autogen.sh before doing any installation.

Do you really need this CHANGELOG.rst in the RPM ? (I'm asking this because whl doesn't seem to include any, and is also a packaging format).

I hope my suggestions will give you ideas to move forward. Tell me if I can help further. And thanks again for your efforts.

aboe76 commented 5 years ago

@vaab it isn't the CHANGELOG.rst that is the problem, it's during the build on python3 that the setup.py complains about UnicodeDecodeError: ascii.

Will ask the maintainers of the build environment to take a look and see if they can figure it out.