Skip to content

Commit

Permalink
Sanitize large-file filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
schmelczer committed Aug 13, 2022
1 parent 2f750c2 commit 3a1c3d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion great_ai/large_file/large_file/large_file_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re
import shutil
import sys
import tempfile
Expand Down Expand Up @@ -63,7 +64,7 @@ def __init__(
keep_last_n: Optional[int] = None,
cache_only_mode: bool = False,
):
self._name = name
self._name = re.sub(r"[^a-zA-Z0-9._-]+", "", name)

This comment has been minimized.

Copy link
@radl97

radl97 Aug 13, 2022

I am against sanitization. I would prefer erroring out. Imagine if two names collide after sanitization (e.g. hello and hello').

As there are not many users yet, the impact is now so much lower than when it gets picked up

self._version = version
self._mode = mode
self._keep_last_n = keep_last_n
Expand Down

0 comments on commit 3a1c3d4

Please sign in to comment.