Exa-Networks / exabgp

The BGP swiss army knife of networking
Other
2.05k stars 440 forks source link

Python 3.12 needs an updated (vendoring) six.py in 4.2 branch #1177

Closed garybuhrmaster closed 9 months ago

garybuhrmaster commented 9 months ago

Python 3.12 needs an updated (vendoring) six.py in the 4.2 branch

Running exabgp 4.2.21 on a Fedora 39 beta system (which has Python 3.12) I receive the following error:

$ /usr/sbin/exabgp
Traceback (most recent call last):
  File "/usr/sbin/exabgp", line 8, in <module>
    sys.exit(run_exabgp())
             ^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/exabgp/application/__init__.py", line 18, in run_exabgp
    from exabgp.application.bgp import main
  File "/usr/lib/python3.12/site-packages/exabgp/application/bgp.py", line 18, in <module>
    from exabgp.logger import Logger
  File "/usr/lib/python3.12/site-packages/exabgp/logger.py", line 23, in <module>
    from exabgp.configuration.environment import environment
  File "/usr/lib/python3.12/site-packages/exabgp/configuration/environment.py", line 318, in <module>
    from exabgp.vendoring.six.moves import configparser as ConfigParser
ModuleNotFoundError: No module named 'exabgp.vendoring.six.moves'

I updated the vendoring/six.py from the 1.10.0 to the 1.16.0 version, and exabgp properly works.

I did not closely look at the updates and how they would have been impacted by python 3.12, but a couple of the changes seem to be interesting.

Patch attached (but essentially all I did was cp the system's python six.py to the vendoring/six.py and did a diff).

0001-six.py.patch.gz

thomas-mangin commented 9 months ago

Hi @garybuhrmaster

The vendoring folder does not exists in the latest 3.4 or master (it is called dep (lib/exabgp/dep). master also removed the need for six as the code now requires python3.

The code you are running must be ancient and is unsupported! What version of exabgp are you running?

on 3.4:

user: thomas main on 3.4 [$?] via 🐍 v3.11.4 
at 09:15:24 ❯ grep -r "\.six" lib

on master:

user: thomas main on  main [$?] is 📦 v5.0.0 via 🐍 v3.11.4 
at 09:16:36 ❯ grep -r "\.six" src

Therefore it is not a bug as a supported version do not have the issue.

garybuhrmaster commented 9 months ago

The vendoring folder does not exists in the latest 3.4 or master (it is called dep (lib/exabgp/dep). master also removed the need for six as the code now requires python3.

Therefore it is not a bug as a supported version do not have the issue.

As stated in the title, this is the 4.2 branch (not master, nor 3.4). If the 4.2 branch has been EOL'd, I missed the announcement. Sorry.

thomas-mangin commented 9 months ago

🤦 sorry updated six.

thomas-mangin commented 9 months ago

I have not released 4.2.22 as there is a patch from a user for which there is no test and I would rather not give a surprise to users.