← Back
Editing: cli_utils.cpython-312.opt-1.pyc
� n�h, � � � d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlmZ ddlm Z ddlm Z ddlmZ dd lmZ dd lm Z ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ erddlmZ d5dededeeef fd�Zdedefd�Zd6dedede e fd�Z G d� d� Z G d� dej@ � Z! G d� dejD � Z#d e ejH ejJ f d!e e dee fd"�Z& G d#� d$e'� Z(d%edefd&�Z) G d'� d(ejD � Z*d)ee dee fd*�Z+ G d+� d,ejD � Z, G d-� d.ejD � Z- G d/� d0ejD � Z.d%ede/fd1�Z0d2ed3ejJ ddfd4�Z1y)7z"Certbot command line util function� N)�Any)�Iterable)�List)�Optional)�Sequence)�Tuple)� TYPE_CHECKING)�Union)� challenges)� configuration)�errors)�util)� constants)�os)�helpful�filename�mode�returnc � � t j j | � } t | |� 5 }|j � }ddd� | fS # 1 sw Y � xY w# t $ r$}t j |j � �d}~ww xY w)a Returns the given file's contents. :param str filename: path to file :param str mode: open mode (see `open`) :returns: absolute path of filename and its contents :rtype: tuple :raises argparse.ArgumentTypeError: File does not exist or is not readable. N) r �path�abspath�open�read�OSError�argparse�ArgumentTypeError�strerror)r r �the_file�contents�excs �D/usr/lib/python3.12/site-packages/certbot/_internal/cli/cli_utils.py� read_filer"