A
A
albertalexandrov2018-10-16 08:37:12
Python
albertalexandrov, 2018-10-16 08:37:12

Does os.path.join work strangely?

Hey!
Somehow strange (first join) os.path.join works:

import os

path1 = '/var'
path2 = '/tmp'
path3 = 'tmp'

print(os.path.join(path1, path2))  # /tmp
print(os.path.join(path1, path3))  # /var/tmp

Why is that?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question