ÿØÿàJFIFHHÿá .
BSA HACKER
Logo of a company Server : Apache
System : Linux nusantara.hosteko.com 4.18.0-553.16.1.lve.el8.x86_64 #1 SMP Tue Aug 13 17:45:03 UTC 2024 x86_64
User : koperas1 ( 1254)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/thread-self/root/opt/cppython/lib/python3.8/site-packages/ftputil/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/opt/cppython/lib/python3.8/site-packages/ftputil/path_encoding.py
# Copyright (C) 2021, Stefan Schwarzer <sschwarzer@sschwarzer.net>
# and ftputil contributors (see `doc/contributors.txt`)
# See the file LICENSE for licensing terms.

"""
Compatibility code for Python versions <= 3.8 vs. >= 3.9

Python 3.9 changed the default encoding for FTP remote paths from latin-1 to
UTF-8 which causes a few headaches for ftputil.
"""

import sys


__all__ = ["DEFAULT_ENCODING", "RUNNING_UNDER_PY39_AND_UP", "FTPLIB_DEFAULT_ENCODING"]


RUNNING_UNDER_PY39_AND_UP = (sys.version_info.major, sys.version_info.minor) >= (3, 9)

# FTP path default encoding for Python 3.8 and below
FTPLIB_PY38_ENCODING = "latin-1"

# FTP path default encoding for Python 3.9 and above
FTPLIB_PY39_ENCODING = "utf-8"

# Default encoding for ftputil. Stay compatible to the behavior of former
# ftputil versions and Python <= 3.8.
DEFAULT_ENCODING = FTPLIB_PY38_ENCODING

if RUNNING_UNDER_PY39_AND_UP:
    FTPLIB_DEFAULT_ENCODING = FTPLIB_PY39_ENCODING
else:
    FTPLIB_DEFAULT_ENCODING = FTPLIB_PY38_ENCODING