intelxed / mbuild

python-based build system used for building XED
Apache License 2.0
31 stars 29 forks source link

Broken in Python 3.9 due to copy.deepcopy() no longer working on uname_result objects #30

Closed rocallahan closed 4 years ago

rocallahan commented 4 years ago

See https://bugs.python.org/issue42189.

I guess you could either work around this or wait to see if Python 3.9 is fixed. In the meantime Xed won't build on platforms that are shipping Python 3.9 (e.g. Fedora 33).

rocallahan commented 4 years ago

I'm working around it with https://github.com/rocallahan/mbuild/commit/b4580b926df935b04ceb62d3682e66584bdc72c9

markcharney commented 4 years ago

thx fir reporting this. i will take a look

markcharney commented 4 years ago

confirmed bug on python3.9. thx for the suggested fix.

>> import copy
>>> import platform
>>> a=platform.uname()
>>> b=copy.deepcopy(a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/copy.py", line 264, in _reconstruct
    y = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/copyreg.py", line 91, in __newobj__
    return cls.__new__(cls, *args)
TypeError: <lambda>() takes 6 positional arguments but 7 were given
markcharney commented 4 years ago

I looked at overriding deepcopy but decided to go with just making my own copy-able tuple based on the platform.uname() return value. I will be doing push shortly.

markcharney commented 4 years ago

let me know if this works for you. thx for reporting this issue.