@@ -119,27 +119,26 @@ imported. Thus the above example could also be written as::
119
119
File system or zip file
120
120
=======================
121
121
122
- In general you never have to worry whether your package is on the file system
123
- or in a zip file, as the ``importlib_resources `` APIs hide those details from
124
- you. Sometimes though, you need a path to an actual file on the file system.
122
+ A consumer need not worry whether any given package is on the file system
123
+ or in a zip file, as the ``importlib_resources `` APIs abstracts those details.
124
+ Sometimes though, the user needs a path to an actual file on the file system.
125
125
For example, some SSL APIs require a certificate file to be specified by a
126
126
real file system path, and C's ``dlopen() `` function also requires a real file
127
127
system path.
128
128
129
- To support this, ``importlib_resources `` provides an API that will extract the
130
- resource from a zip file to a temporary file, and return the file system path
131
- to this temporary file as a :py:class: `pathlib.Path ` object. In order to
132
- properly clean up this temporary file, what's actually returned is a context
133
- manager that you can use in a ``with ``-statement::
129
+ To support this need , ``importlib_resources `` provides an API to extract the
130
+ resource from a zip file to a temporary file or folder and return the file
131
+ system path to this materialized resource as a :py:class: `pathlib.Path `
132
+ object. In order to properly clean up this temporary file, what's actually
133
+ returned is a context manager for use in a ``with ``-statement::
134
134
135
135
from importlib_resources import files, as_file
136
136
137
137
source = files(email.tests.data).joinpath('message.eml')
138
138
with as_file(source) as eml:
139
139
third_party_api_requiring_file_system_path(eml)
140
140
141
- You can use all the standard :py:mod: `contextlib ` APIs to manage this context
142
- manager.
141
+ Use all the standard :py:mod: `contextlib ` APIs to manage this context manager.
143
142
144
143
.. attention ::
145
144
0 commit comments