Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mirrulations-client/src/mirrclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ def check_status_code(response):

def read_client_id(filename):
try:
with open(filename, 'r') as file:
with open(filename, 'r', encoding='utf-8') as file:
return int(file.readline())
except FileNotFoundError:
return -1


def write_client_id(filename, client_id):
with open(filename, 'w') as file:
with open(filename, 'w', encoding='utf-8') as file:
file.write(str(client_id))


Expand Down
3 changes: 2 additions & 1 deletion mirrulations-work-generator/tests/test_results_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def test_process_results():
dir_path = os.path.dirname(os.path.realpath(__file__))

processor = ResultsProcessor(JobQueue(database), MockDataStorage())
with open(f'{dir_path}/data/dockets_listing.json') as listings:
with open(f'{dir_path}/data/dockets_listing.json',
encoding='utf-8') as listings:
data = listings.read()
processor.process_results(json.loads(data))

Expand Down
2 changes: 1 addition & 1 deletion mirrulations-work-server/src/mirrserver/work_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def write_results(directory, path, data):
os.makedirs(f'/data/{directory}')
except FileExistsError:
print(f'Directory already exists in root: /data/{directory}')
with open(f'/data/{path}', 'w+') as file:
with open(f'/data/{path}', 'w+', encoding='utf-8') as file:
file.write(json.dumps(data))


Expand Down