Skip to content
This repository has been archived by the owner on Sep 29, 2019. It is now read-only.

Commit

Permalink
Жёстко задана кодировка (#8).
Browse files Browse the repository at this point in the history
  • Loading branch information
idlesign committed Apr 16, 2017
1 parent a08aaa5 commit 3e04d12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions imhodump.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def process_url(self, rating, page, recursive=False):
def dump_to_file(self, filename, existing_items=None, start_from_rating=1):
logger.info('Собираем оценки пользователя %s в файл %s', self.user_id, filename)

with open(filename, 'w') as f:
with open(filename, 'w', encoding='utf8') as f:
f.write('[')

try:
Expand Down Expand Up @@ -158,7 +158,7 @@ def load_from_file(self, filename):
if os.path.exists(filename):
logger.info('Загружаем ранее собранные оценки пользователя %s из файла %s' % (self.user_id, filename))

with open(filename, 'r') as f:
with open(filename, 'r', encoding='utf8') as f:
data = f.read()

try:
Expand Down Expand Up @@ -281,7 +281,7 @@ def make_html(self, filename):
target_file = '%s.html' % os.path.splitext(filename)[0]
logger.info('Создаём html файл с оценками: %s', target_file)

with open(target_file, 'w') as f:
with open(target_file, 'w', encoding='utf8') as f:
f.write(
html_base % {
'subject': self.subject,
Expand Down

0 comments on commit 3e04d12

Please sign in to comment.