• File: _compression.cpython-37.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/proc/self/root/opt/alt/python37/lib64/python3.7/__pycache__/_compression.cpython-37.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 4.02 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

Sj@s:dZddlZejZGdddejZGdddejZdS)z7Internal classes used by the gzip, lzma and bz2 modulesNc@s0eZdZdZddZddZddZdd	Zd
S)
BaseStreamzMode-checking helper functions.cCs|jrtddS)NzI/O operation on closed file)closed
ValueError)selfr1/opt/alt/python37/lib64/python3.7/_compression.py_check_not_closedszBaseStream._check_not_closedcCs|stddS)NzFile not open for reading)readableioUnsupportedOperation)rrrr_check_can_readszBaseStream._check_can_readcCs|stddS)NzFile not open for writing)writabler
r)rrrr_check_can_writeszBaseStream._check_can_writecCs(|std|s$tddS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r	r
rseekable)rrrr_check_can_seeks
zBaseStream._check_can_seekN)__name__
__module____qualname____doc__rrrrrrrrr	s
rcsjeZdZdZddZdddZfddZd	d
ZddZdddZ	ddZ
ejfddZ
ddZZS)DecompressReaderz5Adapts the decompressor API to a RawIOBase reader APIcCsdS)NTr)rrrrr	$szDecompressReader.readablercKs>||_d|_d|_d|_||_||_|jf|j|_||_dS)NFr)_fp_eof_pos_size_decomp_factory_decomp_args
_decompressor_trailing_error)rfpZdecomp_factoryZtrailing_errorZdecomp_argsrrr__init__'szDecompressReader.__init__csd|_tS)N)rsuperclose)r)	__class__rrr";szDecompressReader.closecCs
|jS)N)rr)rrrrr?szDecompressReader.seekablec
CsPt|:}|d$}|t|}||dt|<WdQRXWdQRXt|S)NB)
memoryviewcastreadlen)rbZviewZ	byte_viewdatarrrreadintoBs$zDecompressReader.readintorcCs|dkr|S|r|jrdSd}x|jjr|jjp>|jt}|sFP|jf|j	|_y|j
||}Wq|jk
rPYqXn4|jjr|jt}|st
dnd}|j
||}|r$Pq$W|sd|_|j|_dS|jt|7_|S)NrzACompressed file ended before the end-of-stream marker was reachedT)readallrreofZunused_datarr'BUFFER_SIZErrZ
decompressrZneeds_inputEOFErrorrrr()rsizer*Zrawblockrrrr'Hs>



zDecompressReader.readcCs,|jdd|_d|_|jf|j|_dS)NrF)rseekrrrrr)rrrr_rewindrszDecompressReader._rewindcCs|tjkrnV|tjkr"|j|}n@|tjkrT|jdkrHx|tjrFq8W|j|}ntd	|||jkrv|
n
||j8}x0|dkr|ttj|}|sP|t|8}qW|jS)NrzInvalid value for whence: {})
r
SEEK_SETSEEK_CURrSEEK_ENDrr'DEFAULT_BUFFER_SIZErformatr3minr()roffsetwhencer*rrrr2xs&







zDecompressReader.seekcCs|jS)z!Return the current file position.)r)rrrrtellszDecompressReader.tell)r)r)rrrrr	r r"rr+r'r3r
r4r2r<
__classcell__rr)r#rr!s

*r)rr
r7r/BufferedIOBaser	RawIOBaserrrrr<module>s