Hi Martin,
----- Original Message -----
> From: "Martin Bukatovic" <martin.bukatovic@gmail.com>
> To: python-devel@lists.fedoraproject.org
> Sent: Monday, February 22, 2016 12:04:56 AM
> Subject: my project's python3 unit tests passes, but fails during rpmbuild
>
> Dear python-devel,
>
> I'm playing with packaging of my little project[1] and I'm a bit
> puzzled about the following issue.
>
> When I go into git repo of my project and run unittests directly:
>
> ~~~
> cd ~/projects/pylatest
> python2 setup.py test
> python3 setup.py test
> ~~~
>
> Or via tox (which is configured to run both python2.7 and python3.4), it all
> works fine and both python2 and python3 test runs reports success.
>
> I have the following section in my specfile[3], which executes the tests
> during the build (this is suggested by Packaging:Python guidelines):
>
> ~~~
> %check
> %{__python2} setup.py test
> %{__python3} setup.py test
> ~~~
>
> But when the tests are executed via rpmbuild, python2 test run reports a
> pass, while python3 run fails[2]. This happens both on my local machine and
> in copr.
can you try to run your tests with following variables defined LANG=en_GB.utf8
LC_ALL=en_GB.utf8?
Python3 uses locale.getpreferredencoding when no encoding is specified when opening
a file which may be an ascii on some systems.