Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def _cli_patch(cli_args): # pragma: no coverage
from tempfile import NamedTemporaryFile
from traceback import format_exc, print_exc
from unicodedata import normalize
from pathlib import Path

try:
from ujson import dumps as json_dumps, loads as json_lds
Expand Down Expand Up @@ -2673,6 +2674,8 @@ def save(self, destination, overwrite=False, chunk_size=2 ** 16):
:param overwrite: If True, replace existing files. (default: False)
:param chunk_size: Bytes to read at a time. (default: 64kb)
"""
if isinstance(destination, Path):
destination = str(destination)
if isinstance(destination, str): # Except file-likes here
if os.path.isdir(destination):
destination = os.path.join(destination, self.filename)
Expand Down