B PL @sdZddZddZdS)zConvert a NT pathname to a file URL and vice versa. This module only exists to provide OS-specific code for urllib.requests, thus do not use directly. cCsddl}ddl}|dd}d|kr\|dddkr@|dd}|d}|jd |S|d}t|dks|dd |jkrd |}t ||dd  }|d d}|d}x$|D]}|r|d |j|}qW| dr| dr|d 7}|S) z{OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.N:|z/////\z Bad URL: ) string urllib.parsereplacesplitparseZunquotejoinlenZ ascii_lettersOSErrorupperendswith)Zurlr urllib componentscomperrordrivepathr//opt/alt/python37/lib64/python3.7/nturl2path.py url2pathnames(      rcCsddl}d|krD|dddkr(d|}|d}|jd|S|d}t|dksjt|ddkrzd |}t||j|d}|dd}d |d}x$|D]}|r|d|j|}qW|S) z{OS-specific conversion from a file system path to a relative URL of the 'file' scheme; not recommended for general use.rNrrz\\rrr z Bad path: z///)r r rZquoterrrr)prrrrrrrrr pathname2url-s"    rN)__doc__rrrrrrs%