Skip to content

Conversation

@kkirsche
Copy link

@kkirsche kkirsche commented Nov 4, 2021

Fixes the EncodingWarning that exists in Python 3.10 by specifying the encoding as UTF-8 for both the read and write methods for the filesystem persister

.../site-packages/vcr/persisters/filesystem.py:24: EncodingWarning: 'encoding' argument not specified
  with open(cassette_path, "w") as f:

Fixes the `EncodingWarning` that exists in Python 3.10 by specifying the encoding as UTF-8 for both the read and write methods for the filesystem persister

```
.../site-packages/vcr/persisters/filesystem.py:24: EncodingWarning: 'encoding' argument not specified
  with open(cassette_path, "w") as f:
```
@kkirsche
Copy link
Author

Test failure seems to be unrelated to my code:

  E       vcr.errors.UnhandledHTTPRequestError: "The cassette ('/tmp/pytest-of-runner/pytest-6/test_redirect_DoAsyncRequest_0/test_redirect.yaml') doesn't contain the request (<Request (GET) https://mockbin.org/redirect/303/2>) asked for"

@kevin1024 kevin1024 force-pushed the master branch 3 times, most recently from df3997c to 34d5384 Compare June 26, 2023 17:54
@kevin1024
Copy link
Owner

Closing this PR due to age and staleness. If this EncodingWarning is still present in the current codebase, please open a new issue or PR against the latest version. Thanks for the contribution!

@kevin1024 kevin1024 closed this Dec 5, 2025
@kkirsche
Copy link
Author

kkirsche commented Dec 5, 2025

As a language level warning this should still be caused with new Python versions unless an encoding was specified, but I’ll need to confirm that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants