Skip to contentSkip to conversation

New: utils/scanpypi: Failure when parsing diffoscope

Buildroot bugzilla at busybox.net 1 participant 3 messages Feb 3, 2021 – Feb 20, 2021

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=13516

Bug ID: 13516
Summary: utils/scanpypi: Failure when parsing diffoscope
Product: buildroot
Version: 2020.02.3
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Other
Assignee: unassigned at buildroot.uclibc.org
Reporter: conrad.ratschan at collins.com
CC: buildroot at uclibc.org
Target Milestone: ---

https://pypi.org/project/diffoscope/

The first failure is when the interpreter selected is python2 (#!/usr/bin/env python) and the script attempts to parse diffoscopes' __init__.py which does not specify an encoding (not required in python3) and has a copyright symbol in a comment:

```
Traceback (most recent call last):
  File "./utils/scanpypi", line 754, in <module>
    main()
  File "./utils/scanpypi", line 702, in main
    package.load_setup()
  File "./utils/scanpypi", line 302, in load_setup
    setup = imp.load_module('setup', s_file, s_path, s_desc)
  File "/tmp/scanpypi-2xcRWc/python-diffoscope/diffoscope-166/setup.py", line
6, in <module>
  File
"/tmp/scanpypi-2xcRWc/python-diffoscope/diffoscope-166/diffoscope/__init__.py",
line 4
SyntaxError: Non-ASCII character '\xc2' in file
/tmp/scanpypi-2xcRWc/python-diffoscope/diffoscope-166/diffoscope/__init__.py on
line 4, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for
details
```

The second issue is if I force it to use python3 to get around the previous issue, diffoscope's setup.py contains a explicit check for python3 > 3.7 which fails out the scanpypi script

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#1 lore raw

[Buildroot] [Bug 13516] utils/scanpypi: Failure when parsing diffoscope

https://bugs.busybox.net/show_bug.cgi?id=13516

--- Comment #1 from Thomas Petazzoni <[email protected]> --- Regarding the first issue, I guess we could change scanpypi to use python3 explicitly. Maybe it will break with some Python modules that have a python2-only setup.py, but it should really be rare these days.

Regarding the second issue, I don't see what we can do. If I remember correctly how scanpypi works, it works by running the setup.py, so if the setup.py has some requirement on a recent Python version... there's not much we can do about it. You could for example do:

$ make host-python3
$ export PATH=$(pwd)/output/host/bin:$PATH
$ ./utils/scanpipy

and that should use the python3 built by Buildroot, which is recent enough.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 13516] utils/scanpypi: Failure when parsing diffoscope

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=13516

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |yann.morin.1998 at free.fr
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Yann E. MORIN <[email protected]> --- Conrad, All,

The first half of the issue is now supposedly fixed with commit ee8b680816 by Thomas:

https://git.buildroot.org/buildroot/commit/?id=ee8b6808169e1e61b4318b44fbc706ec888c605d

And as Thomas said, we can't do much about the second half, so I'm closing this as fixed.

Thanks for the report!

Regards,
Yann E. MORIN.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.