Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1926209 - python-docx fails to build with Python 3.10: ImportError: cannot import name 'Sequence' from 'collections'
Summary: python-docx fails to build with Python 3.10: ImportError: cannot import name ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-docx
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ben Beasley
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1968959 (view as bug list)
Depends On:
Blocks: PYTHON3.10 F35FTBFS F35FailsToInstall
TreeView+ depends on / blocked
 
Reported: 2021-02-08 13:04 UTC by Tomáš Hrnčiar
Modified: 2021-08-19 01:10 UTC (History)
4 users (show)

Fixed In Version: python-docx-0.8.11-1.fc35 python-docx-0.8.11-3.fc34 python-docx-0.8.11-3.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-08-06 18:10:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-02-08 13:04:18 UTC
python-docx fails to build with Python 3.10.0a5.

==================================== ERRORS ====================================
______________________ ERROR collecting tests/test_api.py ______________________
ImportError while importing test module '/builddir/build/BUILD/python-docx-0.8.5/tests/test_api.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_api.py:13: in <module>
    import docx
docx/__init__.py:14: in <module>
    from docx.parts.document import DocumentPart
docx/parts/document.py:11: in <module>
    from ..document import Document
docx/document.py:14: in <module>
    from .section import Section, Sections
docx/section.py:9: in <module>
    from collections import Sequence
E   ImportError: cannot import name 'Sequence' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
___________________ ERROR collecting tests/test_blkcntnr.py ____________________
ImportError while importing test module '/builddir/build/BUILD/python-docx-0.8.5/tests/test_blkcntnr.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_blkcntnr.py:13: in <module>
    from docx.table import Table
docx/__init__.py:14: in <module>
    from docx.parts.document import DocumentPart
docx/parts/document.py:11: in <module>
    from ..document import Document
docx/document.py:14: in <module>
    from .section import Section, Sections
docx/section.py:9: in <module>
    from collections import Sequence
E   ImportError: cannot import name 'Sequence' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
___________________ ERROR collecting tests/test_document.py ____________________
ImportError while importing test module '/builddir/build/BUILD/python-docx-0.8.5/tests/test_document.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_document.py:13: in <module>
    from docx.document import _Body, Document
docx/__init__.py:14: in <module>
    from docx.parts.document import DocumentPart
docx/parts/document.py:11: in <module>
    from ..document import Document
docx/document.py:14: in <module>
    from .section import Section, Sections
docx/section.py:9: in <module>
    from collections import Sequence
E   ImportError: cannot import name 'Sequence' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
____________________ ERROR collecting tests/test_section.py ____________________
ImportError while importing test module '/builddir/build/BUILD/python-docx-0.8.5/tests/test_section.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_section.py:12: in <module>
    from docx.section import Section, Sections
docx/__init__.py:14: in <module>
    from docx.parts.document import DocumentPart
docx/parts/document.py:11: in <module>
    from ..document import Document
docx/document.py:14: in <module>
    from .section import Section, Sections
docx/section.py:9: in <module>
    from collections import Sequence
E   ImportError: cannot import name 'Sequence' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
_____________________ ERROR collecting tests/test_table.py _____________________
ImportError while importing test module '/builddir/build/BUILD/python-docx-0.8.5/tests/test_table.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_table.py:15: in <module>
    from docx.parts.document import DocumentPart
docx/parts/document.py:11: in <module>
    from ..document import Document
docx/__init__.py:14: in <module>
    from docx.parts.document import DocumentPart
E   ImportError: cannot import name 'DocumentPart' from partially initialized module 'docx.parts.document' (most likely due to a circular import) (/builddir/build/BUILD/python-docx-0.8.5/docx/parts/document.py)
________________ ERROR collecting tests/parts/test_document.py _________________
ImportError while importing test module '/builddir/build/BUILD/python-docx-0.8.5/tests/parts/test_document.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/parts/test_document.py:15: in <module>
    from docx.parts.document import DocumentPart
docx/parts/document.py:11: in <module>
    from ..document import Document
docx/__init__.py:14: in <module>
    from docx.parts.document import DocumentPart
E   ImportError: cannot import name 'DocumentPart' from partially initialized module 'docx.parts.document' (most likely due to a circular import) (/builddir/build/BUILD/python-docx-0.8.5/docx/parts/document.py)
_________________ ERROR collecting tests/parts/test_styles.py __________________
ImportError while importing test module '/builddir/build/BUILD/python-docx-0.8.5/tests/parts/test_styles.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/parts/test_styles.py:14: in <module>
    from docx.parts.styles import StylesPart
docx/parts/styles.py:17: in <module>
    from ..styles.styles import Styles
docx/__init__.py:14: in <module>
    from docx.parts.document import DocumentPart
docx/parts/document.py:11: in <module>
    from ..document import Document
docx/document.py:14: in <module>
    from .section import Section, Sections
