| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Documentation is clear and the suggested changes looks sane to me. Will take another look after windows test failures are addressed. |
Sorry, something went wrong.
|
Tested are fixed, thanks for taking a look. |
Sorry, something went wrong.
There was a problem hiding this comment.
Some small remarks.
Sorry, something went wrong.
|
Note that this can't be automatically backported, as the tests' patching of getcwd() is different in 3.9 and below. |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was a problem hiding this comment.
One clarifying doc change as suggested by @domdfcoding. A news entry is also missing.
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request. |
Sorry, something went wrong.
|
Sorry for the long delay. Does this need a NEWS entry? It adds docs and tests but doesn't change the implementation of Path.absolute() |
Sorry, something went wrong.
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Brian Helba <brian.helba@kitware.com>
It looks like you added a news entry anyway. 😄 |
Sorry, something went wrong.
There was a problem hiding this comment.
Question about the docs and some very minor formatting things.
Sorry, something went wrong.
Co-authored-by: Brett Cannon <brett@python.org>
| self.assertEqual(str(P('c:\\').absolute()), 'c:\\') | ||
| self.assertEqual(str(P('c:\\a').absolute()), 'c:\\a') | ||
| self.assertEqual(str(P('c:\\a\\b').absolute()), 'c:\\a\\b') | ||
|
|
||
| # UNC absolute paths. | ||
| share = '\\\\server\\share\\' | ||
| self.assertEqual(str(P(share).absolute()), share) | ||
| self.assertEqual(str(P(share + 'a').absolute()), share + 'a') | ||
| self.assertEqual(str(P(share + 'a\\b').absolute()), share + 'a\\b') |
There was a problem hiding this comment.
| self.assertEqual(str(P('c:\\').absolute()), 'c:\\') | |
| self.assertEqual(str(P('c:\\a').absolute()), 'c:\\a') | |
| self.assertEqual(str(P('c:\\a\\b').absolute()), 'c:\\a\\b') | |
| # UNC absolute paths. | |
| share = '\\\\server\\share\\' | |
| self.assertEqual(str(P(share).absolute()), share) | |
| self.assertEqual(str(P(share + 'a').absolute()), share + 'a') | |
| self.assertEqual(str(P(share + 'a\\b').absolute()), share + 'a\\b') | |
| self.assertEqual(str(P(r'c:\').absolute()), r'c:\') | |
| self.assertEqual(str(P(r'c:\a').absolute()), r'c:\a') | |
| self.assertEqual(str(P(r'c:\a\b').absolute()), r'c:\a\b') | |
| # UNC absolute paths. | |
| share = '\\\\server\\share\\' | |
| self.assertEqual(str(P(share).absolute()), share) | |
| self.assertEqual(str(P(share + 'a').absolute()), share + 'a') | |
| self.assertEqual(str(P(share + r'a\b').absolute()), share + r'a\b') |
Sorry, something went wrong.
|
Thanks very much for the review! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This method is important and cannot be replaced with resolve()! resolve() will hit OS APIs to resolve symlinks/etc, and will fail on symlink loops, whereas absolute() just prepends the working directory and can never raise an OSError.
Also improved the table showing correspondence with os.path methods. The gory details:
Happy to expand the tests if anyone has any ideas what else to cover.
https://bugs.python.org/issue29688