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?
For testing, use the chm from patool available here: https://eclipseo.fedorapeople.org/archmage_test/
Thanks
On 03. 05. 19 23:36, Robert-André Mauchin 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 don't think you can do this in either Python version. On Python 2, I get:
TypeError: object() takes no parameters
When I try to use object.__new__(classtype, *args, **kwargs).
The reason that this only happens on Python 3 might be somewhere else.
I think that code is wrong either way, just replace it with object.__new__(classtype).
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
python-devel@lists.fedoraproject.org