Skip to content

Commit

Permalink
fix: File.parse_download_url(): too many values to unpack (#1287)
Browse files Browse the repository at this point in the history
Truly amazing that this bug has not yet surfaced in the entire, huge,
worldwide ViUR community with its thousands of projects... wow. It seems
that none of those millions or trillions of projects worldwide have ever
saved a TextBone with a link to a local file.
  • Loading branch information
phorward authored Oct 16, 2024
1 parent 4ba2f75 commit 5279ed8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This file documents any relevant changes done to ViUR-core since version 3.

## [3.6.20]

- fix: `File.parse_download_url()`: `too many values to unpack` (#1287)

## [3.6.19]

- fix: Rename `type_postfix` on `BaseBone` into `type_suffix` (#1275)
Expand Down
4 changes: 2 additions & 2 deletions src/viur/core/modules/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,9 @@ def parse_download_url(url) -> t.Optional[FilePath]:
data = base64.urlsafe_b64decode(data).decode("UTF-8")

match data.count("\0"):
case 3:
dlpath, valid_until, _ = data.split("\0")
case 2:
dlpath, valid_until, _ = data.split("\0")
case 1:
# It's the old format, without an downloadFileName
dlpath, valid_until = data.split("\0")
case _:
Expand Down
2 changes: 1 addition & 1 deletion src/viur/core/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This will mark it as a pre-release as well on PyPI.
# See CONTRIBUTING.md for further information.

__version__ = "3.6.19"
__version__ = "3.6.20"

assert __version__.count(".") >= 2 and "".join(__version__.split(".", 3)[:3]).isdigit(), \
"Semantic __version__ expected!"

0 comments on commit 5279ed8

Please sign in to comment.