win対応
This commit is contained in:
parent
6c74560ea7
commit
5e2ce351a2
@ -1,5 +1,5 @@
|
||||
"""テスト用共通処理関数"""
|
||||
import csv
|
||||
import os
|
||||
import tempfile
|
||||
from datetime import datetime
|
||||
|
||||
@ -22,12 +22,13 @@ def create_ultmarc_test_data_from_csv(file_path: str) -> DatFile:
|
||||
"""
|
||||
|
||||
# 一度、Shift-JISファイルで書き出す
|
||||
with open(file_path, encoding='utf8') as csv_file, tempfile.NamedTemporaryFile('w', encoding='cp932') as tmp_file:
|
||||
with open(file_path, encoding='utf8') as csv_file, tempfile.NamedTemporaryFile('w', encoding='cp932', delete=False) as tmp_file:
|
||||
tmp_file.write(csv_file.read())
|
||||
tmp_file.seek(0)
|
||||
tmpfile_path = tmp_file.name
|
||||
dat_file = DatFile.from_path(tmpfile_path)
|
||||
|
||||
dat_file = DatFile.from_path(tmpfile_path)
|
||||
os.unlink(tmpfile_path)
|
||||
return dat_file
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user