0

Function dirname from Python module os.path should return directory name, so why it does it return file name when we use doubleslash?

path = "/a.php"
dirname(path) # result is /

vs

path = "//a.php"
dirname(path) # result is //a.php
Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
Artur Lodklif
  • 83
  • 1
  • 9
  • 1
    I don't get this result on Linux. You get this result, presumably on Windows, because `//` *actually means something else* for Windows paths (at least, at the *beginning* of the path). It's not Python's choice. – Karl Knechtel Apr 11 '23 at 08:15

0 Answers0