Fix weird string formatting

This commit is contained in:
Hugo Osvaldo Barrera 2022-11-07 17:21:51 +01:00
parent b26e771865
commit a87518c474
2 changed files with 2 additions and 4 deletions

View file

@ -116,7 +116,7 @@ class FilesystemStorage(Storage):
fpath, etag = self._upload_impl(item, href)
except OSError as e:
if e.errno in (errno.ENAMETOOLONG, errno.ENOENT): # Unix # Windows
logger.debug("UID as filename rejected, trying with random " "one.")
logger.debug("UID as filename rejected, trying with random one.")
# random href instead of UID-based
href = self._get_href(None)
fpath, etag = self._upload_impl(item, href)

View file

@ -11,9 +11,7 @@ from . import exceptions
# not included, because there are some servers that (incorrectly) encode it to
# `%40` when it's part of a URL path, and reject or "repair" URLs that contain
# `@` in the path. So it's better to just avoid it.
SAFE_UID_CHARS = (
"abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789_.-+"
)
SAFE_UID_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-+"
_missing = object()