[Python-ideas] os.path.join

anatoly techtonik techtonik at gmail.com
Mon Nov 4 16:29:27 CET 2013


On Thu, Oct 31, 2013 at 6:15 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> On 10/31/2013 03:30 AM, anatoly techtonik wrote:
>>
>> On Wed, Oct 30, 2013 at 8:06 PM, Bruce Leban <bruce at leapyear.org> wrote:
>>>
>>> I don't know if the code is wrong but if you're asking if the *result* of
>>> join is wrong, I don't think it is. It references the same file as these
>>> commands:
>>>
>>> cd /static
>>> cat /styles/largestyles,css
>>
>>
>> 2. What is expected result of this operation?
>>
>> for 2 I'd expect 2nd path to be treated as relative one.
>
>
> If 2 is a relative path, it shouldn't be leading with a slash.

Right. But I am working more with URL paths nowadays. In there if I
want to join two paths, no matter if 2nd starts with slash or not, I
don't really expect the 2nd to rewrite the first.


More information about the Python-ideas mailing list