* b4 fails to build w/ py 3.6.5
@ 2020-05-26 11:38 Jiri Slaby
2020-05-26 11:46 ` Jiri Slaby
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Slaby @ 2020-05-26 11:38 UTC (permalink / raw)
To: tools
Hi,
while b4 builds fine with python 3.8.3, python 3.6.5 (SLE15-SP2) fails
to build it:
> [ 3s] + /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s'
> [ 3s] Traceback (most recent call last):
> [ 3s] File "setup.py", line 28, in <module>
> [ 3s] version=find_version('b4/__init__.py'),
> [ 3s] File "setup.py", line 18, in find_version
> [ 3s] version_file = read(source)
> [ 3s] File "setup.py", line 14, in read
> [ 3s] return open(os.path.join(os.path.dirname(__file__), fname)).read()
> [ 3s] File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
> [ 3s] return codecs.ascii_decode(input, self.errors)[0]
> [ 3s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 915: ordinal not in range(128)
> [ 3s] error: Bad exit status from /var/tmp/rpm-tmp.nPNYVp (%build)
It is the tick in PASS_FANCY on line 41 in b4/__init__.py.
I have zero python-fu, but I believe it's because 3.6 tries to load the
file using ascii, while 3.8 defaults to utf-8...
thanks,
--
js
suse labs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: b4 fails to build w/ py 3.6.5 2020-05-26 11:38 b4 fails to build w/ py 3.6.5 Jiri Slaby @ 2020-05-26 11:46 ` Jiri Slaby 2020-05-26 12:52 ` [tools] " Konstantin Ryabitsev 0 siblings, 1 reply; 3+ messages in thread From: Jiri Slaby @ 2020-05-26 11:46 UTC (permalink / raw) To: tools [-- Attachment #1: Type: text/plain, Size: 1275 bytes --] On 26. 05. 20, 13:38, Jiri Slaby wrote: > Hi, > > while b4 builds fine with python 3.8.3, python 3.6.5 (SLE15-SP2) fails > to build it: >> [ 3s] + /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s' >> [ 3s] Traceback (most recent call last): >> [ 3s] File "setup.py", line 28, in <module> >> [ 3s] version=find_version('b4/__init__.py'), >> [ 3s] File "setup.py", line 18, in find_version >> [ 3s] version_file = read(source) >> [ 3s] File "setup.py", line 14, in read >> [ 3s] return open(os.path.join(os.path.dirname(__file__), fname)).read() >> [ 3s] File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode >> [ 3s] return codecs.ascii_decode(input, self.errors)[0] >> [ 3s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 915: ordinal not in range(128) >> [ 3s] error: Bad exit status from /var/tmp/rpm-tmp.nPNYVp (%build) > > It is the tick in PASS_FANCY on line 41 in b4/__init__.py. > > I have zero python-fu, but I believe it's because 3.6 tries to load the > file using ascii, while 3.8 defaults to utf-8... The attached patch fixes it. But as I wrote, I have no idea whether it is correct at all. thanks, -- js suse labs [-- Attachment #2: 0001-fix-unicode.patch --] [-- Type: text/x-patch, Size: 766 bytes --] From 345a58f37d51b302937a14f623076c5dd13dcc32 Mon Sep 17 00:00:00 2001 From: Jiri Slaby <jslaby@suse.cz> Date: Tue, 26 May 2020 13:40:37 +0200 Subject: [PATCH] fix unicode --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ed24367c6c56..c73c9f4b2b0b 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import io import os import re from setuptools import setup @@ -11,7 +12,7 @@ from setuptools import setup def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname)).read() + return io.open(os.path.join(os.path.dirname(__file__), fname), "r", encoding="utf-8").read() def find_version(source): -- 2.26.2 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [tools] b4 fails to build w/ py 3.6.5 2020-05-26 11:46 ` Jiri Slaby @ 2020-05-26 12:52 ` Konstantin Ryabitsev 0 siblings, 0 replies; 3+ messages in thread From: Konstantin Ryabitsev @ 2020-05-26 12:52 UTC (permalink / raw) To: tools On Tue, May 26, 2020 at 01:46:46PM +0200, Jiri Slaby wrote: > > while b4 builds fine with python 3.8.3, python 3.6.5 (SLE15-SP2) > > fails > > to build it: > >> [ 3s] + /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s' > >> [ 3s] Traceback (most recent call last): > >> [ 3s] File "setup.py", line 28, in <module> > >> [ 3s] version=find_version('b4/__init__.py'), > >> [ 3s] File "setup.py", line 18, in find_version > >> [ 3s] version_file = read(source) > >> [ 3s] File "setup.py", line 14, in read > >> [ 3s] return open(os.path.join(os.path.dirname(__file__), fname)).read() > >> [ 3s] File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode > >> [ 3s] return codecs.ascii_decode(input, self.errors)[0] > >> [ 3s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 915: ordinal not in range(128) > >> [ 3s] error: Bad exit status from /var/tmp/rpm-tmp.nPNYVp (%build) > > > > It is the tick in PASS_FANCY on line 41 in b4/__init__.py. > > > > I have zero python-fu, but I believe it's because 3.6 tries to load the > > file using ascii, while 3.8 defaults to utf-8... > > The attached patch fixes it. But as I wrote, I have no idea whether it > is correct at all. It's correct, but I think it's better to fix the underlying problem and use unicode escape sequences instead (I think I meant to in the first place, but forgot). The following change is in both master and in stable-0.5.y. Thanks! -K diff --git a/b4/__init__.py b/b4/__init__.py index fcea7df..0d6fd4a 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -38,8 +38,8 @@ FILENAME_RE = re.compile(r'^(---|\+\+\+) (\S+)') PASS_SIMPLE = '[P]' FAIL_SIMPLE = '[F]' -PASS_FANCY = '[\033[32m✓\033[0m]' -FAIL_FANCY = '[\033[31m✗\033[0m]' +PASS_FANCY = '[\033[32m\u2713\033[0m]' +FAIL_FANCY = '[\033[31m\u2717\034[0m]' # You can use bash-style globbing here WANTHDRS = [ ^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-26 12:52 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-05-26 11:38 b4 fails to build w/ py 3.6.5 Jiri Slaby 2020-05-26 11:46 ` Jiri Slaby 2020-05-26 12:52 ` [tools] " Konstantin Ryabitsev
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).