1. Python / Говнокод #24307

    0

    1. 1
    Прыщеговно

    Explanation: The issue stemmed from two issues one in normpath and the other in os.path.join. It turns out that when normpath (or abspath) gets an absolute path starting with a single slash or 3+ slashes, the result would have a single slash. However, if the input had exactly two leading slashes the output will retain them. This behavior conforms to an obscore passage in the POSIX standard (last paragraph):

    A pathname that begins with two successive slashes may be interpreted in an implementation-defined manner, although more than two leading slashes shall be treated as a single slash.

    normpath и abspath из os.path

    Запостил: syoma, 23 Мая 2018

    Комментарии (79) RSS

    Добавить комментарий