| Server IP : 146.190.157.162 / Your IP : 216.73.216.186 Web Server : Apache System : Linux ubuntu-s-2vcpu-4gb-amd-sfo3-01-KIT-DIGITAL 6.5.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 15:10:09 UTC 2024 x86_64 User : businessweek ( 639) PHP Version : 8.2.10-2ubuntu2.2 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_signal,pcntl_signal_dispatch,pcntl_getpriority,pcntl_setpriority,dl,putenv,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/apport/__pycache__/ |
Upload File : |
�
�$e� � �Z � d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlZddlZddl
ZddlmZ ddlmZ ej d� � Zdad� ZdCd �ZdDd
�ZdCd�ZdEd�Zd
� Zd� Zd� Zd� Zd� Z d� Z!d� Z"d� Z#de
j$ ddfd�Z%d� Z&d� Z'd� Z(de
j$ dfd�Z)d� Z*d� Z+dFdd�d�Z,dFd�Z-dZ.d Z/d!Z0d"Z1d#Z2d$Z3d%Z4d&Z5d'Z6d(Z7d)Z8d*Z9d+� Z:d,� Z;dFd-�Z<d.� Z=d/� Z>d0� Z?dGd1ed2e@d3dfd4�ZAd5� ZBd6� ZCd7� ZDdFd8�ZEd9� ZFd:� ZGd;� ZHdHd=�ZId>� ZJd?� ZKd@� ZLdFdA�ZMdB� ZNejO jP ZPejO jQ ZQdS )Iz/Convenience functions for use in package hooks.� N)�impl)�
ProblemReportz[^0-9a-zA-Z_.-]c � � t | t � � r| � d� � } t � d| � dd� � � � S )z{Generate a valid report key name from a file path.
This will replace invalid punctuation symbols with valid ones.
�UTF-8�.� �_)�
isinstance�bytes�decode�_invalid_key_chars_re�sub�replace)�paths �2/usr/lib/python3/dist-packages/apport/hookutils.py�path_to_keyr ( sK � �
�$���� $��{�{�7�#�#�� �$�$�S�$�,�,�s�C�*@�*@�A�A�A� TFc � � d|v rdS |st |� � }t j � |� � rt | ||||� � dS dS )a� Attach file contents if file exists.
If key is not specified, the key name will be derived from the file
name with path_to_key().
If overwrite is True, an existing key will be updated. If it is False, a
new key with '_' appended will be added instead.
If the contents is valid UTF-8, or force_unicode is True, then the value
will be a string, otherwise it will be bytes.
�../N)r �osr �exists�attach_file��reportr �key� overwrite�
force_unicodes r �attach_file_if_existsr 2 sf � �
��}�}���� ��$���� �w�~�~�d��� A��F�D�#�y�-�@�@�@�@�@�A� Ar c �> � d| v rdS t j | t j t j z t j z � � }t j |� � }t j � | � � }|j t j |� � j k s| |k rt j
|� � dS t j |j � � rTt j
|d� � 5 }|� � � � � � }ddd� � n# 1 swxY w Y nt j
|� � dS |r|� dd� � � S |� d� � S # t"