/opt/alt/python34/lib64/python3.4/__pycache__
NameSizeModeActions
abc.cpython-34.pyc78770644editdlrm
abc.cpython-34.pyo78270644editdlrm
aifc.cpython-34.pyc279120644editdlrm
aifc.cpython-34.pyo279120644editdlrm
antigravity.cpython-34.pyc8470644editdlrm
antigravity.cpython-34.pyo8470644editdlrm
argparse.cpython-34.pyc658740644editdlrm
argparse.cpython-34.pyo657150644editdlrm
ast.cpython-34.pyc123600644editdlrm
ast.cpython-34.pyo123600644editdlrm
asynchat.cpython-34.pyc83590644editdlrm
asynchat.cpython-34.pyo83590644editdlrm
asyncore.cpython-34.pyc179630644editdlrm
asyncore.cpython-34.pyo179630644editdlrm
base64.cpython-34.pyc182970644editdlrm
base64.cpython-34.pyo180990644editdlrm
bdb.cpython-34.pyc186940644editdlrm
bdb.cpython-34.pyo186940644editdlrm
binhex.cpython-34.pyc135410644editdlrm
binhex.cpython-34.pyo135410644editdlrm
bisect.cpython-34.pyc28580644editdlrm
bisect.cpython-34.pyo28580644editdlrm
bz2.cpython-34.pyc151560644editdlrm
bz2.cpython-34.pyo151560644editdlrm
calendar.cpython-34.pyc275670644editdlrm
calendar.cpython-34.pyo275670644editdlrm
cgi.cpython-34.pyc298270644editdlrm
cgi.cpython-34.pyo298270644editdlrm
cgitb.cpython-34.pyc110640644editdlrm
cgitb.cpython-34.pyo110640644editdlrm
chunk.cpython-34.pyc52700644editdlrm
chunk.cpython-34.pyo52700644editdlrm
cmd.cpython-34.pyc134560644editdlrm
cmd.cpython-34.pyo134560644editdlrm
code.cpython-34.pyc97020644editdlrm
code.cpython-34.pyo97020644editdlrm
codecs.cpython-34.pyc351320644editdlrm
codecs.cpython-34.pyo351320644editdlrm
codeop.cpython-34.pyc64660644editdlrm
codeop.cpython-34.pyo64660644editdlrm
colorsys.cpython-34.pyc36590644editdlrm
colorsys.cpython-34.pyo36590644editdlrm
compileall.cpython-34.pyc73780644editdlrm
compileall.cpython-34.pyo73780644editdlrm
configparser.cpython-34.pyc448820644editdlrm
configparser.cpython-34.pyo448820644editdlrm
contextlib.cpython-34.pyc103700644editdlrm
contextlib.cpython-34.pyo103700644editdlrm
copy.cpython-34.pyc80610644editdlrm
copy.cpython-34.pyo79750644editdlrm
copyreg.cpython-34.pyc46070644editdlrm
copyreg.cpython-34.pyo45660644editdlrm
cProfile.cpython-34.pyc46220644editdlrm
cProfile.cpython-34.pyo46220644editdlrm
crypt.cpython-34.pyc24370644editdlrm
crypt.cpython-34.pyo24370644editdlrm
csv.cpython-34.pyc129970644editdlrm
csv.cpython-34.pyo129970644editdlrm
datetime.cpython-34.pyc562640644editdlrm
datetime.cpython-34.pyo542960644editdlrm
decimal.cpython-34.pyc1725260644editdlrm
decimal.cpython-34.pyo1725260644editdlrm
difflib.cpython-34.pyc605150644editdlrm
difflib.cpython-34.pyo604670644editdlrm
dis.cpython-34.pyc145870644editdlrm
dis.cpython-34.pyo145870644editdlrm
doctest.cpython-34.pyc801100644editdlrm
doctest.cpython-34.pyo798370644editdlrm
dummy_threading.cpython-34.pyc12140644editdlrm
dummy_threading.cpython-34.pyo12140644editdlrm
enum.cpython-34.pyc163390644editdlrm
enum.cpython-34.pyo163390644editdlrm
filecmp.cpython-34.pyc91200644editdlrm
filecmp.cpython-34.pyo91200644editdlrm
fileinput.cpython-34.pyc142970644editdlrm
fileinput.cpython-34.pyo142970644editdlrm
fnmatch.cpython-34.pyc31460644editdlrm
fnmatch.cpython-34.pyo31460644editdlrm
formatter.cpython-34.pyc189160644editdlrm
formatter.cpython-34.pyo189160644editdlrm
fractions.cpython-34.pyc192700644editdlrm
fractions.cpython-34.pyo192700644editdlrm
ftplib.cpython-34.pyc333220644editdlrm
ftplib.cpython-34.pyo333220644editdlrm
functools.cpython-34.pyc236140644editdlrm
functools.cpython-34.pyo236140644editdlrm
genericpath.cpython-34.pyc34930644editdlrm
genericpath.cpython-34.pyo34930644editdlrm
getopt.cpython-34.pyc67330644editdlrm
getopt.cpython-34.pyo66910644editdlrm
getpass.cpython-34.pyc46240644editdlrm
getpass.cpython-34.pyo46240644editdlrm
gettext.cpython-34.pyc151740644editdlrm
gettext.cpython-34.pyo151740644editdlrm
glob.cpython-34.pyc28800644editdlrm
glob.cpython-34.pyo28800644editdlrm
gzip.cpython-34.pyc194460644editdlrm
gzip.cpython-34.pyo193920644editdlrm
hashlib.cpython-34.pyc79440644editdlrm
hashlib.cpython-34.pyo79440644editdlrm
heapq.cpython-34.pyc139100644editdlrm
heapq.cpython-34.pyo139100644editdlrm
hmac.cpython-34.pyc51460644editdlrm
hmac.cpython-34.pyo51460644editdlrm
imaplib.cpython-34.pyc434790644editdlrm
imaplib.cpython-34.pyo409550644editdlrm
imghdr.cpython-34.pyc41430644editdlrm
imghdr.cpython-34.pyo41430644editdlrm
imp.cpython-34.pyc98670644editdlrm
imp.cpython-34.pyo98670644editdlrm
inspect.cpython-34.pyc763270644editdlrm
inspect.cpython-34.pyo760060644editdlrm
io.cpython-34.pyc34580644editdlrm
io.cpython-34.pyo34580644editdlrm
ipaddress.cpython-34.pyc629840644editdlrm
ipaddress.cpython-34.pyo629840644editdlrm
keyword.cpython-34.pyc19460644editdlrm
keyword.cpython-34.pyo19460644editdlrm
linecache.cpython-34.pyc31120644editdlrm
linecache.cpython-34.pyo31120644editdlrm
locale.cpython-34.pyc372760644editdlrm
locale.cpython-34.pyo372760644editdlrm
lzma.cpython-34.pyc159170644editdlrm
lzma.cpython-34.pyo159170644editdlrm
macpath.cpython-34.pyc60060644editdlrm
macpath.cpython-34.pyo60060644editdlrm
macurl2path.cpython-34.pyc21020644editdlrm
macurl2path.cpython-34.pyo21020644editdlrm
mailbox.cpython-34.pyc702880644editdlrm
mailbox.cpython-34.pyo701890644editdlrm
mailcap.cpython-34.pyc65440644editdlrm
mailcap.cpython-34.pyo65440644editdlrm
mimetypes.cpython-34.pyc168070644editdlrm
mimetypes.cpython-34.pyo168070644editdlrm
modulefinder.cpython-34.pyc173760644editdlrm
modulefinder.cpython-34.pyo172970644editdlrm
netrc.cpython-34.pyc42770644editdlrm
netrc.cpython-34.pyo42770644editdlrm
nntplib.cpython-34.pyc363100644editdlrm
nntplib.cpython-34.pyo363100644editdlrm
ntpath.cpython-34.pyc133050644editdlrm
ntpath.cpython-34.pyo133050644editdlrm
nturl2path.cpython-34.pyc17160644editdlrm
nturl2path.cpython-34.pyo17160644editdlrm
numbers.cpython-34.pyc126670644editdlrm
numbers.cpython-34.pyo126670644editdlrm
opcode.cpython-34.pyc51740644editdlrm
opcode.cpython-34.pyo51740644editdlrm
operator.cpython-34.pyc127780644editdlrm
operator.cpython-34.pyo127780644editdlrm
optparse.cpython-34.pyc515370644editdlrm
optparse.cpython-34.pyo514600644editdlrm
os.cpython-34.pyc295990644editdlrm
os.cpython-34.pyo295990644editdlrm
pathlib.cpython-34.pyc404830644editdlrm
pathlib.cpython-34.pyo404830644editdlrm
pdb.cpython-34.pyc494720644editdlrm
pdb.cpython-34.pyo494060644editdlrm
pickle.cpython-34.pyc469840644editdlrm
pickle.cpython-34.pyo468380644editdlrm
pickletools.cpython-34.pyc702540644editdlrm
pickletools.cpython-34.pyo691670644editdlrm
pipes.cpython-34.pyc84310644editdlrm
pipes.cpython-34.pyo84310644editdlrm
pkgutil.cpython-34.pyc176000644editdlrm
pkgutil.cpython-34.pyo176000644editdlrm
platform.cpython-34.pyc311720644editdlrm
platform.cpython-34.pyo311720644editdlrm
plistlib.cpython-34.pyc301510644editdlrm
plistlib.cpython-34.pyo300680644editdlrm
poplib.cpython-34.pyc137540644editdlrm
poplib.cpython-34.pyo137540644editdlrm
posixpath.cpython-34.pyc98090644editdlrm
posixpath.cpython-34.pyo98090644editdlrm
pprint.cpython-34.pyc114600644editdlrm
pprint.cpython-34.pyo112950644editdlrm
profile.cpython-34.pyc151510644editdlrm
profile.cpython-34.pyo148980644editdlrm
pstats.cpython-34.pyc236750644editdlrm
pstats.cpython-34.pyo236750644editdlrm
pty.cpython-34.pyc42250644editdlrm
pty.cpython-34.pyo42250644editdlrm
pyclbr.cpython-34.pyc91920644editdlrm
pyclbr.cpython-34.pyo91920644editdlrm
pydoc.cpython-34.pyc909150644editdlrm
pydoc.cpython-34.pyo908540644editdlrm
py_compile.cpython-34.pyc68570644editdlrm
py_compile.cpython-34.pyo68570644editdlrm
queue.cpython-34.pyc92620644editdlrm
queue.cpython-34.pyo92620644editdlrm
quopri.cpython-34.pyc64460644editdlrm
quopri.cpython-34.pyo62360644editdlrm
random.cpython-34.pyc190590644editdlrm
random.cpython-34.pyo190590644editdlrm
re.cpython-34.pyc145500644editdlrm
re.cpython-34.pyo145500644editdlrm
reprlib.cpython-34.pyc58720644editdlrm
reprlib.cpython-34.pyo58720644editdlrm
rlcompleter.cpython-34.pyc56950644editdlrm
rlcompleter.cpython-34.pyo56950644editdlrm
runpy.cpython-34.pyc77530644editdlrm
runpy.cpython-34.pyo77530644editdlrm
sched.cpython-34.pyc65730644editdlrm
sched.cpython-34.pyo65730644editdlrm
selectors.cpython-34.pyc167440644editdlrm
selectors.cpython-34.pyo167440644editdlrm
shelve.cpython-34.pyc99550644editdlrm
shelve.cpython-34.pyo99550644editdlrm
shlex.cpython-34.pyc75180644editdlrm
shlex.cpython-34.pyo75180644editdlrm
shutil.cpython-34.pyc330150644editdlrm
shutil.cpython-34.pyo330150644editdlrm
site.cpython-34.pyc179710644editdlrm
site.cpython-34.pyo179710644editdlrm
smtpd.cpython-34.pyc256690644editdlrm
smtpd.cpython-34.pyo256690644editdlrm
smtplib.cpython-34.pyc331290644editdlrm
smtplib.cpython-34.pyo330550644editdlrm
sndhdr.cpython-34.pyc67690644editdlrm
sndhdr.cpython-34.pyo67690644editdlrm
socket.cpython-34.pyc181110644editdlrm
socket.cpython-34.pyo180610644editdlrm
socketserver.cpython-34.pyc232550644editdlrm
socketserver.cpython-34.pyo232550644editdlrm
sre_compile.cpython-34.pyc119350644editdlrm
sre_compile.cpython-34.pyo117780644editdlrm
sre_constants.cpython-34.pyc55810644editdlrm
sre_constants.cpython-34.pyo55810644editdlrm
sre_parse.cpython-34.pyc202380644editdlrm
sre_parse.cpython-34.pyo202380644editdlrm
ssl.cpython-34.pyc276080644editdlrm
ssl.cpython-34.pyo276080644editdlrm
stat.cpython-34.pyc35780644editdlrm
stat.cpython-34.pyo35780644editdlrm
statistics.cpython-34.pyc171580644editdlrm
statistics.cpython-34.pyo168560644editdlrm
string.cpython-34.pyc83760644editdlrm
string.cpython-34.pyo83760644editdlrm
stringprep.cpython-34.pyc136360644editdlrm
stringprep.cpython-34.pyo135730644editdlrm
struct.cpython-34.pyc3470644editdlrm
struct.cpython-34.pyo3470644editdlrm
subprocess.cpython-34.pyc433590644editdlrm
subprocess.cpython-34.pyo432460644editdlrm
sunau.cpython-34.pyc183090644editdlrm
sunau.cpython-34.pyo183090644editdlrm
symbol.cpython-34.pyc26620644editdlrm
symbol.cpython-34.pyo26620644editdlrm
symtable.cpython-34.pyc113050644editdlrm
symtable.cpython-34.pyo111830644editdlrm
sysconfig.cpython-34.pyc172870644editdlrm
sysconfig.cpython-34.pyo172870644editdlrm
tabnanny.cpython-34.pyc77490644editdlrm
tabnanny.cpython-34.pyo77490644editdlrm
tarfile.cpython-34.pyc680400644editdlrm
tarfile.cpython-34.pyo680400644editdlrm
telnetlib.cpython-34.pyc193940644editdlrm
telnetlib.cpython-34.pyo193940644editdlrm
tempfile.cpython-34.pyc215760644editdlrm
tempfile.cpython-34.pyo215760644editdlrm
textwrap.cpython-34.pyc138000644editdlrm
textwrap.cpython-34.pyo137140644editdlrm
this.cpython-34.pyc13160644editdlrm
this.cpython-34.pyo13160644editdlrm
threading.cpython-34.pyc389650644editdlrm
threading.cpython-34.pyo382520644editdlrm
timeit.cpython-34.pyc110620644editdlrm
timeit.cpython-34.pyo110620644editdlrm
token.cpython-34.pyc36150644editdlrm
token.cpython-34.pyo36150644editdlrm
tokenize.cpython-34.pyc199510644editdlrm
tokenize.cpython-34.pyo199010644editdlrm
trace.cpython-34.pyc241840644editdlrm
trace.cpython-34.pyo241270644editdlrm
traceback.cpython-34.pyc110910644editdlrm
traceback.cpython-34.pyo110910644editdlrm
tracemalloc.cpython-34.pyc171300644editdlrm
tracemalloc.cpython-34.pyo171300644editdlrm
tty.cpython-34.pyc11460644editdlrm
tty.cpython-34.pyo11460644editdlrm
types.cpython-34.pyc55600644editdlrm
types.cpython-34.pyo55600644editdlrm
uu.cpython-34.pyc40210644editdlrm
uu.cpython-34.pyo40210644editdlrm
uuid.cpython-34.pyc218640644editdlrm
uuid.cpython-34.pyo218020644editdlrm
warnings.cpython-34.pyc122680644editdlrm
warnings.cpython-34.pyo115360644editdlrm
wave.cpython-34.pyc191350644editdlrm
wave.cpython-34.pyo190740644editdlrm
weakref.cpython-34.pyc203450644editdlrm
weakref.cpython-34.pyo203080644editdlrm
webbrowser.cpython-34.pyc171320644editdlrm
webbrowser.cpython-34.pyo170930644editdlrm
xdrlib.cpython-34.pyc90020644editdlrm
xdrlib.cpython-34.pyo90020644editdlrm
zipfile.cpython-34.pyc458200644editdlrm
zipfile.cpython-34.pyo457710644editdlrm
_bootlocale.cpython-34.pyc10470644editdlrm
_bootlocale.cpython-34.pyo10160644editdlrm
_collections_abc.cpython-34.pyc239490644editdlrm
_collections_abc.cpython-34.pyo239490644editdlrm
_compat_pickle.cpython-34.pyc75010644editdlrm
_compat_pickle.cpython-34.pyo74270644editdlrm
_dummy_thread.cpython-34.pyc48250644editdlrm
_dummy_thread.cpython-34.pyo48250644editdlrm
_markupbase.cpython-34.pyc89320644editdlrm
_markupbase.cpython-34.pyo87450644editdlrm
_osx_support.cpython-34.pyc106300644editdlrm
_osx_support.cpython-34.pyo106300644editdlrm
_pyio.cpython-34.pyc649330644editdlrm
_pyio.cpython-34.pyo649070644editdlrm
_sitebuiltins.cpython-34.pyc36770644editdlrm
_sitebuiltins.cpython-34.pyo36770644editdlrm
_strptime.cpython-34.pyc157790644editdlrm
_strptime.cpython-34.pyo157790644editdlrm
_sysconfigdata.cpython-34.pyc227000644editdlrm
_sysconfigdata.cpython-34.pyo227000644editdlrm
_threading_local.cpython-34.pyc69460644editdlrm
_threading_local.cpython-34.pyo69460644editdlrm
_weakrefset.cpython-34.pyc84650644editdlrm
_weakrefset.cpython-34.pyo84650644editdlrm
__future__.cpython-34.pyc41680644editdlrm
__future__.cpython-34.pyo41680644editdlrm
__phello__.foo.cpython-34.pyc1340644editdlrm
__phello__.foo.cpython-34.pyo1340644editdlrm
Edit: /opt/alt/python34/lib64/python3.4/__pycache__/_pyio.cpython-34.pyo (64907B)
f @sdZddlZddlZddlZddlZyddlmZWn"ek rnddl mZYnXddl Z ddl m Z m Z m Z mZdddhZeedrejejejejndd ZeZd d dddd dd d ZGdddZGdddZy e jZWn+ek rpGdddeeZYnXGddddejZe jjeGdddeZ e j je ddl!m"Z"e je"GdddeZ#e j#je#Gddde#Z$Gddde#Z%Gd d!d!e$Z&Gd"d#d#e$Z'Gd$d%d%e#Z(Gd&d'd'e'e&Z)Gd(d)d)eZ*e j*je*Gd*d+d+ej+Z,Gd,d-d-e*Z-Gd.d/d/e-Z.dS)0z) Python implementation of the io module. N) allocate_lock)__all__SEEK_SETSEEK_CURSEEK_END SEEK_HOLEirTcCst|tttfs+td|nt|tsMtd|nt|tsotd|n|dk rt|t rtd|n|dk rt|t rtd|nt|}|tdst|t|krtd|nd|k} d |k} d |k} d |k} d |k} d |k}d|k}d|kr| s| s| rtdnddl}|j dt dd} n|r|rtdn| | | | dkrtdn| p| p| p| s&tdn|rG|dk rGtdn|rh|dk rhtdn|r|dk rtdnt || rdpd| rd pd| rd pd| rd pd| rd pd|d|}|}y}d}|dks |dkr/|j r/d"}d}n|dkrt }ytj|jj}Wnttfk rwYqX|dkr|}qn|dkrtdn|dkr|r|Std n| rt||}nL| s| s| r t||}n(| r$t||}ntd!||}|rD|St|||||}|}||_|SWn|jYnXdS)#aOpen file and return a stream. Raise OSError upon failure. file is either a text or byte string giving the name (and the path if the file isn't in the current working directory) of the file to be opened or an integer file descriptor of the file to be wrapped. (If a file descriptor is given, it is closed when the returned I/O object is closed, unless closefd is set to False.) mode is an optional string that specifies the mode in which the file is opened. It defaults to 'r' which means open for reading in text mode. Other common values are 'w' for writing (truncating the file if it already exists), 'x' for exclusive creation of a new file, and 'a' for appending (which on some Unix systems, means that all writes append to the end of the file regardless of the current seek position). In text mode, if encoding is not specified the encoding used is platform dependent. (For reading and writing raw bytes use binary mode and leave encoding unspecified.) The available modes are: ========= =============================================================== Character Meaning --------- --------------------------------------------------------------- 'r' open for reading (default) 'w' open for writing, truncating the file first 'x' create a new file and open it for writing 'a' open for writing, appending to the end of the file if it exists 'b' binary mode 't' text mode (default) '+' open a disk file for updating (reading and writing) 'U' universal newline mode (deprecated) ========= =============================================================== The default mode is 'rt' (open for reading text). For binary random access, the mode 'w+b' opens and truncates the file to 0 bytes, while 'r+b' opens the file without truncation. The 'x' mode implies 'w' and raises an `FileExistsError` if the file already exists. Python distinguishes between files opened in binary and text modes, even when the underlying operating system doesn't. Files opened in binary mode (appending 'b' to the mode argument) return contents as bytes objects without any decoding. In text mode (the default, or when 't' is appended to the mode argument), the contents of the file are returned as strings, the bytes having been first decoded using a platform-dependent encoding or using the specified encoding if given. 'U' mode is deprecated and will raise an exception in future versions of Python. It has no effect in Python 3. Use newline to control universal newlines mode. buffering is an optional integer used to set the buffering policy. Pass 0 to switch buffering off (only allowed in binary mode), 1 to select line buffering (only usable in text mode), and an integer > 1 to indicate the size of a fixed-size chunk buffer. When no buffering argument is given, the default buffering policy works as follows: * Binary files are buffered in fixed-size chunks; the size of the buffer is chosen using a heuristic trying to determine the underlying device's "block size" and falling back on `io.DEFAULT_BUFFER_SIZE`. On many systems, the buffer will typically be 4096 or 8192 bytes long. * "Interactive" text files (files for which isatty() returns True) use line buffering. Other text files use the policy described above for binary files. encoding is the str name of the encoding used to decode or encode the file. This should only be used in text mode. The default encoding is platform dependent, but any encoding supported by Python can be passed. See the codecs module for the list of supported encodings. errors is an optional string that specifies how encoding errors are to be handled---this argument should not be used in binary mode. Pass 'strict' to raise a ValueError exception if there is an encoding error (the default of None has the same effect), or pass 'ignore' to ignore errors. (Note that ignoring encoding errors can lead to data loss.) See the documentation for codecs.register for a list of the permitted encoding error strings. newline is a string controlling how universal newlines works (it only applies to text mode). It can be None, '', '\n', '\r', and '\r\n'. It works as follows: * On input, if newline is None, universal newlines mode is enabled. Lines in the input can end in '\n', '\r', or '\r\n', and these are translated into '\n' before being returned to the caller. If it is '', universal newline mode is enabled, but line endings are returned to the caller untranslated. If it has any of the other legal values, input lines are only terminated by the given string, and the line ending is returned to the caller untranslated. * On output, if newline is None, any '\n' characters written are translated to the system default line separator, os.linesep. If newline is '', no translation takes place. If newline is any of the other legal values, any '\n' characters written are translated to the given string. closedfd is a bool. If closefd is False, the underlying file descriptor will be kept open when the file is closed. This does not work when a file name is given and must be True in that case. The newly created file is non-inheritable. A custom opener can be used by passing a callable as *opener*. The underlying file descriptor for the file object is then obtained by calling *opener* with (*file*, *flags*). *opener* must return an open file descriptor (passing os.open as *opener* results in functionality similar to passing None). open() returns a file object whose type depends on the mode, and through which the standard file operations such as reading and writing are performed. When open() is used to open a file in a text mode ('w', 'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open a file in a binary mode, the returned class varies: in read binary mode, it returns a BufferedReader; in write binary and append binary modes, it returns a BufferedWriter, and in read/write mode, it returns a BufferedRandom. It is also possible to use a string or bytearray as a file for both reading and writing. For strings StringIO can be used like a file opened in a text mode, and for bytes a BytesIO can be used like a file opened in a binary mode. zinvalid file: %rzinvalid mode: %rzinvalid buffering: %rNzinvalid encoding: %rzinvalid errors: %rzaxrwb+tUxr wa+tbUz$can't use U and writing mode at oncerz'U' mode is deprecatedrTz'can't have text and binary mode at oncerz)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 argumentopenerFzinvalid buffering sizezcan't have unbuffered text I/Ozunknown mode: %r) isinstancestrbytesint TypeErrorsetlen ValueErrorwarningswarnDeprecationWarningFileIOisattyDEFAULT_BUFFER_SIZEosfstatfileno st_blksizeOSErrorAttributeErrorBufferedRandomBufferedWriterBufferedReader TextIOWrappermodeclose)filer. bufferingencodingerrorsnewlineclosefdrZmodesZcreatingZreadingZwritingZ appendingZupdatingtextZbinaryrrawresultline_bufferingZbsbufferr;*/opt/alt/python34/lib64/python3.4/_pyio.pyopen"s{ (             ?$        r=c@s"eZdZdZddZdS) DocDescriptorz%Helper for builtins.open.__doc__ cCs dtjS)Nz\open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True) )r=__doc__)selfobjtypr;r;r<__get__szDocDescriptor.__get__N)__name__ __module__ __qualname__r?rCr;r;r;r<r>s r>c@s+eZdZdZeZddZdS) OpenWrapperzWrapper for builtins.open Trick so that open won't become a bound method when stored as a class variable (as dbm.dumb does). See initstdio() in Python/pythonrun.c. cOs t||S)N)r=)clsargskwargsr;r;r<__new__szOpenWrapper.__new__N)rDrErFr?r>rKr;r;r;r<rGs  rGc@seZdZdS)UnsupportedOperationN)rDrErFr;r;r;r<rLs rLc@sZeZdZdZddZdddZddZd d d Zd d ZdZ ddZ ddZ ddZ d ddZ ddZd ddZddZd ddZedd Zd d!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd6d,d-Zd.d/Zd0d1Zd d2d3Zd4d5Zd S)7IOBasea-The abstract base class for all I/O classes, acting on streams of bytes. There is no public constructor. This class provides dummy implementations for many methods that derived classes can override selectively; the default implementations represent a file that cannot be read, written or seeked. Even though IOBase does not declare read, readinto, or write because their signatures will vary, implementations and clients should consider those methods part of the interface. Also, implementations may raise UnsupportedOperation when operations they do not support are called. The basic type used for binary data read from or written to a file is bytes. bytearrays are accepted too, and in some cases (such as readinto) needed. Text I/O classes work with str data. Note that calling any method (even inquiries) on a closed stream is undefined. Implementations may raise OSError in this case. IOBase (and its subclasses) support the iterator protocol, meaning that an IOBase object can be iterated over yielding the lines in a stream. IOBase also supports the :keyword:`with` statement. In this example, fp is closed after the suite of the with statement is complete: with open('spam.txt', 'r') as fp: fp.write('Spam and eggs!') cCs td|jj|fdS)z@Internal: raise an OSError exception for unsupported operations.z%s.%s() not supportedN)rL __class__rD)r@namer;r;r< _unsupported7szIOBase._unsupportedrcCs|jddS)a$Change stream position. Change the stream position to byte offset pos. Argument pos is interpreted relative to the position indicated by whence. Values for whence are ints: * 0 -- start of stream (the default); offset should be zero or positive * 1 -- current stream position; offset may be negative * 2 -- end of stream; offset is usually negative Some operating systems / file systems could provide additional values. Return an int indicating the new absolute position. seekN)rP)r@poswhencer;r;r<rQ>sz IOBase.seekcCs|jddS)z5Return an int indicating the current stream position.rr)rQ)r@r;r;r<tellNsz IOBase.tellNcCs|jddS)zTruncate file to size bytes. Size defaults to the current IO position as reported by tell(). Return the new size. truncateN)rP)r@rRr;r;r<rURszIOBase.truncatecCs|jdS)zuFlush write buffers, if applicable. This is not implemented for read-only and non-blocking streams. N) _checkClosed)r@r;r;r<flush\sz IOBase.flushFc Cs+|js'z|jWdd|_XndS)ziFlush and close the IO object. This method has no effect if the file is already closed. NT)_IOBase__closedrW)r@r;r;r<r/fs z IOBase.closec Csy|jWnYnXdS)zDestructor. Calls close().N)r/)r@r;r;r<__del__qszIOBase.__del__cCsdS)zReturn a bool indicating whether object supports random access. If False, seek(), tell() and truncate() will raise UnsupportedOperation. This method may need to do a test seek(). Fr;)r@r;r;r<seekableszIOBase.seekablecCs1|js-t|dkr!dn|ndS)zEInternal: raise UnsupportedOperation if file is not seekable NzFile or stream is not seekable.)rZrL)r@msgr;r;r<_checkSeekables zIOBase._checkSeekablecCsdS)zReturn a bool indicating whether object was opened for reading. If False, read() will raise UnsupportedOperation. Fr;)r@r;r;r<readableszIOBase.readablecCs1|js-t|dkr!dn|ndS)zEInternal: raise UnsupportedOperation if file is not readable NzFile or stream is not readable.)r]rL)r@r[r;r;r<_checkReadables zIOBase._checkReadablecCsdS)zReturn a bool indicating whether object was opened for writing. If False, write() and truncate() will raise UnsupportedOperation. Fr;)r@r;r;r<writableszIOBase.writablecCs1|js-t|dkr!dn|ndS)zEInternal: raise UnsupportedOperation if file is not writable NzFile or stream is not writable.)r_rL)r@r[r;r;r<_checkWritables zIOBase._checkWritablecCs|jS)zclosed: bool. True iff the file has been closed. For backwards compatibility, this is a property, not a predicate. )rX)r@r;r;r<closedsz IOBase.closedcCs.|jr*t|dkrdn|ndS)z8Internal: raise an ValueError if file is closed NzI/O operation on closed file.)rar)r@r[r;r;r<rVs zIOBase._checkClosedcCs|j|S)zCContext management protocol. Returns self (an instance of IOBase).)rV)r@r;r;r< __enter__s zIOBase.__enter__cGs|jdS)z+Context management protocol. Calls close()N)r/)r@rIr;r;r<__exit__szIOBase.__exit__cCs|jddS)zReturns underlying file descriptor (an int) if one exists. An OSError is raised if the IO object does not use a file descriptor. r&N)rP)r@r;r;r<r&sz IOBase.filenocCs|jdS)z{Return a bool indicating whether this is an 'interactive' stream. Return False if it can't be determined. F)rV)r@r;r;r<r"s z IOBase.isattyrcstdr'fdd}n dd}dkrHd nttsftdnt}x[dkst|krj|}|sPn||7}|jd rrPqrqrWt|S) aNRead and return a line of bytes from the stream. If size is specified, at most size bytes will be read. Size should be an int. The line terminator is always b'\n' for binary files; for text files, the newlines argument to open can be used to select the line terminator(s) recognized. peekcsZjd}|sdS|jddp5t|}dkrVt|}n|S)Nrs r)rdfindrmin)Z readaheadn)r@sizer;r< nreadaheads z#IOBase.readline..nreadaheadcSsdS)Nrr;r;r;r;r<risNrzsize must be an integerrs r) hasattrrrr bytearrayrreadendswithr)r@rhriresrr;)r@rhr<readlines     ! zIOBase.readlinecCs|j|S)N)rV)r@r;r;r<__iter__s zIOBase.__iter__cCs|j}|stn|S)N)ro StopIteration)r@liner;r;r<__next__s  zIOBase.__next__cCsp|dks|dkr"t|Sd}g}x;|D]3}|j||t|7}||kr5Pq5q5W|S)zReturn a list of lines from the stream. hint can be specified to control the number of lines read: no more lines will be read if the total size (in bytes/characters) of all lines so far exceeds hint. Nr)listappendr)r@Zhintrglinesrrr;r;r< readliness    zIOBase.readlinescCs,|jx|D]}|j|qWdS)N)rVwrite)r@rvrrr;r;r< writeliness  zIOBase.writelinesr)rDrErFr?rPrQrTrUrWrXr/rYrZr\r]r^r_r`propertyrarVrbrcr&r"rorprsrwryr;r;r;r<rMs4            %  rM metaclassc@sIeZdZdZd ddZddZddZd d Zd S) RawIOBasezBase class for raw binary I/O.rcCss|dkrd}n|dkr+|jSt|j}|j|}|dkr\dS||d=t|S)zRead and return up to size bytes, where size is an int. Returns an empty bytes object on EOF, or None if the object is set not to block and has no data to read. Nrrr)readallrk __index__readintor)r@rhrrgr;r;r<rl0s      zRawIOBase.readcCsKt}x'|jt}|s%Pn||7}q W|rCt|S|SdS)z+Read until EOF, using multiple read() call.N)rkrlr#r)r@rndatar;r;r<r}As  zRawIOBase.readallcCs|jddS)zRead up to len(b) bytes into bytearray b. Returns an int representing the number of bytes read (0 for EOF), or None if the object is set not to block and has no data to read. rN)rP)r@rr;r;r<rOszRawIOBase.readintocCs|jddS)z~Write the given buffer to the IO stream. Returns the number of bytes written, which may be less than len(b). rxN)rP)r@rr;r;r<rxWszRawIOBase.writeNr)rDrErFr?rlr}rrxr;r;r;r<r|"s    r|)r!c@sXeZdZdZdddZdddZddZd d Zd d ZdS) BufferedIOBaseaBase class for buffered IO objects. The main difference with RawIOBase is that the read() method supports omitting the size argument, and does not have a default implementation that defers to readinto(). In addition, read(), readinto() and write() may raise BlockingIOError if the underlying raw stream is in non-blocking mode and not ready; unlike their raw counterparts, they will never return None. A typical implementation should not inherit from a RawIOBase implementation, but wrap one. NcCs|jddS)aRead and return up to size bytes, where size is an int. If the argument is omitted, None, or negative, reads and returns all data until EOF. If the argument is positive, and the underlying raw stream is not 'interactive', multiple raw reads may be issued to satisfy the byte count (unless EOF is reached first). But for interactive raw streams (XXX and for pipes?), at most one raw read will be issued, and a short result does not imply that EOF is imminent. Returns an empty bytes array on EOF. Raises BlockingIOError if the underlying raw stream has no data at the moment. rlN)rP)r@rhr;r;r<rltszBufferedIOBase.readcCs|jddS)zaRead up to size bytes with at most one read() system call, where size is an int. read1N)rP)r@rhr;r;r<rszBufferedIOBase.read1cCs|jt|}t|}y||d||jdkrtdn|j|j}d|_|S)Nzraw stream already detached)r7rrWr)r@r7r;r;r<rs    z_BufferedIOMixin.detachcCs |jjS)N)r7rZ)r@r;r;r<rZsz_BufferedIOMixin.seekablecCs |jjS)N)r7r])r@r;r;r<r]sz_BufferedIOMixin.readablecCs |jjS)N)r7r_)r@r;r;r<r_sz_BufferedIOMixin.writablecCs|jS)N)r)r@r;r;r<r7sz_BufferedIOMixin.rawcCs |jjS)N)r7ra)r@r;r;r<rasz_BufferedIOMixin.closedcCs |jjS)N)r7rO)r@r;r;r<rO sz_BufferedIOMixin.namecCs |jjS)N)r7r.)r@r;r;r<r.sz_BufferedIOMixin.modecCstdj|jjdS)Nz can not serialize a '{0}' object)rformatrNrD)r@r;r;r< __getstate__s z_BufferedIOMixin.__getstate__c CsO|jj}y |j}Wntk r:dj|SYnXdj||SdS)Nz <_pyio.{0}>z<_pyio.{0} name={1!r}>)rNrDrO Exceptionr)r@ZclsnamerOr;r;r<__repr__s    z_BufferedIOMixin.__repr__cCs |jjS)N)r7r&)r@r;r;r<r&#sz_BufferedIOMixin.filenocCs |jjS)N)r7r")r@r;r;r<r"&sz_BufferedIOMixin.isatty)rDrErFr?rrQrTrUrWr/rrZr]r_rzr7rarOr.rrr&r"r;r;r;r<rs&          rcseZdZdZdddZddZddZd d Zfd d Zdd dZ ddZ ddZ dddZ ddZ dddZddZddZddZS) BytesIOzt|j|j}||8}|jd|j|_t |j |j |nWYdd}~XqTXn|SWdQXdS)Nzwrite to closed filez can't write str to binary stream)rarrrrrrrr_flush_unlockedextendBlockingIOErrorerrnostrerror)r@rZbeforeZwritteneZoverager;r;r<rxSs(    1zBufferedWriter.writeNc CsL|j=|j|dkr2|jj}n|jj|SWdQXdS)N)rrr7rTrU)r@rRr;r;r<rUos    zBufferedWriter.truncatecCs|j|jWdQXdS)N)rr)r@r;r;r<rWvs zBufferedWriter.flushc Cs|jrtdnx|jry|jj|j}Wn2tk rTwYntk rqtdYnX|dkrttj ddn|t |jks|dkrt dn|jd|=qWdS)Nzflush of closed filezHself.raw should implement RawIOBase: it should not raise BlockingIOErrorz)write could not complete without blockingrz*write() returned incorrect number of bytes) rarrr7rxrr RuntimeErrorrZEAGAINrr()r@rgr;r;r<rzs      !zBufferedWriter._flush_unlockedcCstj|t|jS)N)rrTrr)r@r;r;r<rTszBufferedWriter.tellrc CsL|tkrtdn|j"|jtj|||SWdQXdS)Nzinvalid whence value)rrrrrrQ)r@rRrSr;r;r<rQs    zBufferedWriter.seek) rDrErFr?r#rrxrUrWrrTrQr;r;r;r<r+?s     r+c@seZdZdZeddZdddZddZd d Zd d d Z ddZ ddZ ddZ ddZ ddZddZeddZdS)BufferedRWPairaA buffered reader and writer object together. A buffered reader object and buffered writer object put together to form a sequential IO object that can read and write. This is typically used with a socket or two-way pipe. reader and writer are RawIOBase objects that are readable and writeable respectively. If the buffer_size is omitted it defaults to DEFAULT_BUFFER_SIZE. cCs^|jstdn|js6tdnt|||_t|||_dS)zEConstructor. The arguments are two RawIO instances. z#"reader" argument must be readable.z#"writer" argument must be writable.N)r]r(r_r,readerr+writer)r@rrrr;r;r<rs   zBufferedRWPair.__init__NcCs%|dkrd}n|jj|S)Nrr)rrl)r@rhr;r;r<rls  zBufferedRWPair.readcCs|jj|S)N)rr)r@rr;r;r<rszBufferedRWPair.readintocCs|jj|S)N)rrx)r@rr;r;r<rxszBufferedRWPair.writercCs|jj|S)N)rrd)r@rhr;r;r<rdszBufferedRWPair.peekcCs|jj|S)N)rr)r@rhr;r;r<rszBufferedRWPair.read1cCs |jjS)N)rr])r@r;r;r<r]szBufferedRWPair.readablecCs |jjS)N)rr_)r@r;r;r<r_szBufferedRWPair.writablecCs |jjS)N)rrW)r@r;r;r<rWszBufferedRWPair.flushc Cs&z|jjWd|jjXdS)N)rr/r)r@r;r;r<r/szBufferedRWPair.closecCs|jjp|jjS)N)rr"r)r@r;r;r<r"szBufferedRWPair.isattycCs |jjS)N)rra)r@r;r;r<raszBufferedRWPair.closed)rDrErFr?r#rrlrrxrdrr]r_rWr/r"rzrar;r;r;r<rs         rc@seZdZdZeddZdddZddZd d d Zd d d Z ddZ dddZ ddZ ddZ d S)r*zA buffered interface to random access streams. The constructor creates a reader and writer for a seekable stream, raw, given in the first argument. If the buffer_size is omitted it defaults to DEFAULT_BUFFER_SIZE. cCs4|jtj|||tj|||dS)N)r\r,rr+)r@r7rr;r;r<rs zBufferedRandom.__init__rcCs|tkrtdn|j|jrd|j(|jj|jt|jdWdQXn|jj||}|j|j WdQX|dkrt dn|S)Nzinvalid whence valuerrz seek() returned invalid position) rrrWrrr7rQrrrr()r@rRrSr;r;r<rQs    ,  zBufferedRandom.seekcCs'|jrtj|Stj|SdS)N)rr+rTr,)r@r;r;r<rTs  zBufferedRandom.tellNcCs+|dkr|j}ntj||S)N)rTr+rU)r@rRr;r;r<rUs zBufferedRandom.truncatecCs/|dkrd}n|jtj||S)Nrr)rWr,rl)r@rhr;r;r<rl s   zBufferedRandom.readcCs|jtj||S)N)rWr,r)r@rr;r;r<rs zBufferedRandom.readintocCs|jtj||S)N)rWr,rd)r@rhr;r;r<rds zBufferedRandom.peekcCs|jtj||S)N)rWr,r)r@rhr;r;r<rs zBufferedRandom.read1c CsY|jrI|j2|jj|jt|jd|jWdQXntj||S)Nr) rrr7rQrrrr+rx)r@rr;r;r<rxs   #zBufferedRandom.write)rDrErFr?r#rrQrTrUrlrrdrrxr;r;r;r<r*s    r*c@seZdZdZdddZddZddd Zd d Zd d Ze ddZ e ddZ e ddZ dS) TextIOBasezBase class for text I/O. This class provides a character and line based interface to stream I/O. There is no readinto method because Python's character strings are immutable. There is no public constructor. rcCs|jddS)zRead at most size characters from stream, where size is an int. Read from underlying buffer until we have size characters or we hit EOF. If size is negative or omitted, read until EOF. Returns a string. rlN)rP)r@rhr;r;r<rl-szTextIOBase.readcCs|jddS)z.Write string s to stream and returning an int.rxN)rP)r@sr;r;r<rx7szTextIOBase.writeNcCs|jddS)z*Truncate size to pos, where pos is an int.rUN)rP)r@rRr;r;r<rU;szTextIOBase.truncatecCs|jddS)z_Read until newline or EOF. Returns an empty string if EOF is hit immediately. roN)rP)r@r;r;r<ro?szTextIOBase.readlinecCs|jddS)z Separate the underlying buffer from the TextIOBase and return it. After the underlying buffer has been detached, the TextIO is in an unusable state. rN)rP)r@r;r;r<rFszTextIOBase.detachcCsdS)zSubclasses should override.Nr;)r@r;r;r<r2OszTextIOBase.encodingcCsdS)zLine endings translated so far. Only line endings translated during reading are considered. Subclasses should override. Nr;)r@r;r;r<newlinesTszTextIOBase.newlinescCsdS)zMError setting of the decoder or encoder. Subclasses should override.Nr;)r@r;r;r<r3^szTextIOBase.errorsr) rDrErFr?rlrxrUrorrzr2rr3r;r;r;r<r$s     rc@s|eZdZdZdddZdddZdd Zd d Zd d ZdZ dZ dZ e ddZ dS)IncrementalNewlineDecodera+Codec used when reading a file in universal newlines mode. It wraps another incremental decoder, translating \r\n and \r into \n. It also records the types of newlines encountered. When used with translate=False, it ensures that the newline sequence is returned in one piece. strictcCs>tjj|d|||_||_d|_d|_dS)Nr3rF)codecsIncrementalDecoderr translatedecoderseennl pendingcr)r@rrr3r;r;r<ros    z"IncrementalNewlineDecoder.__init__FcCs:|jdkr|}n|jj|d|}|jr[|sE|r[d|}d|_n|jdr| r|dd}d|_n|jd}|jd|}|jd|}|j|o|j|o|jB|o|jBO_|j r6|r|j dd}n|r6|j dd}q6n|S) Nfinal FrTz  r) rdecoderrmcountr_LF_CR_CRLFrreplace)r@inputroutputZcrlfZcrZlfr;r;r<rvs(    + z IncrementalNewlineDecoder.decodecCs]|jdkrd}d}n|jj\}}|dK}|jrS|dO}n||fS)Nrrr)rgetstater)r@rflagr;r;r<rs    z"IncrementalNewlineDecoder.getstatecCsO|\}}t|d@|_|jdk rK|jj||d?fndS)Nr)boolrrsetstate)r@staterrr;r;r<rs z"IncrementalNewlineDecoder.setstatecCs5d|_d|_|jdk r1|jjndS)NrF)rrrreset)r@r;r;r<rs  zIncrementalNewlineDecoder.resetrrc Cs d|jS) Nrr rrrrrrrrr)Nrrrrrrr)r)r@r;r;r<rsz"IncrementalNewlineDecoder.newlinesN)rDrErFr?rrrrrrrrrzrr;r;r;r<rhs   rc@seZdZdZdZdddddddZddZed d Zed d Z ed dZ eddZ ddZ ddZ ddZddZddZeddZeddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zdd+d,Zd-d.Zd/d0Zd1d1d1d1d2d3Zd4d5Zd6d7Zdd8d9Zd:d;Z d1d<d=Z!dd>d?Z"d@dAZ#ddBdCZ$edDdEZ%dS)Fr-aCharacter and line based layer over a BufferedIOBase object, buffer. encoding gives the name of the encoding that the stream will be decoded or encoded with. It defaults to locale.getpreferredencoding(False). errors determines the strictness of encoding and decoding (see the codecs.register) and defaults to "strict". newline can be None, '', '\n', '\r', or '\r\n'. It controls the handling of line endings. If it is None, universal newlines is enabled. With this enabled, on input, the lines endings '\n', '\r', or '\r\n' are translated to '\n' before being returned to the caller. Conversely, on output, '\n' is translated to the system default line separator, os.linesep. If newline is any other of its legal values, that newline becomes the newline when the file is read and it is returned untranslated. On output, '\n' is converted to the newline. If line_buffering is True, a call to flush is implied when a call to write contains a newline character. iNFc Cs|dk r8t|t r8tdt|fn|dkrZtd|fn|dkrytj|j}Wntt fk rYnX|dkryddl }Wnt k rd}YqX|j d }qnt|tstd |nt j|js3d }t||n|dkrHd }n"t|tsjtd |n||_||_||_||_| |_|dk|_||_|dk|_|ptj|_d|_d|_d|_d|_d|_|j j!|_"|_#t$|j d|_%d|_&|j"r|j'r|j j(} | dkry|j)j*dWqtk rYqXqndS)Nzillegal newline type: %rrrr zillegal newline value: %rrasciiFzinvalid encoding: %rzG%r is not a text encoding; use codecs.open() to handle arbitrary codecsrzinvalid errors: %rrg)Nrrrr)+rrrtyperr$device_encodingr&r)rLlocale ImportErrorgetpreferredencodingrlookup_is_text_encoding LookupErrorr_line_buffering _encoding_errors_readuniversal_readtranslate_readnl_writetranslatelinesep_writenl_encoder_decoder_decoded_chars_decoded_chars_used _snapshotr:rZ _seekable_tellingrj _has_read1 _b2cratior_rT _get_encoderr) r@r:r2r3r4r9Z write_throughrr[positionr;r;r<rs`                     zTextIOWrapper.__init__cCsd}y |j}Wntk r'YnX|dj|7}y |j}Wntk r\YnX|dj|7}|dj|jS)Nz<_pyio.TextIOWrapperz name={0!r}z mode={0!r}z encoding={0!r}>)rOrrr.r2)r@r8rOr.r;r;r<r s    zTextIOWrapper.__repr__cCs|jS)N)r)r@r;r;r<r20szTextIOWrapper.encodingcCs|jS)N)r)r@r;r;r<r34szTextIOWrapper.errorscCs|jS)N)r)r@r;r;r<r98szTextIOWrapper.line_bufferingcCs|jS)N)r)r@r;r;r<r:<szTextIOWrapper.buffercCs|jrtdn|jS)NzI/O operation on closed file.)rarr)r@r;r;r<rZ@s zTextIOWrapper.seekablecCs |jjS)N)r:r])r@r;r;r<r]EszTextIOWrapper.readablecCs |jjS)N)r:r_)r@r;r;r<r_HszTextIOWrapper.writablecCs|jj|j|_dS)N)r:rWrr)r@r;r;r<rWKs zTextIOWrapper.flushc Cs?|jdk r;|j r;z|jWd|jjXndS)N)r:rarWr/)r@r;r;r<r/OszTextIOWrapper.closecCs |jjS)N)r:ra)r@r;r;r<raVszTextIOWrapper.closedcCs |jjS)N)r:rO)r@r;r;r<rOZszTextIOWrapper.namecCs |jjS)N)r:r&)r@r;r;r<r&^szTextIOWrapper.filenocCs |jjS)N)r:r")r@r;r;r<r"aszTextIOWrapper.isattycCs"|jrtdnt|ts@td|jjnt|}|js^|j ogd|k}|r|jr|j dkr|j d|j }n|j p|j }|j|}|jj||j r|sd|kr|jnd|_|jr|jjn|S)zWrite data, where s is a strzwrite to closed filezcan't write %s to text streamrrN)rarrrrrNrDrrrrrrrencoder:rxrWrrr)r@rZlengthZhaslfencoderrr;r;r<rxds$     zTextIOWrapper.writecCs+tj|j}||j|_|jS)N)rgetincrementalencoderrrr)r@Z make_encoderr;r;r<rzszTextIOWrapper._get_encodercCsLtj|j}||j}|jr?t||j}n||_|S)N)rgetincrementaldecoderrrrrrr)r@Z make_decoderrr;r;r< _get_decoders   zTextIOWrapper._get_decodercCs||_d|_dS)zSet the _decoded_chars buffer.rN)rr)r@charsr;r;r<_set_decoded_charss z TextIOWrapper._set_decoded_charscCs[|j}|dkr+|j|d}n|j|||}|jt|7_|S)z'Advance into the _decoded_chars buffer.N)rrr)r@rgoffsetrr;r;r<_get_decoded_charss   z TextIOWrapper._get_decoded_charscCs1|j|krtdn|j|8_dS)z!Rewind the _decoded_chars buffer.z"rewind decoded_chars out of boundsN)rAssertionError)r@rgr;r;r<_rewind_decoded_charssz#TextIOWrapper._rewind_decoded_charscCs|jdkrtdn|jr?|jj\}}n|jr`|jj|j}n|jj|j}| }|jj ||}|j ||rt |t |j |_ n d|_ |jr|||f|_n| S)zQ Read and decode the next chunk of data from the BufferedReader. Nz no decoderg)rrrrrr:r _CHUNK_SIZErlrrrrrr)r@ dec_buffer dec_flags input_chunkeofZ decoded_charsr;r;r< _read_chunks      zTextIOWrapper._read_chunkrcCs*||d>B|d>B|d>Bt|d>BS)N@)r)r@rr bytes_to_feedneed_eof chars_to_skipr;r;r< _pack_cookieszTextIOWrapper._pack_cookiecCsgt|d\}}t|d\}}t|d\}}t|d\}}|||||fS)Nrrllll)divmod)r@Zbigintrestrrrr r r;r;r<_unpack_cookies zTextIOWrapper._unpack_cookiecCs|jstdn|js0tdn|j|jj}|j}|dksm|jdkr|j rt dn|S|j\}}|t |8}|j }|dkr|j ||S|j}z(t|j|}d}x|dkr|jd|ft |j|d|} | |kr|j\} } | sn| }|| 8}Pn|t | 8}d}q||8}|d}qWd}|jd|f||} |} |dkr|j | | Sd}d}d}xt|t |D]}|d7}|t |j|||d7}|j\}}| r||kr| |7} ||8}|dd} }}n||kr Pq q W|t |jddd 7}d}||krtd n|j | | |||SWd|j|XdS) Nz!underlying stream is not seekablez(telling position disabled by next() callzpending decoded textrrrrrTz'can't reconstruct logical file position)rrLrr(rWr:rTrrrrrrr rrrrrrange)r@rrrZ next_inputr Z saved_stateZ skip_bytesZ skip_backrgrd start_posZ start_flagsZ bytes_fedr Z chars_decodedirr;r;r<rTsv               '    zTextIOWrapper.tellcCs5|j|dkr%|j}n|jj|S)N)rWrTr:rU)r@rRr;r;r<rU=s  zTextIOWrapper.truncatecCs>|jdkrtdn|j|j}d|_|S)Nzbuffer is already detached)r:rrWr)r@r:r;r;r<rCs    zTextIOWrapper.detachc sfdd}jr*tdnjsBtdn|dkr~|dkritdnd}j}n|dkr|dkrtd njjjdd}jd d_ j rj j n|||S|dkr#td |fn|dkrEtd |fnjj |\}}}}} jj|jd d_ |dkrj rj j nUj s|s| r j pj _ j jd |f|d f_ n| rjj|} jj j| ||| f_ tj| krttdn| _n|||S)Nc sXyjpj}Wntk r-Yn'X|dkrJ|jdn |jdS)z9Reset the encoder (merely useful for proper BOM handling)rN)rrrrr)rr)r@r;r<_reset_encoderLs  z*TextIOWrapper.seek.._reset_encoderztell on closed filez!underlying stream is not seekablerrz#can't do nonzero cur-relative seeksrz#can't do nonzero end-relative seeksrzunsupported whence (%r)znegative seek position %rrz#can't restore logical file position)rarrrLrTrWr:rQrrrrrrrrlrrrr(r) r@ZcookierSrrrrrr r rr;)r@r<rQKs\                  zTextIOWrapper.seekcCs+|j|dkrd}n|jp1|j}y |jWn4tk ru}ztd|WYdd}~XnX|dkr|j|j|jj dd}|j dd|_ |Sd}|j|}xGt ||kr"| r"|j }||j|t |7}qW|SdS) Nrzan integer is requiredrrTrFr)r^rrr~r)rrrr:rlrrrr)r@rhrrr8rr;r;r<rls(    "     !zTextIOWrapper.readcCs=d|_|j}|s9d|_|j|_tn|S)NF)rrorrrq)r@rrr;r;r<rss     zTextIOWrapper.__next__cCs|jrtdn|dkr-d }nt|tsKtdn|j}d}|jss|jnd}}x|jr|j d|}|dkr|d}Pqt |}n|j r|j d|}|j d|}|d kr&|d krt |}q|d}Pq|d kr@|d}Pq||krZ|d}Pq||dkrx|d}Pq|d}Pn5|j |j }|dkr|t |j }Pn|dkrt ||kr|}Pnx|j r|jrPqqW|jr||j7}q|jdd|_|SqW|dkr^||kr^|}n|jt |||d|S) Nzread from closed filerzsize must be an integerrrrrrrrrr)rarrrrrrrrrerrrrrrrr)r@rhrrstartrRendposZnlposZcrposr;r;r<rosp                          zTextIOWrapper.readlinecCs|jr|jjSdS)N)rr)r@r;r;r<rszTextIOWrapper.newlines)&rDrErFr?rrrrzr2r3r9r:rZr]r_rWr/rarOr&r"rxrrrrrrr rrTrUrrQrlrsrorr;r;r;r<r-sH  E             *  c K Xr-csveZdZdZddfddZddZdd Zed d Zed d Z ddZ S)StringIOzText I/O implementation using an in-memory buffer. The initial_value argument sets the value of object. The newline argument is like the one of TextIOWrapper's constructor. rrcstt|jtddddd||dkrCd|_n|dk rt|tstdjt |j n|j ||j dndS) Nr2zutf-8r3 surrogatepassr4Fz*initial_value must be str or None, not {0}r) rrrrrrrrrrrDrxrQ)r@Z initial_valuer4)rNr;r<rs     zStringIO.__init__c Csj|j|jp|j}|j}|jz |j|jjddSWd|j|XdS)NrT) rWrrrrrr:rr)r@rZ old_stater;r;r<r,s    zStringIO.getvaluecCs tj|S)N)objectr)r@r;r;r<r6szStringIO.__repr__cCsdS)Nr;)r@r;r;r<r3;szStringIO.errorscCsdS)Nr;)r@r;r;r<r2?szStringIO.encodingcCs|jddS)Nr)rP)r@r;r;r<rCszStringIO.detach) rDrErFr?rrrrzr3r2rr;r;)rNr<rs  r)/r?r$abcrr_threadrrrZ _dummy_threadiorrrrrrjaddr Z SEEK_DATAr#rr=r>rGrLr)rr(ABCMetarMregisterr|_ior!rrrr,r+rr*rrrr-rr;r;r;r<s\      "      < Vn~YFFAUZ