Message154208
| Author |
eric.araujo |
| Recipients |
Adam.Groszer, benjamin.peterson, cjw296, eric.araujo, georg.brandl, jaraco, nadeem.vawda, tarek |
| Date |
2012年02月25日.08:21:42 |
| SpamBayes Score |
0.0 |
| Marked as misclassified |
No |
| Message-id |
<1330158103.36.0.921812324107.issue6884@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Thanks a bunch. I’ll offer you cookies when we meet :)
>> Fix merged. I don’t fully understand why one place needs two escapes and the others just one.
> The places that use one level of escaping are the ones that deal with the regex string directly.
> In glob_to_re() itself, the string you're building is a regex replacement pattern that *operates on*
> the regex that gets returned
Makes sense. I’ve added a comment as you suggested (although an unfunny one, without dragons; I don’t like "you’re not supposed to understand this"-like comments).
>>> I also took the liberty of changing the checks for whether the separator needs to be escaped
>>> - it's better to escape everything except "/", just in case someone decides to port Python to
>>> some platform using a weird directory separator that is neither "/" nor r"\".
>> I didn’t take that part. If someone wants to port Python with a new style of os.sep or os.extsep,
>> I’ll deal with it when they report that.
> If you want to leave it as it is, that's your choice. But I do think it's better to make this Do The
> Right Thing now, given how easy it is.
I’d be okay with some cleanup in packaging, but for distutils I want the minimal patch.
> Well, as far as I can make out, the current implementation always uses r'\' to join paths. But it
> won't convert existing '/'s in the start path to r'\'s, so you might still end up encountering both
> separators (assuming the initial path is something you get from the user somewhere along the line).
Hm, it should come from the manifest template, i.e. using '/' that get translated to os.sep. I’ll remove the regex redundancy in packaging, we have rather good tests for manifest and sdist now. |
|