#65990 closed defect (fixed)

Importing py310-oset generates "ImportError: cannot import name 'MutableSet' from 'collections'"

Reported by: outis Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: py310-oset

Description

When importing oset for Python 3.10, it generates the error:

ImportError: cannot import name 'MutableSet' from 'collections'

with the traceback:

Traceback (most recent call last):

File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/oset/init.py", line 3, in <module>

from oset.pyoset import oset

File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/oset/pyoset.py", line 16, in <module>

from collections import MutableSet

ImportError: cannot import name 'MutableSet' from 'collections' (/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/init.py)

MutableSet, along with other container classes, were moved from collections to collections.abc in Python 3.3, though aliases were maintained in later versions. Those aliases aren't present in Python 3.10, hence the error. The line should be updated to:

from collections.abc import MutableSet

Attachments (1)

py310-oset.patch (291 bytes) - added by outis 20 months ago.
fix: updates module name

Download all attachments as: .zip

Change History (3)

Changed 20 months ago by outis

Attachment: py310-oset.patch added

fix: updates module name

comment:1 Changed 20 months ago by reneeotten (Renee Otten)

Priority: HighNormal

the last update to that package was in 2012 - so I suspect you shouldn't expect a fix from upstream here... If you want to submit a PR with a patch for MacPorts that would probably be fine.

comment:2 Changed 20 months ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In e5188b199676c6a0a779ba917b0dffb589718975/macports-ports (master):

py-oset: remove port

Upstream project appears dead. No remaining dependents. Dictionaries
preserve insertion order in Python 3.7+. Users who need a "real"
ordered set are most likely better off with something maintained like
<https://pypi.org/project/ordered-set/>.

Closes: #65990

Note: See TracTickets for help on using tickets.