Skip to content

Python 3.10 AttributeError: module 'collections' has no attribute 'Iterable' #3

@jeffbr13

Description

@jeffbr13

Hi there! Just thought I'd let you know that the deprecated abstract base classes aliases were removed in Python 3.10 (change) and this is causing an AttributeError wherever collections.Iterable etc. are used.

======================================================== ERRORS ========================================================
__________________________________ ERROR collecting tests/test_import_csv_to_graph.py __________________________________
tests/test_import_csv_to_graph.py:8: in <module>
    from hypothesis_csv.strategies import csv as csv_strategy
../../../../Library/Caches/pypoetry/virtualenvs/my-app-HgQtD8X_-py3.10/lib/python3.10/site-packages/hypothesis_csv/strategies.py:1: in <module>
    from hypothesis_csv import _csv
../../../../Library/Caches/pypoetry/virtualenvs/my-app-HgQtD8X_-py3.10/lib/python3.10/site-packages/hypothesis_csv/_csv.py:6: in <module>
    from hypothesis_csv._data_rows import *
../../../../Library/Caches/pypoetry/virtualenvs/my-app-HgQtD8X_-py3.10/lib/python3.10/site-packages/hypothesis_csv/_data_rows.py:21: in <module>
    def get_columns(draw, columns: isa(collections.Iterable)):
E   AttributeError: module 'collections' has no attribute 'Iterable'
=============================================== short test summary info ================================================
ERROR tests/test_import_csv_to_graph.py - AttributeError: module 'collections' has no attribute 'Iterable'

The fix is to replace collections.Iterable and similar lookups with collections.abc.….

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions