AttributeError: module 'ezdxf' has no attribute 'recover' #254
Answered
by
mbway
devaljain1998
asked this question in
Q&A
-
when I try to invoke the function: ezdxf.recover.read it shows me the error. |
Beta Was this translation helpful? Give feedback.
Answered by
mbway
Oct 21, 2020
Replies: 2 comments
-
have you imported the recover module? >>> import ezdxf
>>> ezdxf.recover.read
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'ezdxf' has no attribute 'recover'
>>> import ezdxf.recover
>>> ezdxf.recover.read
<function read at 0x7f650407bee0> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mozman
-
docs: https://ezdxf.mozman.at/docs/drawing/recover.html Recommended usage: import sys
import ezdxf
from ezdxf import recover
try:
doc, auditor = recover.readfile("messy.dxf")
except IOError:
print(f'Not a DXF file or a generic I/O error.')
sys.exit(1)
except ezdxf.DXFStructureError:
print(f'Invalid or corrupted DXF file.')
sys.exit(2)
# DXF file can still have unrecoverable errors, but this is maybe just
# a problem when saving the recovered DXF file.
if auditor.has_errors:
auditor.print_error_report() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
have you imported the recover module?