Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
MinerU
Commits
5db8911d
Commit
5db8911d
authored
May 15, 2024
by
赵小蒙
Browse files
add errors="replace" in write mode MODE_TXT
parent
29d2be62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
magic_pdf/rw/DiskReaderWriter.py
magic_pdf/rw/DiskReaderWriter.py
+1
-1
No files found.
magic_pdf/rw/DiskReaderWriter.py
View file @
5db8911d
...
@@ -39,7 +39,7 @@ class DiskReaderWriter(AbsReaderWriter):
...
@@ -39,7 +39,7 @@ class DiskReaderWriter(AbsReaderWriter):
if
not
os
.
path
.
exists
(
directory_path
):
if
not
os
.
path
.
exists
(
directory_path
):
os
.
makedirs
(
directory_path
)
os
.
makedirs
(
directory_path
)
if
mode
==
MODE_TXT
:
if
mode
==
MODE_TXT
:
with
open
(
abspath
,
"w"
,
encoding
=
self
.
encoding
)
as
f
:
with
open
(
abspath
,
"w"
,
encoding
=
self
.
encoding
,
errors
=
"replace"
)
as
f
:
f
.
write
(
content
)
f
.
write
(
content
)
elif
mode
==
MODE_BIN
:
elif
mode
==
MODE_BIN
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment