Patches item #658599, was opened at 2002-12-25 23:49 Message generated for change (Settings changed) made by nnorwitz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=658599&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Library (Lib) Group: Python 2.2.x >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Miki Tebeka (tebeka) Assigned to: Mark Hammond (mhammond) Summary: Fix for bug 494589 Initial Comment: This is a fix for bug 494589 (os.path.expandvars) I suggest using the same code in ntpath and posixpath. (Maybe have a commonpath.py and let both import it?) Python version 2.2.2 OS: NT4 SP6 (checked on NT and cygwin) Miki ---------------------------------------------------------------------- >Comment By: Neal Norwitz (nnorwitz) Date: 2007-03-09 20:19 Message: Logged In: YES user_id=33168 Originator: NO Given the bug is closed, seems reasonable to close this patch too. Thanks for pointing it out Jack. ---------------------------------------------------------------------- Comment By: Jack Diederich (jackdied) Date: 2007-03-08 17:56 Message: Logged In: YES user_id=591932 Originator: NO does the following svn message mean this should be closed? r53460 | sjoerd.mullender | 2007-01-16 11:42:38 -0500 (Tue, 16 Jan 2007) | 4 lines Fixed ntpath.expandvars to not replace references to non-existing variables with nothing. Also added tests. This fixes bug #494589. ---------------------------------------------------------------------- Comment By: Miki Tebeka (tebeka) Date: 2003-01-30 03:30 Message: Logged In: YES user_id=358087 Hopefully this should do the trick (if I'll remember to attache the file :-) All I did was to allow a $ only right after the first one. Miki ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2003-01-29 15:11 Message: Logged In: YES user_id=14198 Yes, I was too eager there. So back to the original patch - it looks good, except it seems to fail in one case I can see: $FOO$FOO is not correctly expanded. Put a space between the vars, or enclose them in braces, and it works correctly. This isn't really a regression though - the old code doesn't handle that case correctly either. posixpath does. See the new patch I uploaded - it contains the original code, plus a patch to test_ntpath.py to test the semantics. Is it possible to fix the patch to handle this case? I haven't time to dig out my regex book <wink> ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-01-16 17:24 Message: Logged In: YES user_id=31435 Did you look at bug 494589? As I noted there, there are semantic diffferences between the ntpath and posixpath versions of .expandvars() (like ntpath mapping $$ to $, and not expanding within single quotes). I personally have no use for the differences, but can't say whether anyone else does. The author of the ntpath version took time to write comments about its pecularities, so they weren't accidents at the time. Incompatible changes are usually PEP material. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2003-01-15 21:24 Message: Logged In: YES user_id=14198 It was late last night - the idea of ripping out all duplicated code wont work. A consolidation may be possible, but I haven't time. I'm deleting that patch, but still believe that from posixpath import expandvars is reasonable. Comments? ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-01-15 11:14 Message: Logged In: YES user_id=31435 Sounds like an excellent idea to me, Mark! The glory is all yours, if you're man enough to accept it <wink>. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2003-01-15 04:38 Message: Logged In: YES user_id=14198 In fact, why not go the whole-hog, and remove all code in ntpath.py that is identical to posixpath.py Example patch attached <wink> ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2003-01-14 19:44 Message: Logged In: YES user_id=14198 Is there any reason why: from posixpath import expandvars is not a better patch? From what I can see, posixpath's version works fine for Windows (windows os.environ is case insensitive) ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-01-13 09:59 Message: Logged In: YES user_id=31435 Mark, can you make time to look at this? I can't. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-01-03 19:31 Message: Logged In: YES user_id=33168 The patch didn't apply for me, so I created a new one and attached it. I can't test this. Maybe Tim is interested. ---------------------------------------------------------------------- Comment By: Miki Tebeka (tebeka) Date: 2002-12-28 23:28 Message: Logged In: YES user_id=358087 This time the checkbox is checked. :-) Miki ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2002-12-26 10:07 Message: Logged In: YES user_id=33168 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=658599&group_id=5470 _______________________________________________ Patches mailing list Patches@python.org http://mail.python.org/mailman/listinfo/patches