File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ Distribution files
183
183
You can also get the full set of files contained within a distribution. The
184
184
``files() `` function takes a distribution package name and returns all of the
185
185
files installed by this distribution. Each file object returned is a
186
- ``PackagePath ``, a :class: `pathlib.Path ` derived object with additional ``dist ``,
186
+ ``PackagePath ``, a :class: `pathlib.PurePath ` derived object with additional ``dist ``,
187
187
``size ``, and ``hash `` properties as indicated by the metadata. For example::
188
188
189
189
>>> util = [p for p in files('wheel') if 'util.py' in str(p)][0]
@@ -207,6 +207,12 @@ Once you have the file, you can also read its contents::
207
207
return s.encode('utf-8')
208
208
return s
209
209
210
+ You can also use the ``locate `` method to get a the absolute path to the
211
+ file::
212
+
213
+ >>> util.locate() # doctest: +SKIP
214
+ PosixPath('/home/gustav/example/lib/site-packages/wheel/util.py')
215
+
210
216
In the case where the metadata file listing files
211
217
(RECORD or SOURCES.txt) is missing, ``files() `` will
212
218
return ``None ``. The caller may wish to wrap calls to
You can’t perform that action at this time.
0 commit comments