Bug 2104977 - Meld couldn't compare files after python was rebased to 3.11.0b3 version
Summary: Meld couldn't compare files after python was rebased to 3.11.0b3 version
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: meld
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dominic Hopf
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2022-07-07 15:39 UTC by Mikhail
Modified: 2022-07-19 15:02 UTC (History)
8 users (show)

Fixed In Version: python3.11-3.11.0~b4-1.fc37
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-19 15:02:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
meld screenshot (192.06 KB, image/png)
2022-07-07 15:39 UTC, Mikhail
no flags Details

Description Mikhail 2022-07-07 15:39:27 UTC
Created attachment 1895231 [details]
meld screenshot

Created attachment 1895231 [details]
meld screenshot

Description of problem:
Meld couldn't compare files after python was rebased to 3.11.0b3 version

When I click on "File+", "Folder+" or "Version control+" button in console appears follow trace:
$ meld
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/meld/newdifftab.py", line 106, in on_button_type_toggled
    self.diff_type.supports_blank())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/meld/newdifftab.py", line 34, in supports_blank
    return self in (self.File, self.Folder)
                    ^^^^^^^^^
  File "/usr/lib64/python3.11/enum.py", line 198, in __get__
    raise AttributeError(
    ^^^^^^^^^^^^^^^^^^^^^
AttributeError: <enum 'DiffType'> member has no attribute 'File'

Comment 1 Miro Hrončok 2022-07-11 09:36:02 UTC
$ meld
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/meld/newdifftab.py", line 106, in on_button_type_toggled
    self.diff_type.supports_blank())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/meld/newdifftab.py", line 34, in supports_blank
    return self in (self.File, self.Folder)
                    ^^^^^^^^^
  File "/usr/lib64/python3.11/enum.py", line 198, in __get__
    raise AttributeError(
    ^^^^^^^^^^^^^^^^^^^^^
AttributeError: <enum 'DiffType'> member has no attribute 'File'


This is caused by the removal of attribute access to other enum numbers. See e.g.

https://github.com/python/cpython/issues/87328
https://github.com/python/cpython/issues/93910

The enum maintainer insists on removing this functionality. It was already reverted in Python 3.10 but got back to 3.11, where it will probably be reverted again for performance reasons, but this will stop working at some point. Never access other enum members on self. Replace:

    return self in (self.File, self.Folder)

With:

    return self in (type(self).File, type(self).Folder)

(Or use a pre-saved `cls = type(self)` in case this happens in a loop etc.)


Let me know if you need my help.

Comment 3 Miro Hrončok 2022-07-18 11:55:02 UTC
Could you please confirm that this works with Python 3.11.0b4?

Comment 4 Mikhail 2022-07-19 14:53:10 UTC
Yes, I can confirm that Meld with python 3.11.0~b4-1.fc37 working fine.

Comment 5 Miro Hrončok 2022-07-19 15:02:59 UTC
Thanks.


Note You need to log in before you can comment on or make changes to this bug.