Skip to content

Commit 589f824

Browse files
committed
Convert some strings to unicode, as they might receive unicode arguments
1 parent 945e711 commit 589f824

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

flow.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def _parse_filter(self, name_filter):
9191
elif symbol == ')' and inarg is True:
9292
inarg = False
9393
else:
94-
msg = 'unexpected character "{}" at position {}'.format(symbol, pos_start)
94+
msg = u'unexpected character "{}" at position {}'.format(symbol, pos_start)
9595
raise FilterParseError(msg)
9696
if inarg is True:
9797
msg = 'parenthesis is not closed'

util/resource_browser.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ def get_file_info(self, resource_path):
6666

6767
def __verify_data(self, data, file_info):
6868
if len(data) != file_info.file_size:
69-
raise FileIntegrityError('file size mismatch when reading {}'.format(file_info.resource_path))
69+
raise FileIntegrityError(u'file size mismatch when reading {}'.format(file_info.resource_path))
7070
m = hashlib.md5()
7171
m.update(data)
7272
if m.hexdigest() != file_info.file_hash:
73-
raise FileIntegrityError('file hash mismatch when reading {}'.format(file_info.resource_path))
73+
raise FileIntegrityError(u'file hash mismatch when reading {}'.format(file_info.resource_path))
7474

7575
@cachedproperty
7676
def _resource_index(self):
@@ -85,7 +85,7 @@ def _resource_index(self):
8585
file_hash=file_hash,
8686
file_size=int(file_size),
8787
compressed_size=int(compressed_size))
88-
app_index_path = os.path.join(self._eve_path, 'SharedCache', 'index_{}.txt'.format(self._server_alias))
88+
app_index_path = os.path.join(self._eve_path, 'SharedCache', u'index_{}.txt'.format(self._server_alias))
8989
with open(app_index_path) as f:
9090
for resource_path, file_relpath, file_hash, file_size, compressed_size, version in csv.reader(f):
9191
index[resource_path] = FileInfo(

util/translator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ def _load_lang_data(self, language):
250250
"""
251251
msg_map_phb = {}
252252
try:
253-
lang_data = self._load_pickle('res:/localization/localization_{}'.format(language))
254-
lang_data_fsd = self._load_pickle('res:/localizationfsd/localization_fsd_{}'.format(language))
253+
lang_data = self._load_pickle(u'res:/localization/localization_{}'.format(language))
254+
lang_data_fsd = self._load_pickle(u'res:/localizationfsd/localization_fsd_{}'.format(language))
255255
except ContainerNameError:
256256
msg = u'data for language "{}" cannot be loaded'.format(language)
257257
raise LanguageNotAvailable(msg)

writer/json_writer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def write(self, miner_name, container_name, container_data):
120120
# We're handling sorting in customized encoder
121121
sort_keys=False)
122122
data_bytes = data_str.encode('utf8')
123-
filepath = os.path.join(folder, '{}.json'.format(self.__secure_name(container_name)))
123+
filepath = os.path.join(folder, u'{}.json'.format(self.__secure_name(container_name)))
124124
with open(filepath, 'wb') as f:
125125
f.write(data_bytes)
126126

0 commit comments

Comments
 (0)