summaryrefslogtreecommitdiffstats
path: root/Doc/library/pathlib.rst
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo in Path.iterdir docs (GH-31822)Miss Islington (bot)2022-03-231-1/+1
| | | | | (cherry picked from commit 795b365e8a6dfbeaa75780ed7807f8116f4537ca) Co-authored-by: Matt Williams <matt@milliams.com>
* bpo-39950: add `pathlib.Path.hardlink_to()` method that supersedes ↵Barney Gale2021-04-231-3/+18
| | | | | | | | | | | `link_to()` (GH-18909) The argument order of `link_to()` is reversed compared to what one may expect, so: a.link_to(b) Might be expected to create *a* as a link to *b*, in fact it creates *b* as a link to *a*, making it function more like a "link from". This doesn't match `symlink_to()` nor the documentation and doesn't seem to be the original author's intent. This PR deprecates `link_to()` and introduces `hardlink_to()`, which has the same argument order as `symlink_to()`.
* docs: clarify what patterns Path.glob accepts (GH-25486)Ned Batchelder2021-04-201-2/+3
| | | Automerge-Triggered-By: GH:Yhg1s
* bpo-39899: os.path.expanduser(): don't guess other Windows users' home ↵Barney Gale2021-04-071-2/+8
| | | | | | | directories if the basename of the current user's home directory doesn't match their username. (GH-18841) This makes `ntpath.expanduser()` match `pathlib.Path.expanduser()` in this regard, and is more in line with `posixpath.expanduser()`'s cautious approach. Also remove the near-duplicate implementation of `expanduser()` in pathlib, and by doing so fix a bug where KeyError could be raised when expanding another user's home directory.
* bpo-42999: Expand and clarify pathlib.Path.link_to() documentation. (GH-24294)Barney Gale2021-04-071-7/+14
|
* bpo-39906: Add follow_symlinks parameter to pathlib.Path.stat() and chmod() ↵Barney Gale2021-04-071-3/+16
| | | | (GH-18864)
* Doc: os.path.abspath and Path.resolve are also different (GH-23276)Hong Xu2021-01-201-5/+12
|
* Added support for negative indexes to PurePath.parents (GH-21799)Yaroslav Pankovych2020-11-231-1/+1
| | | | | | | | | | This commit also fixes up some of the overlapping documentation changed in bpo-35498, which added support for indexing with slices. Fixes bpo-21041. https://bugs.python.org/issue21041 Co-authored-by: Paul Ganssle <p.ganssle@gmail.com> Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
* bpo-35498: Added slice support to PathLib parents attribute. (GH-11165)Joshua Cannon2020-11-201-0/+2
| | | Added slice support to the `pathlib.Path.parents` sequence. For a `Path` `p`, slices of `p.parents` should return the same thing as slices of `tuple(p.parents)`.
* bpo-23706: Add newline parameter to pathlib.Path.write_text (GH-22420) ↵Максим2020-10-211-1/+4
| | | | | | | | | (GH-22420) * Add _newline_ parameter to `pathlib.Path.write_text()` * Update documentation of `pathlib.Path.write_text()` * Add test case for `pathlib.Path.write_text()` calls with _newline_ parameter passed Automerge-Triggered-By: GH:methane
* bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554)Ram Rachum2020-10-031-0/+8
|
* bpo-40486: Specify what happens if directory content change diring iteration ↵Serhiy Storchaka2020-09-041-0/+5
| | | | (GH-22025)
* Fixed comment about pathlib.link_to: it was added in 3.8, not changed. (#21851)Facundo Batista2020-08-131-1/+1
|
* bpo-41066: Update the comparison section for os vs pathlib (GH-21261)Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి)2020-08-131-0/+3
|
* bpo-23082: Better error message for PurePath.relative_to() from pathlib ↵Rotuna2020-05-251-1/+3
| | | | | (GH-19611) Co-authored-by: Sadhana Srinivasan <rotuna@Sadhanas-MBP.fritz.box>
* bpo-39470: Indicate that ``os.makedirs`` is equivalent to ``Path.mkdir`` ↵Joannah Nanjekye2020-05-041-0/+1
| | | | | | | | | | | | (GH-18216) * Indicate os.makedirs is equivalent to Path.mkdir * 📜🤖 Added by blurb_it. * ignore news feed Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-40148: Add PurePath.with_stem() (GH-19295)Tim Hoffmann2020-04-191-0/+24
| | | | Add PurePath.with_stem()
* bpo-39285: Clarify example for PurePath.match (GH-19458)Tim Lo2020-04-191-1/+3
| | | | | | | | | | | Fixes Issue39285 The example incorrectly returned True for match. Furthermore the example is ambiguous in its usage of PureWindowsPath. Windows is case-insensitve, however the underlying match functionality utilizes fnmatch.fnmatchcase. Automerge-Triggered-By: @pitrou
* bpo-39567: Document audit for os.walk, os.fwalk, Path.glob and Path.rglob. ↵Serhiy Storchaka2020-03-081-0/+4
| | | | (GH-18499)
* bpo-39808: Improve docs for pathlib.Path.stat() (GH-18719)Brett Cannon2020-03-041-1/+1
|
* bpo-30618: add readlink to pathlib.Path (GH-8285)Girts2019-10-231-0/+14
| | | | | | | | | | | This adds a "readlink" method to pathlib.Path objects that calls through to os.readlink. https://bugs.python.org/issue30618 Automerge-Triggered-By: @gpshead
* bpo-36182: Update pathlib.Path.write_text() docs (GH-12161)Lysandros Nikolaou2019-09-111-0/+3
| | | with the case of an existing file
* bpo-31163: Added return values to pathlib.Path instance's rename and replace ↵hui shang2019-09-111-5/+14
| | | | | methods. (GH-13582) * bpo-31163: Added return values to pathlib.Path instance's rename and replace methods.
* bpo-37689: add Path.is_relative_to() method (GH-14982)Hai Shi2019-08-131-1/+14
|
* bpo-33123: pathlib: Add missing_ok parameter to Path.unlink (GH-6191)‮zlohhcuB treboR2019-05-151-1/+10
| | | | | | Similarly to how several pathlib file creation functions have an "exists_ok" parameter, we should introduce "missing_ok" that makes removal functions not raise an exception when a file or directory is already absent. IMHO, this should cover Path.unlink and Path.rmdir. Note, Path.resolve() has a "strict" parameter since 3.6 that does the same thing. Naming this of this new parameter tries to be consistent with the "exists_ok" parameter as that is more explicit about what it does (as opposed to "strict"). https://bugs.python.org/issue33123
* Doc: Be explicit that Pathlib resolve was strict before 3.6. (GH-11316)Julien Palard2019-05-081-1/+1
|
* bpo-26978: Implement pathlib.Path.link_to (Using os.link) (GH-12990)Joannah Nanjekye2019-05-041-0/+7
|
* bpo-22062: Updated docstring and documentation for pathlib (GH-8519)Eivind Teig2019-02-111-3/+3
| | | | | | Original patch by Mike Short https://bugs.python.org/issue22062
* bpo-34825: Add more entries to os to pathlib reference table (GH-9608)Xtreak2018-10-051-20/+27
| | | | | | | | | | | | | | | | | | The added functions are as below : | os module | Pathlib | | ------------- | ------------- | | os.chmod | Path.chmod | | os.mkdir | Path.mkdir | | os.rename | Path.rename | | os.replace | Path.replace | | os.rmdir | Path.rmdir | | os.remove, os.unlink | Path.unlink | | os.path.samefile | Path.samefile | Thanks https://bugs.python.org/issue34825
* bpo-33721: Make some os.path functions and pathlib.Path methods be tolerant ↵Serhiy Storchaka2018-09-181-1/+11
| | | | | | | | | | to invalid paths. (#7695) Such functions as os.path.exists(), os.path.lexists(), os.path.isdir(), os.path.isfile(), os.path.islink(), and os.path.ismount() now return False instead of raising ValueError or its subclasses UnicodeEncodeError and UnicodeDecodeError for paths that contain characters or bytes unrepresentative at the OS level.
* bpo-34319: Clarify file handler closure in pathlib.read_text (GH-8645)Xtreak2018-08-061-1/+2
| | | Patch by Terry Jan Reedy.
* bpo-34329: Doc'd how to remove suffix of pathlib.Path() (GH-8655)Stefan Otte2018-08-031-1/+5
|
* Document Path.is_mount(), update Misc/ACKS and Misc/NEWS (#2980)Łukasz Langa2017-08-011-0/+12
|
* bpo-24899: Add comparison table for os.path -> pathlib (GH-1753)Jamiel Almeida2017-06-021-0/+33
|
* bpo-27200: Fix pathlib, ssl, turtle and weakref doctests (GH-616)Marco Buttu2017-04-131-1/+11
|
* Issue #19717: Makes Path.resolve() succeed on paths that do not exist (patch ↵Steve Dower2016-11-091-4/+8
| | | | by Vajrasky Kok)
* Remove spurious article.Ned Deily2016-10-151-1/+1
|\
| * Remove spurious article.Ned Deily2016-10-151-1/+1
| |
* | Merge from 3.5Berker Peksag2016-09-301-1/+1
|\ \ | |/
| * Fix markup in pathlib.rstBerker Peksag2016-09-301-1/+1
| |
* | Merge from 3.5Berker Peksag2016-09-301-1/+1
|\ \ | |/
| * Fix Path.glob() link, reported by SilentGhostBerker Peksag2016-09-301-1/+1
| |
* | Closes #27722: Merge with 3.5Zachary Ware2016-08-091-1/+1
|\ \ | |/
| * Issue #27722: Fix default for touch method's 'mode' argumentZachary Ware2016-08-091-1/+1
| |
* | Issue #27180: Merge from 3.5Berker Peksag2016-07-141-2/+3
|\ \ | |/
| * Issue #27180: Clarify Path.rename() behavior on Unix systemsBerker Peksag2016-07-141-2/+3
| | | | | | | | Patch by Evelyn Mitchell.
* | Merge Issue #22558.Terry Jan Reedy2016-06-111-1/+5
|\ \ | |/
| * Issue #22558: Add remaining doc links to source code for Python-coded modules.Terry Jan Reedy2016-06-111-1/+5
| | | | | | | | | | Reformat header above separator line (added if missing) to a common format. Patch by Yoni Lavi.
* | Issue #27186: Add os.PathLike support to pathlib.Brett Cannon2016-06-101-7/+16
| | | | | | | | | | | | | | | | This adds support both to pathlib.PurePath's constructor as well as implementing __fspath__(). This removes the provisional status for pathlib. Initial patch by Dusty Phillips.
* | Back out pathlib.Path.path attr. (Merge 3.5->3.6)Guido van Rossum2016-05-191-22/+0
|\ \ | |/