mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-01-02 08:32:26 +01:00
11 lines
253 B
Python
11 lines
253 B
Python
import io
|
|
|
|
|
|
def open_for_read(path):
|
|
return io.open(path, encoding='utf-8', errors='replace')
|
|
|
|
|
|
def open_for_write(path, append=False):
|
|
mode = 'a' if append else 'w'
|
|
return io.open(path, mode, encoding='utf-8', errors='replace', newline='')
|