Skip to content

Commit

Permalink
docs/migration: explicitly set binary mode for open() (#231)
Browse files Browse the repository at this point in the history
open() uses non-binary by default.  The equivalent pkg_resources.resource_stream() method opens in binary mode.
  • Loading branch information
wwuck authored Jul 26, 2021
1 parent ff9283d commit e7c4bae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ bytes. E.g.::
The equivalent code in ``importlib_resources`` is pretty straightforward::

ref = importlib_resources.files('my.package').joinpath('resource.dat')
with ref.open() as fp:
with ref.open('rb') as fp:
my_bytes = fp.read()


Expand Down

0 comments on commit e7c4bae

Please sign in to comment.