• File: nturl2path.cpython-37.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/__pycache__/nturl2path.cpython-37.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 1.57 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

Sj
@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///)rr
rZquoterrrr)prrrrrrrrrpathname2url-s"


rN)__doc__rrrrrr<module>s%