UnicodeDecodeError on local build

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

UnicodeDecodeError on local build

Axel Braun-2
Hi,

I'm currently building some (new) py3 software, and get an error (TW as well
as Leap 42.2):

[   14s] + cd health
[   14s] + python3 setup.py build
[   14s] Traceback (most recent call last):
[   14s]   File "setup.py", line 52, in <module>
[   14s]     long_description=read('README'),
[   14s]   File "setup.py", line 25, in read
[   14s]     return open(os.path.join(os.path.dirname(__file__), fname)).read()
[   14s]   File "/usr/lib64/python3.4/encodings/ascii.py", line 26, in decode
[   14s]     return codecs.ascii_decode(input, self.errors)[0]
[   14s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
4474: ordinal not in range(128)
[   14s] error: Bad exit status from /var/tmp/rpm-tmp.kDPWdM (%build)

Now, if I run the command (unpack the tarball, cd to the directory and do a
'python3 setup.py build') from a local 42.2 VBox-installation , everything
works fine.

Any idea what this could be?

Thx
Axel
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: UnicodeDecodeError on local build

Bruno Friedmann-2
On jeudi, 8 juin 2017 20.35:21 h CEST Axel Braun wrote:

> Hi,
>
> I'm currently building some (new) py3 software, and get an error (TW as well
> as Leap 42.2):
>
> [   14s] + cd health
> [   14s] + python3 setup.py build
> [   14s] Traceback (most recent call last):
> [   14s]   File "setup.py", line 52, in <module>
> [   14s]     long_description=read('README'),
> [   14s]   File "setup.py", line 25, in read
> [   14s]     return open(os.path.join(os.path.dirname(__file__),
> fname)).read() [   14s]   File "/usr/lib64/python3.4/encodings/ascii.py",
> line 26, in decode [   14s]     return codecs.ascii_decode(input,
> self.errors)[0]
> [   14s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> position 4474: ordinal not in range(128)
> [   14s] error: Bad exit status from /var/tmp/rpm-tmp.kDPWdM (%build)
>
> Now, if I run the command (unpack the tarball, cd to the directory and do a
> 'python3 setup.py build') from a local 42.2 VBox-installation , everything
> works fine.
>
> Any idea what this could be?
>
> Thx
> Axel

Sometimes you have to put a export LANG=en_US@UTF-8 and LC relative
with LANG=Posix or C some python3 believe they have to work with ascii shit.

that's why it work on your local 42.2 Vbox, check env in both.
--

Bruno Friedmann
 Ioda-Net Sàrl www.ioda-net.ch
 Bareos Partner, openSUSE Member, fsfe fellowship
 GPG KEY : D5C9B751C4653227
 irc: tigerfoot


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: UnicodeDecodeError on local build

Sebastian-2
In reply to this post by Axel Braun-2
I guess because the default language in the build env is not UTF-8 and
the script does require it implicitly. Had the same problem too, got it
fixed upstream fortunately. You can fix it by setting the encoding in
the failing command.

Sebastian

On 06/08/2017 08:35 PM, Axel Braun wrote:

> Hi,
>
> I'm currently building some (new) py3 software, and get an error (TW as well
> as Leap 42.2):
>
> [   14s] + cd health
> [   14s] + python3 setup.py build
> [   14s] Traceback (most recent call last):
> [   14s]   File "setup.py", line 52, in <module>
> [   14s]     long_description=read('README'),
> [   14s]   File "setup.py", line 25, in read
> [   14s]     return open(os.path.join(os.path.dirname(__file__), fname)).read()
> [   14s]   File "/usr/lib64/python3.4/encodings/ascii.py", line 26, in decode
> [   14s]     return codecs.ascii_decode(input, self.errors)[0]
> [   14s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
> 4474: ordinal not in range(128)
> [   14s] error: Bad exit status from /var/tmp/rpm-tmp.kDPWdM (%build)
>
> Now, if I run the command (unpack the tarball, cd to the directory and do a
> 'python3 setup.py build') from a local 42.2 VBox-installation , everything
> works fine.
>
> Any idea what this could be?
>
> Thx
> Axel
--
python programming - mail server - photo - video - https://sebix.at
cryptographic key at https://sebix.at/DC9B463B.asc and on public keyservers



signature.asc (871 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: UnicodeDecodeError on local build

Axel Braun-2
Bruno & Sebastian,

thanks for your hints!
unfortunately. just setting the language to UTF-8 does not help:

[    4s] + export LANG=en_US@UTF-8
[    4s] + LANG=en_US@UTF-8
[    4s] + export LC_CTYPE=en_US.UTF-8
[    4s] + LC_CTYPE=en_US.UTF-8
[    4s] + export
[    4s] export COLORTERM="1"
[    4s] export CPU="x86_64"
[    4s] export CSHEDIT="emacs"
[    4s] export GPG_TTY="not a tty"
[    4s] export HISTSIZE="1000"
[    4s] export HOME="/home/abuild"
[    4s] export HOST="T520.internal"
[    4s] export HOSTNAME="T520.internal"
[    4s] export HOSTTYPE="x86_64"
[    4s] export INPUTRC="/etc/inputrc"
[    4s] export LANG="en_US@UTF-8"
[    4s] export LC_CTYPE="en_US.UTF-8"
[    4s] export LOGNAME="abuild"
[    4s] export MACHTYPE="x86_64-suse-linux"
[    4s] export MAIL="/var/spool/mail/abuild"
[    4s] export MALLOC_CHECK_="3"
[    4s] export MALLOC_PERTURB_="69"
[    4s] export MANPATH=""
[    4s] export MINICOM="-c on"
[    4s] export NNTPSERVER="news"
[    4s] export OLDPWD="/home/abuild/rpmbuild/BUILD"
[    4s] export OSTYPE="linux"
[    4s] export PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
[    4s] export PKG_CONFIG_PATH=":/usr/lib64/pkgconfig:/usr/share/pkgconfig"
[    4s] export PROFILEREAD="true"
[    4s] export PWD="/home/abuild/rpmbuild/BUILD/gnuhealth-3.2.0b1"
[    4s] export PYTHONSTARTUP="/etc/pythonstart"
[    4s] export RPM_ARCH="x86_64"
[    4s] export RPM_BUILD_DIR="/home/abuild/rpmbuild/BUILD"
[    4s] export RPM_BUILD_ROOT="/home/abuild/rpmbuild/BUILDROOT/
gnuhealth-3.2.0b1-0.x86_64"
[    4s] export RPM_DOC_DIR="/usr/share/doc/packages"
[    4s] export RPM_OPT_FLAGS="-fmessage-length=0 -grecord-gcc-switches -O2 -
Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-
unwind-tables"
[    4s] export RPM_OS="linux"
[    4s] export RPM_PACKAGE_NAME="gnuhealth"
[    4s] export RPM_PACKAGE_RELEASE="0"
[    4s] export RPM_PACKAGE_VERSION="3.2.0b1"
[    4s] export RPM_SOURCE_DIR="/home/abuild/rpmbuild/SOURCES"
[    4s] export SHELL="/bin/bash"
[    4s] export SHLVL="2"
[    4s] export SUSE_ASNEEDED="1"
[    4s] export SUSE_IGNORED_RPATHS="/etc/suse-ignored-rpaths.conf"
[    4s] export TERM="xterm-256color"
[    4s] export USER="abuild"
[    4s] export WINDOWMANAGER=""
[    4s] export XDG_CONFIG_DIRS="/etc/xdg"
[    4s] export XDG_DATA_DIRS="/usr/share"
[    4s] export XKEYSYMDB="/usr/X11R6/lib/X11/XKeysymDB"
[    4s] export XNLSPATH="/usr/X11R6/lib/X11/nls"
[    4s] + exit 0
[    4s] Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.0xOkuv
[    4s] + umask 022
[    4s] + cd /home/abuild/rpmbuild/BUILD
[    4s] + /usr/bin/rm -rf /home/abuild/rpmbuild/BUILDROOT/
gnuhealth-3.2.0b1-0.x86_64
[    4s] ++ dirname /home/abuild/rpmbuild/BUILDROOT/gnuhealth-3.2.0b1-0.x86_64
[    4s] + /usr/bin/mkdir -p /home/abuild/rpmbuild/BUILDROOT
[    4s] + /usr/bin/mkdir /home/abuild/rpmbuild/BUILDROOT/
gnuhealth-3.2.0b1-0.x86_64
[    4s] + cd gnuhealth-3.2.0b1
[    4s] + for i in 'h*'
[    4s] + cd health
[    4s] + python3 setup.py build
[    4s] Traceback (most recent call last):
[    4s]   File "setup.py", line 52, in <module>
[    4s]     long_description=read('README'),
[    4s]   File "setup.py", line 25, in read
[    4s]     return open(os.path.join(os.path.dirname(__file__), fname)).read()
[    4s]   File "/usr/lib64/python3.4/encodings/ascii.py", line 26, in decode
[    4s]     return codecs.ascii_decode(input, self.errors)[0]
[    4s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
4474: ordinal not in range(128)
[    4s] error: Bad exit status from /var/tmp/rpm-tmp.0xOkuv (%build)

@Sebastian - I did not check the interface definitions for setup yet....

Cheers
Axel


Am Donnerstag, 8. Juni 2017, 21:07:19 CEST schrieb Sebastian:

> I guess because the default language in the build env is not UTF-8 and
> the script does require it implicitly. Had the same problem too, got it
> fixed upstream fortunately. You can fix it by setting the encoding in
> the failing command.
>
> Sebastian
>
> On 06/08/2017 08:35 PM, Axel Braun wrote:
> > Hi,
> >
> > I'm currently building some (new) py3 software, and get an error (TW as
> > well as Leap 42.2):
> >
> > [   14s] + cd health
> > [   14s] + python3 setup.py build
> > [   14s] Traceback (most recent call last):
> > [   14s]   File "setup.py", line 52, in <module>
> > [   14s]     long_description=read('README'),
> > [   14s]   File "setup.py", line 25, in read
> > [   14s]     return open(os.path.join(os.path.dirname(__file__),
> > fname)).read() [   14s]   File "/usr/lib64/python3.4/encodings/ascii.py",
> > line 26, in decode [   14s]     return codecs.ascii_decode(input,
> > self.errors)[0]
> > [   14s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> > position 4474: ordinal not in range(128)
> > [   14s] error: Bad exit status from /var/tmp/rpm-tmp.kDPWdM (%build)
> >
> > Now, if I run the command (unpack the tarball, cd to the directory and do
> > a
> > 'python3 setup.py build') from a local 42.2 VBox-installation , everything
> > works fine.
> >
> > Any idea what this could be?
> >
> > Thx
> > Axel


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: UnicodeDecodeError on local build

Stefan Bruens
In reply to this post by Bruno Friedmann-2
On Donnerstag, 8. Juni 2017 21:06:41 CEST Bruno Friedmann wrote:

> On jeudi, 8 juin 2017 20.35:21 h CEST Axel Braun wrote:
> > Hi,
> >
> > I'm currently building some (new) py3 software, and get an error (TW as
> > well as Leap 42.2):
> >
> > [   14s] + cd health
> > [   14s] + python3 setup.py build
> > [   14s] Traceback (most recent call last):
> > [   14s]   File "setup.py", line 52, in <module>
> > [   14s]     long_description=read('README'),
> > [   14s]   File "setup.py", line 25, in read
> > [   14s]     return open(os.path.join(os.path.dirname(__file__),
> > fname)).read() [   14s]   File "/usr/lib64/python3.4/encodings/ascii.py",
> > line 26, in decode [   14s]     return codecs.ascii_decode(input,
> > self.errors)[0]
> > [   14s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> > position 4474: ordinal not in range(128)
> > [   14s] error: Bad exit status from /var/tmp/rpm-tmp.kDPWdM (%build)
> >
> > Now, if I run the command (unpack the tarball, cd to the directory and do
> > a
> > 'python3 setup.py build') from a local 42.2 VBox-installation , everything
> > works fine.
> >
> > Any idea what this could be?
> >
> > Thx
> > Axel
>
> Sometimes you have to put a export LANG=en_US@UTF-8 and LC relative
> with LANG=Posix or C some python3 believe they have to work with ascii shit.
>
> that's why it work on your local 42.2 Vbox, check env in both.

Actually, the package is broken - typically its a file *shipped as part of the
package*, containing some authors name (i.e. containing some UTF-8 code
sequences), which is then sourced during the build.

A working local build is just luck in these cases.

Kind regards,

Stefan

--
Stefan Brüns  /  Bergstraße 21  /  52062 Aachen
home: +49 241 53809034     mobile: +49 151 50412019
work: +49 2405 49936-424
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: UnicodeDecodeError on local build

Axel Braun-2
Am Donnerstag, 8. Juni 2017, 23:25:10 CEST schrieb Stefan Bruens:

> On Donnerstag, 8. Juni 2017 21:06:41 CEST Bruno Friedmann wrote:
> > On jeudi, 8 juin 2017 20.35:21 h CEST Axel Braun wrote:
> > > Hi,
> > >
> > > I'm currently building some (new) py3 software, and get an error (TW as
> > > well as Leap 42.2):
> > >
> > > [   14s] + cd health
> > > [   14s] + python3 setup.py build
> > > [   14s] Traceback (most recent call last):
> > > [   14s]   File "setup.py", line 52, in <module>
> > > [   14s]     long_description=read('README'),
> > > [   14s]   File "setup.py", line 25, in read
> > > [   14s]     return open(os.path.join(os.path.dirname(__file__),
> > > fname)).read() [   14s]   File
> > > "/usr/lib64/python3.4/encodings/ascii.py",
> > > line 26, in decode [   14s]     return codecs.ascii_decode(input,
> > > self.errors)[0]
> > > [   14s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> > > position 4474: ordinal not in range(128)
> > > [   14s] error: Bad exit status from /var/tmp/rpm-tmp.kDPWdM (%build)
> > >
> > > Now, if I run the command (unpack the tarball, cd to the directory and
> > > do
> > > a
> > > 'python3 setup.py build') from a local 42.2 VBox-installation ,
> > > everything
> > > works fine.
> > >
> > > Any idea what this could be?
> > >
> > > Thx
> > > Axel
> >
> > Sometimes you have to put a export LANG=en_US@UTF-8 and LC relative
> > with LANG=Posix or C some python3 believe they have to work with ascii
> > shit.
> >
> > that's why it work on your local 42.2 Vbox, check env in both.
>
> Actually, the package is broken - typically its a file *shipped as part of
> the package*, containing some authors name (i.e. containing some UTF-8 code
> sequences), which is then sourced during the build.
>
> A working local build is just luck in these cases.

Not sure, I could see it as OBS-oddity as well.

Hm, even if I set the LANG explicitly in the build process it fails:

[    2s] + exec rpmbuild -ba --define '_srcdefattr (-,root,root)' --nosignature
/home/abuild/rpmbuild/SOURCES/gnuhealth.spec
[    2s] sh: /usr/bin/python: No such file or directory
[    2s] Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.5WViKt
[    2s] + umask 022
[    2s] + cd /home/abuild/rpmbuild/BUILD
[    2s] + export LANG=en_US.UTF-8
[    2s] + LANG=en_US.UTF-8
[    2s] + export LC_CTYPE=en_US.UTF-8
[    2s] + LC_CTYPE=en_US.UTF-8
[    2s] + export RC_LANG=en_US.UTF-8
[    2s] + RC_LANG=en_US.UTF-8
[    2s] + export
[    2s] export COLORTERM="1"
[    2s] export CPU="x86_64"
[    2s] export CSHEDIT="emacs"
[    2s] export GPG_TTY="not a tty"
[    2s] export HISTSIZE="1000"
[    2s] export HOME="/home/abuild"
[    2s] export HOST="T520.internal"
[    2s] export HOSTNAME="T520.internal"
[    2s] export HOSTTYPE="x86_64"
[    2s] export INPUTRC="/etc/inputrc"
[    2s] export LANG="en_US.UTF-8"
[    2s] export LC_CTYPE="en_US.UTF-8"
[    2s] export LOGNAME="abuild"
[    2s] export MACHTYPE="x86_64-suse-linux"
[    2s] export MAIL="/var/spool/mail/abuild"
[    2s] export MALLOC_CHECK_="3"
[    2s] export MALLOC_PERTURB_="69"
[    2s] export MANPATH=""
[    2s] export MINICOM="-c on"
[    2s] export NNTPSERVER="news"
[    2s] export OLDPWD="/home/abuild"
[    2s] export OSTYPE="linux"
[    2s] export PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
[    2s] export PKG_CONFIG_PATH=":/usr/lib64/pkgconfig:/usr/share/pkgconfig"
[    2s] export PROFILEREAD="true"
[    2s] export PWD="/home/abuild/rpmbuild/BUILD"
[    2s] export PYTHONSTARTUP="/etc/pythonstart"
[    2s] export RC_LANG="en_US.UTF-8"
[    2s] export RPM_ARCH="x86_64"
[    2s] export RPM_BUILD_DIR="/home/abuild/rpmbuild/BUILD"
[    2s] export RPM_BUILD_ROOT="/home/abuild/rpmbuild/BUILDROOT/
gnuhealth-3.2.0b1-0.x86_64"
[    2s] export RPM_DOC_DIR="/usr/share/doc/packages"
[    2s] export RPM_OPT_FLAGS="-fmessage-length=0 -grecord-gcc-switches -O2 -
Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-
unwind-tables"
[    2s] export RPM_OS="linux"
[    2s] export RPM_PACKAGE_NAME="gnuhealth"
[    2s] export RPM_PACKAGE_RELEASE="0"
[    2s] export RPM_PACKAGE_VERSION="3.2.0b1"
[    2s] export RPM_SOURCE_DIR="/home/abuild/rpmbuild/SOURCES"
[    2s] export SHELL="/bin/bash"
[    2s] export SHLVL="2"
[    2s] export SUSE_ASNEEDED="1"
[    2s] export SUSE_IGNORED_RPATHS="/etc/suse-ignored-rpaths.conf"
[    2s] export TERM="xterm-256color"
[    2s] export USER="abuild"
[    2s] export WINDOWMANAGER=""
[    2s] export XDG_CONFIG_DIRS="/etc/xdg"
[    2s] export XDG_DATA_DIRS="/usr/share"
[    2s] export XKEYSYMDB="/usr/X11R6/lib/X11/XKeysymDB"
[    2s] export XNLSPATH="/usr/X11R6/lib/X11/nls"

Is python3 not supposed to use the LANG that is set?
Sorry for asking, but thats beyond my Python knowledge.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: UnicodeDecodeError on local build

Andrei Borzenkov
11.06.2017 00:08, Axel Braun пишет:

> Am Donnerstag, 8. Juni 2017, 23:25:10 CEST schrieb Stefan Bruens:
>> On Donnerstag, 8. Juni 2017 21:06:41 CEST Bruno Friedmann wrote:
>>> On jeudi, 8 juin 2017 20.35:21 h CEST Axel Braun wrote:
>>>> Hi,
>>>>
>>>> I'm currently building some (new) py3 software, and get an error (TW as
>>>> well as Leap 42.2):
>>>>
>>>> [   14s] + cd health
>>>> [   14s] + python3 setup.py build
>>>> [   14s] Traceback (most recent call last):
>>>> [   14s]   File "setup.py", line 52, in <module>
>>>> [   14s]     long_description=read('README'),
>>>> [   14s]   File "setup.py", line 25, in read
>>>> [   14s]     return open(os.path.join(os.path.dirname(__file__),
>>>> fname)).read() [   14s]   File
>>>> "/usr/lib64/python3.4/encodings/ascii.py",
>>>> line 26, in decode [   14s]     return codecs.ascii_decode(input,
>>>> self.errors)[0]
>>>> [   14s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
>>>> position 4474: ordinal not in range(128)
>>>> [   14s] error: Bad exit status from /var/tmp/rpm-tmp.kDPWdM (%build)
>>>>
>>>> Now, if I run the command (unpack the tarball, cd to the directory and
>>>> do
>>>> a
>>>> 'python3 setup.py build') from a local 42.2 VBox-installation ,
>>>> everything
>>>> works fine.
>>>>
>>>> Any idea what this could be?
>>>>
>>>> Thx
>>>> Axel
>>>
>>> Sometimes you have to put a export LANG=en_US@UTF-8 and LC relative
>>> with LANG=Posix or C some python3 believe they have to work with ascii
>>> shit.
>>>
>>> that's why it work on your local 42.2 Vbox, check env in both.
>>
>> Actually, the package is broken - typically its a file *shipped as part of
>> the package*, containing some authors name (i.e. containing some UTF-8 code
>> sequences), which is then sourced during the build.
>>
>> A working local build is just luck in these cases.
>
> Not sure, I could see it as OBS-oddity as well.
>
> Hm, even if I set the LANG explicitly in the build process it fails:
>
> [    2s] + exec rpmbuild -ba --define '_srcdefattr (-,root,root)' --nosignature
> /home/abuild/rpmbuild/SOURCES/gnuhealth.spec
> [    2s] sh: /usr/bin/python: No such file or directory
> [    2s] Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.5WViKt
> [    2s] + umask 022
> [    2s] + cd /home/abuild/rpmbuild/BUILD
> [    2s] + export LANG=en_US.UTF-8

...

Each SPEC part runs in its own subshell. You should set it in %build,
not in (or in addition to) %prep.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: UnicodeDecodeError on local build

Axel Braun-2
Am Sonntag, 11. Juni 2017, 07:27:36 CEST schrieb Andrei Borzenkov:
> ...
>
> Each SPEC part runs in its own subshell. You should set it in %build,
> not in (or in addition to) %prep.

That fixed it, thanks!
Is there a way to set this (LANG) globally?

Cheers
Axel
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Loading...