View file File name : _pyio.cpython-36.opt-2.pyc Content :3 \!X � @ s^ d dl Z d dlZd dlZd dlZd dlZd dlZyd dlmZ W n e k r` d dl mZ Y nX ejd4krzd dlm Z ndZd dlZd dlmZmZmZmZ d ddhZee d �r�eje j� eje j� d5ZeZd7dd�ZG dd� d�ZG dd� d�Zy ejZW n( ek �r* G dd� de e!�ZY nX G dd� dej"d�Z#ej#j$e#� G dd� de#�Z%ej%j$e%� d dl&m'Z' e%j$e'� G dd� de#�Z(ej(j$e(� G dd� de(�Z)G d d!� d!e(�Z*G d"d#� d#e)�Z+G d$d%� d%e)�Z,G d&d'� d'e(�Z-G d(d)� d)e,e+�Z.G d*d+� d+e%�Z'G d,d-� d-e#�Z/ej/j$e/� G d.d/� d/ej0�Z1G d0d1� d1e/�Z2G d2d3� d3e2�Z3dS )8� N)� allocate_lock�win32�cygwin)�setmode)�__all__�SEEK_SET�SEEK_CUR�SEEK_END� � � SEEK_HOLE� i �rTc C s~ t | t�stj| �} t | tttf�s0td| ��t |t�sFtd| ��t |t�s\td| ��|d k r|t |t� r|td| ��|d k r�t |t� r�td| ��t|�}|td� s�t|�t|�kr�t d| ��d|k} d|k} d |k}d |k}d|k} d|k}d |k}d|k�rH| �s&|�s&|�s&| �r.t d��dd l }|jdtd� d} |�r\|�r\t d��| | | | dk�rzt d��| �p�| �p�|�p�|�s�t d��|�r�|d k �r�t d��|�r�|d k �r�t d��|�r�|d k �r�t d��t | | �r�d�p�d| �r d�pd |�rd �pd |�r d �p"d | �r0d�p2d ||d�}|}�yd}|dk�sh|dk �rp|j� �rpd!}d}|dk �r�t}ytj|j� �j}W n ttfk �r� Y nX |dk�r�|}|dk �r�t d��|dk�r�|�r�|S t d��| �r�t||�}n<| �s|�s|�rt||�}n| �r,t||�}nt d | ��|}|�rF|S t|||||�}|}||_|S |j� � Y nX d S )"Nzinvalid file: %rzinvalid mode: %rzinvalid buffering: %rzinvalid encoding: %rzinvalid errors: %rzaxrwb+tU�xr �w�a�+�t�b�Uz4mode U cannot be combined with 'x', 'w', 'a', or '+'r z'U' mode is deprecatedr Tz'can't have text and binary mode at oncer z)can't have read/write/append mode at oncez/must have exactly one of read/write/append modez-binary mode doesn't take an encoding argumentz+binary mode doesn't take an errors argumentz+binary mode doesn't take a newline argument� )�openerFzinvalid buffering sizezcan't have unbuffered text I/Ozunknown mode: %r���)� isinstance�int�os�fspath�str�bytes� TypeError�set�len� ValueError�warnings�warn�DeprecationWarning�FileIO�isatty�DEFAULT_BUFFER_SIZE�fstat�fileno� st_blksize�OSError�AttributeError�BufferedRandom�BufferedWriter�BufferedReader� TextIOWrapper�mode�close)�filer2 � buffering�encoding�errors�newline�closefdr ZmodesZcreatingZreadingZwritingZ appendingZupdating�textZbinaryr# �raw�result�line_bufferingZbs�buffer� r? �/usr/lib64/python3.6/_pyio.py�open( s� { > rA c @ s e Zd Zdd� ZdS )� DocDescriptorc C s dt j S )Nz\open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True) )rA �__doc__)�self�obj�typr? r? r@ �__get__� s zDocDescriptor.__get__N)�__name__� __module__�__qualname__rG r? r? r? r@ rB � s rB c @ s e Zd Ze� Zdd� ZdS )�OpenWrapperc O s t ||�S )N)rA )�cls�args�kwargsr? r? r@ �__new__ s zOpenWrapper.__new__N)rH rI rJ rB rC rO r? r? r? r@ rK s rK c @ s e Zd ZdS )�UnsupportedOperationN)rH rI rJ r? r? r? r@ rP s rP c @ s� e Zd Zdd� Zd5dd�Zdd� Zd6d d �Zdd� Zd Zdd� Z dd� Z dd� Zd7dd�Zdd� Z d8dd�Zdd� Zd9dd�Zedd� �Zd:d d!�Zd"d#� Zd$d%� Zd&d'� Zd(d)� Zd<d+d,�Zd-d.� Zd/d0� Zd=d1d2�Zd3d4� ZdS )>�IOBasec C s t d| jj|f ��d S )Nz%s.%s() not supported)rP � __class__rH )rD �namer? r? r@ �_unsupported@ s zIOBase._unsupportedr c C s | j d� d S )N�seek)rT )rD �pos�whencer? r? r@ rU G s zIOBase.seekc C s | j dd�S )Nr r )rU )rD r? r? r@ �tellW s zIOBase.tellNc C s | j d� d S )N�truncate)rT )rD rV r? r? r@ rY [ s zIOBase.truncatec C s | j � d S )N)�_checkClosed)rD r? r? r@ �flushe s zIOBase.flushFc C s | j sz| j� W d d| _ X d S )NT)�_IOBase__closedr[ )rD r? r? r@ r3 o s zIOBase.closec C s y| j � W n Y nX d S )N)r3 )rD r? r? r@ �__del__z s zIOBase.__del__c C s dS )NFr? )rD r? r? r@ �seekable� s zIOBase.seekablec C s | j � st|d krdn|��d S )NzFile or stream is not seekable.)r^ rP )rD �msgr? r? r@ �_checkSeekable� s zIOBase._checkSeekablec C s dS )NFr? )rD r? r? r@ �readable� s zIOBase.readablec C s | j � st|d krdn|��d S )NzFile or stream is not readable.)ra rP )rD r_ r? r? r@ �_checkReadable� s zIOBase._checkReadablec C s dS )NFr? )rD r? r? r@ �writable� s zIOBase.writablec C s | j � st|d krdn|��d S )NzFile or stream is not writable.)rc rP )rD r_ r? r? r@ �_checkWritable� s zIOBase._checkWritablec C s | j S )N)r\ )rD r? r? r@ �closed� s z IOBase.closedc C s | j rt|d krdn|��d S )NzI/O operation on closed file.)re r"