Skip to content

NumberingPart.new NotImplementedError#1313

@KaHuier

Description

@KaHuier

the simple code

fromdocximportDocumentdoc=Document(r"xxxx.docx") print(doc.part.numbering_part)

The following issues have occurred

Traceback (most recent call last): File "x.py", line 4, in <module> print(doc.part.numbering_part) File "\mars-win-amd64-python3.9\lib\site-packages\docx\shared.py", line 242, in __get__ value = self._fget(obj) File "\mars-win-amd64-python3.9\lib\site-packages\docx\parts\document.py", line 99, in numbering_part numbering_part = NumberingPart.new() File "\mars-win-amd64-python3.9\lib\site-packages\docx\parts\numbering.py", line 15, in new raise NotImplementedError NotImplementedError 

After investigation, it was found that the 'NumberingPart. new()' used in the 'numbing_part' did not implement the function.

The following is the code used by 'NumberingPart.new()'

classNumberingPart(XmlPart): """Proxy for the numbering.xml part containing numbering definitions for a document or glossary."""@classmethoddefnew(cls): """Return newly created empty numbering part, containing only the root ``<w:numbering>`` element."""raiseNotImplementedError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions