Support '#' and '?' in image names

This commit is contained in:
allegroai 2020-05-08 21:28:48 +03:00
parent c3acfbac20
commit 031d26a6cf

View File

@ -183,7 +183,9 @@ class UploadEvent(MetricsEventAdapter):
@staticmethod
def _replace_slash(part):
return part.replace('\\', '/').strip('/').replace('/', '.slash.')
# replace the three quote symbols we cannot have,
# notice % will be converted to %25 when the link is quoted, so we should not use it
return part.replace('\\', '/').strip('/').replace('/', '.slash.').replace('?', '0x3F').replace('#', '0x23')
def __init__(self, metric, variant, image_data, local_image_path=None, iter=0, upload_uri=None,
file_history_size=None, delete_after_upload=False, **kwargs):