mirror of
https://github.com/aaPanel/aaPanel.git
synced 2026-08-28 10:49:59 +02:00
1. After the update, the software and panel directory permissions will be set to strict mode (it will be restored automatically after modification) 2. Increase the panel comprehensive anti-riot mechanism 3. Enhance the security of the panel session<br> 4. Enhanced panel entry verification mechanism 5. Optimize the terminal 6. Optimize the panel memory release mechanism Note 1: Version 6.8.2/6.9.11 has security issues, please be sure to upgrade to the latest version Note 2: After this update is successful, it will automatically log out and you need to log in again
27 lines
745 B
Python
27 lines
745 B
Python
# flake8: noqa
|
|
import sys
|
|
|
|
PY2 = sys.version_info[0] == 2
|
|
|
|
if PY2:
|
|
text_type = unicode
|
|
string_types = (str, unicode)
|
|
integer_types = (int, long)
|
|
iteritems = lambda d, *args, **kwargs: d.iteritems(*args, **kwargs)
|
|
|
|
def to_native(x, charset=sys.getdefaultencoding(), errors='strict'):
|
|
if x is None or isinstance(x, str):
|
|
return x
|
|
return x.encode(charset, errors)
|
|
|
|
else:
|
|
text_type = str
|
|
string_types = (str, )
|
|
integer_types = (int, )
|
|
iteritems = lambda d, *args, **kwargs: iter(d.items(*args, **kwargs))
|
|
|
|
def to_native(x, charset=sys.getdefaultencoding(), errors='strict'):
|
|
if x is None or isinstance(x, str):
|
|
return x
|
|
return x.decode(charset, errors)
|