Author living180
Recipients BreamoreBoy, eric.smith, ishimoto, jaraco, living180, ncdave4life, pitrou, stutzbach, takluyver, tim.golden, vstinner, zach.ware
Date 2015-02-09.15:38:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1423496289.2.0.986031375836.issue9949@psf.upfronthosting.co.za>
In-reply-to
Content
@Zach - thanks for the review.  Sorry that it has taken a few months to pick this issue back up.  Anyway, here is an updated patch.  It is pretty different than the previous patch, to the point that I would consider it a completely new patch.

Anyway, here's a basic rundown of what the patch contains:

Two functions in Modules/posixmodule.c were modified to handle bytes objects as well as str objects:  win_readlink and _getfinalpathname.  This was necessary to allow os.path.realpath() to continue returning bytes when supplied with bytes.  I know you said in your review that you didn't care about this because using bytes paths on Windows is deprecated, but I think it still important to maintain backwards compatibility.

A new implementation of realpath() was added to Lib\ntpath.py, used when _getfinalpathname is available (when _getfinalpathname is not available, realpath remains a synonym for abspath, as it was previously).  The logic here has been completely reworked and is roughly modeled on the realpath implementation from Lib\posixpath.py.

A number of tests were added to Lib\test\test_ntpath.py for realpath() functionality.  Three of the tests were based on realpath() tests from test_posixpath.py, but one is completely new:  test_realpath_broken_symlinks.

A note about improved Windows support was added to the documentation for realpath(), but no other doc changes have been made.

Anyway, feedback is welcome - I'd love to get this code in sufficient shape to see a working realpath() implementation for Windows land in Python.
History
Date User Action Args
2015-02-09 15:38:10living180setrecipients: + living180, ishimoto, jaraco, pitrou, vstinner, eric.smith, tim.golden, stutzbach, BreamoreBoy, takluyver, zach.ware, ncdave4life
2015-02-09 15:38:09living180setmessageid: <1423496289.2.0.986031375836.issue9949@psf.upfronthosting.co.za>
2015-02-09 15:38:09living180linkissue9949 messages
2015-02-09 15:38:08living180create