On Fri, May 3, 2019 at 11:36 PM Robert-André Mauchin <zebob.m@gmail.com> wrote:
Hello,

patool FTBFS depends on Archmage, which is Python 2 only.
I'm trying to convert it to Python 3.

So far I have the dependency pychm converted:
https://copr.fedorainfracloud.org/coprs/eclipseo/pythontests/build/903162/

Here's my Py3 port with 2to3 and minor fixes:
https://github.com/eclipseo/archmage/tree/python3_port

The problem is it doesn't work as expected:

$ archmage -x t.chm

Traceback (most recent call last):
  File "/usr/bin/archmage", line 11, in <module>
    load_entry_point('archmage==0.3.1', 'console_scripts', 'archmage')()
  File "/usr/lib/python3.7/site-packages/archmod/cli.py", line 161, in main
    CHMFile(options.chmfile) or CHMDir(options.chmfile)
  File "/usr/lib/python3.7/site-packages/archmod/Cached.py", line 34, in __new__
    __instance = object.__new__(classtype, *args, **kwargs)
TypeError: object.__new__() takes exactly one argument (the type to instantiate)

I haven't touched archmod/Cached.py code, and as far as I know the object.__new__()
method has not changed from Python 2 to Python 3 so I don't get why it's not
working anymore.
Can anyone with more Python chops help me?

I took a quick look:
- You'll probably have to update to beautifullsoup4 (shouldn't be too hard).
- Depends on python2-chm, we don't have a python3-chm in Fedora (Haven't checked if it is supported).

Piotr