docx/section.py:9: in <module>
    from collections import Sequence
E   ImportError: cannot import name 'Sequence' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
_________________ ERROR collecting tests/styles/test_latent.py _________________
ImportError while importing test module '/builddir/build/BUILD/python-docx-0.8.5/tests/styles/test_latent.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/styles/test_latent.py:13: in <module>
    from docx.styles.latent import _LatentStyle, LatentStyles
docx/__init__.py:14: in <module>
    from docx.parts.document import DocumentPart
docx/parts/document.py:11: in <module>
    from ..document import Document
docx/document.py:14: in <module>
    from .section import Section, Sections
docx/section.py:9: in <module>
    from collections import Sequence
E   ImportError: cannot import name 'Sequence' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
_________________ ERROR collecting tests/styles/test_style.py __________________
ImportError while importing test module '/builddir/build/BUILD/python-docx-0.8.5/tests/styles/test_style.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/styles/test_style.py:14: in <module>
    from docx.styles.style import (
docx/__init__.py:14: in <module>
    from docx.parts.document import DocumentPart
docx/parts/document.py:11: in <module>
    from ..document import Document
docx/document.py:14: in <module>
    from .section import Section, Sections
docx/section.py:9: in <module>
    from collections import Sequence
E   ImportError: cannot import name 'Sequence' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
_________________ ERROR collecting tests/styles/test_styles.py _________________
ImportError while importing test module '/builddir/build/BUILD/python-docx-0.8.5/tests/styles/test_styles.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/styles/test_styles.py:15: in <module>
    from docx.styles.latent import LatentStyles
docx/__init__.py:14: in <module>
    from docx.parts.document import DocumentPart
docx/parts/document.py:11: in <module>
    from ..document import Document
docx/document.py:14: in <module>
    from .section import Section, Sections
docx/section.py:9: in <module>
    from collections import Sequence
E   ImportError: cannot import name 'Sequence' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
________________ ERROR collecting tests/text/test_paragraph.py _________________
ImportError while importing test module '/builddir/build/BUILD/python-docx-0.8.5/tests/text/test_paragraph.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/text/test_paragraph.py:15: in <module>
    from docx.parts.document import DocumentPart
docx/parts/document.py:11: in <module>
    from ..document import Document
docx/__init__.py:14: in <module>
    from docx.parts.document import DocumentPart
E   ImportError: cannot import name 'DocumentPart' from partially initialized module 'docx.parts.document' (most likely due to a circular import) (/builddir/build/BUILD/python-docx-0.8.5/docx/parts/document.py)
___________________ ERROR collecting tests/text/test_run.py ____________________
ImportError while importing test module '/builddir/build/BUILD/python-docx-0.8.5/tests/text/test_run.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/text/test_run.py:13: in <module>
    from docx.parts.document import DocumentPart
docx/parts/document.py:11: in <module>
    from ..document import Document
docx/__init__.py:14: in <module>
    from docx.parts.document import DocumentPart
E   ImportError: cannot import name 'DocumentPart' from partially initialized module 'docx.parts.document' (most likely due to a circular import) (/builddir/build/BUILD/python-docx-0.8.5/docx/parts/document.py)
=============================== warnings summary ===============================
docx/oxml/xmlchemy.py:43
  /builddir/build/BUILD/python-docx-0.8.5/docx/oxml/xmlchemy.py:43: DeprecationWarning: invalid escape sequence \w
    '( *</?[\w:]+)(.*?)(/?>)([^<]*</[\w:]+>)?$'

docx/oxml/coreprops.py:241
  /builddir/build/BUILD/python-docx-0.8.5/docx/oxml/coreprops.py:241: DeprecationWarning: invalid escape sequence \d
    _offset_pattern = re.compile('([+-])(\d\d):(\d\d)')

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
ERROR tests/test_api.py
ERROR tests/test_blkcntnr.py
ERROR tests/test_document.py
ERROR tests/test_section.py
ERROR tests/test_table.py
ERROR tests/parts/test_document.py
ERROR tests/parts/test_styles.py
ERROR tests/styles/test_latent.py
ERROR tests/styles/test_style.py
ERROR tests/styles/test_styles.py
ERROR tests/text/test_paragraph.py
ERROR tests/text/test_run.py
!!!!!!!!!!!!!!!!!!! Interrupted: 12 errors during collection !!!!!!!!!!!!!!!!!!!
======================== 2 warnings, 12 errors in 1.67s ========================
bpo-37324: Remove deprecated aliases to Collections Abstract Base Classes
from the collections module.

https://docs.python.org/3.10/whatsnew/changelog.html#python-3-10-0-alpha-5

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01952198-python-docx/

For all our attempts to build python-docx with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-docx/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Ben Cotton 2021-02-09 16:06:49 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 2 Miro Hrončok 2021-06-04 20:14:05 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.


The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.

Thanks.

See also https://fedoraproject.org/wiki/Changes/Python3.10

If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/

Comment 3 Miro Hrončok 2021-06-07 22:58:46 UTC
The f35-python side tag has been merged to Rawhide. From now on, build as you would normally build.

Comment 4 Miro Hrončok 2021-06-08 11:24:17 UTC
*** Bug 1968959 has been marked as a duplicate of this bug. ***

Comment 5 Miro Hrončok 2021-06-15 20:24:39 UTC
Hello,

This is the first reminder (step 3 from https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs).

If you know about this problem and are planning on fixing it, please acknowledge so by setting the bug status to ASSIGNED. If you don't have time to maintain this package, consider orphaning it, so maintainers of dependent packages realize the problem.

Comment 6 Miro Hrončok 2021-07-07 11:20:42 UTC
Hello,

This is the second reminder (step 4 from https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs).

If you know about this problem and are planning on fixing it, please acknowledge so by setting the bug status to ASSIGNED. If you don't have time to maintain this package, consider orphaning it, so maintainers of dependent packages realize the problem.

Comment 7 Fedora Release Engineering 2021-07-11 04:22:26 UTC
Dear Maintainer,

your package has an open Fails To Build From Source bug for Fedora 35.
Action is required from you.

If you can fix your package to build, perform a build in koji, and either create
an update in bodhi, or close this bug without creating an update, if updating is
not appropriate [1]. If you are working on a fix, set the status to ASSIGNED to
acknowledge this. If you have already fixed this issue, please close this Bugzilla report.

Following the policy for such packages [2], your package will be orphaned if
this bug remains in NEW state more than 8 weeks (not sooner than 2021-04-05).

A week before the mass branching of Fedora 36 according to the schedule [3],
any packages not successfully rebuilt at least on Fedora 34 will be
retired regardless of the status of this bug.

[1] https://docs.fedoraproject.org/en-US/fesco/Updates_Policy/
[2] https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
[3] https://fedorapeople.org/groups/schedule/f-36/f-36-key-tasks.html

Comment 8 Fedora Release Engineering 2021-08-01 04:22:33 UTC
Dear Maintainer,

your package has an open Fails To Build From Source bug for Fedora 35.
Action is required from you.

If you can fix your package to build, perform a build in koji, and either create
an update in bodhi, or close this bug without creating an update, if updating is
not appropriate [1]. If you are working on a fix, set the status to ASSIGNED to
acknowledge this. If you have already fixed this issue, please close this Bugzilla report.

Following the policy for such packages [2], your package will be orphaned if
this bug remains in NEW state more than 8 weeks (not sooner than 2021-04-05).

A week before the mass branching of Fedora 36 according to the schedule [3],
any packages not successfully rebuilt at least on Fedora 34 will be
retired regardless of the status of this bug.

[1] https://docs.fedoraproject.org/en-US/fesco/Updates_Policy/
[2] https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
[3] https://fedorapeople.org/groups/schedule/f-36/f-36-key-tasks.html

Comment 9 Miro Hrončok 2021-08-05 16:44:21 UTC
This package has been orphaned.

You can pick it up at https://src.fedoraproject.org/rpms/python-docx by clicking button "Take". If nobody picks it up, it will be retired and removed from a distribution.

Comment 10 Fedora Update System 2021-08-06 17:56:34 UTC
FEDORA-2021-aa6ebc01be has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-aa6ebc01be

Comment 11 Fedora Update System 2021-08-06 17:57:18 UTC
FEDORA-2021-aa54748cd9 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-aa54748cd9

Comment 12 Fedora Update System 2021-08-06 18:07:18 UTC
FEDORA-2021-d61bc84a90 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-d61bc84a90

Comment 13 Fedora Update System 2021-08-06 18:10:18 UTC
FEDORA-2021-d61bc84a90 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2021-08-07 01:35:52 UTC
FEDORA-2021-aa54748cd9 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-aa54748cd9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-aa54748cd9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2021-08-07 14:12:10 UTC
FEDORA-2021-aa6ebc01be has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-aa6ebc01be`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-aa6ebc01be

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2021-08-10 13:44:38 UTC
FEDORA-2021-aa6ebc01be has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-aa6ebc01be

Comment 17 Fedora Update System 2021-08-10 14:21:11 UTC
FEDORA-2021-aa54748cd9 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-aa54748cd9

Comment 18 Fedora Update System 2021-08-11 01:02:34 UTC
FEDORA-2021-aa6ebc01be has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-aa6ebc01be`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-aa6ebc01be

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 19 Fedora Update System 2021-08-11 01:49:11 UTC
FEDORA-2021-aa54748cd9 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-aa54748cd9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-aa54748cd9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 20 Fedora Update System 2021-08-19 01:07:30 UTC
FEDORA-2021-aa6ebc01be has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Fedora Update System 2021-08-19 01:10:52 UTC
FEDORA-2021-aa54748cd9 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.


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