Skip to content

Commit 4a50631

Browse files
committed
Usa shutil para copiar de un archivo a otro
Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
1 parent c7d00e6 commit 4a50631

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/check_spell.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""
55

66
from pathlib import Path
7+
import shutil
78
import sys
89
import tempfile
910

@@ -52,10 +53,9 @@ def check_spell(po_files=None):
5253
# Create temporary copies of the original files.
5354
po_files_tmp = []
5455
for po_file in po_files:
55-
with open(tempfile.mktemp(), "w") as temp_file:
56-
# Copy content of the .po file
57-
with open(po_file, "r", encoding="utf-8") as f:
58-
temp_file.write(f.read())
56+
with open(tempfile.mktemp(), "wb") as temp_file:
57+
with open(po_file, "rb") as original_file:
58+
shutil.copyfileobj(original_file, temp_file)
5959
po_files_tmp.append(temp_file.name)
6060

6161
# Don't translate probably code entries

0 commit comments

Comments
 (0)