Skip to content

Change in 1.0.0 to add pathlib support for .save() breaks usage of io.BytesIO #1733

@acaos

Description

@acaos

Versions

  • Python 3.7
  • Werkzeug 1.0.0 (from PyPI)

Report

The addition of pathlib support to .save() from #1654 breaks the the ability to pass io.BytesIO objects to .save().

Previous behavior: Saving to an io.BytesIO object worked as expected.
Behavior in 1.0.0: An exception is thrown in fspath().

  File "/app/main.py", line 310, in extract_metadata
    files['metadata'].save(metadata_io)
  File "/app/.venv/lib/python3.7/site-packages/werkzeug/datastructures.py", line 3061, in save
    dst = fspath(dst)
TypeError: expected str, bytes or os.PathLike object, not _io.BytesIO

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions