com.googler.python 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/python3.6.2/lib/libcrypto.so.1.0.0 +0 -0
- package/python3.6.2/lib/libformw.so.5 +0 -0
- package/python3.6.2/lib/libformw.so.5.9 +0 -0
- package/python3.6.2/lib/libhistory.so.6 +0 -0
- package/python3.6.2/lib/libhistory.so.6.3 +0 -0
- package/python3.6.2/lib/libmenuw.so.5 +0 -0
- package/python3.6.2/lib/libmenuw.so.5.9 +0 -0
- package/python3.6.2/lib/libncursesw.so.5 +0 -0
- package/python3.6.2/lib/libncursesw.so.5.9 +0 -0
- package/python3.6.2/lib/libpanelw.so.5 +0 -0
- package/python3.6.2/lib/libpanelw.so.5.9 +0 -0
- package/python3.6.2/lib/libpython3.6m.so.1.0 +0 -0
- package/python3.6.2/lib/libpython3.so +0 -0
- package/python3.6.2/lib/libreadline.so.6 +0 -0
- package/python3.6.2/lib/libreadline.so.6.3 +0 -0
- package/python3.6.2/lib/libssl.so.1.0.0 +0 -0
- package/python3.6.2/lib/libtinfow.so.5 +0 -0
- package/python3.6.2/lib/libtinfow.so.5.9 +0 -0
- package/python3.6.2/lib/python3.6/__future__.py +140 -0
- package/python3.6.2/lib/python3.6/__phello__.foo.py +1 -0
- package/python3.6.2/lib/python3.6/_bootlocale.py +34 -0
- package/python3.6.2/lib/python3.6/_collections_abc.py +1008 -0
- package/python3.6.2/lib/python3.6/_compat_pickle.py +251 -0
- package/python3.6.2/lib/python3.6/_compression.py +152 -0
- package/python3.6.2/lib/python3.6/_dummy_thread.py +163 -0
- package/python3.6.2/lib/python3.6/_markupbase.py +395 -0
- package/python3.6.2/lib/python3.6/_osx_support.py +502 -0
- package/python3.6.2/lib/python3.6/_pydecimal.py +6449 -0
- package/python3.6.2/lib/python3.6/_pyio.py +2531 -0
- package/python3.6.2/lib/python3.6/_sitebuiltins.py +103 -0
- package/python3.6.2/lib/python3.6/_strptime.py +576 -0
- package/python3.6.2/lib/python3.6/_threading_local.py +246 -0
- package/python3.6.2/lib/python3.6/_weakrefset.py +196 -0
- package/python3.6.2/lib/python3.6/abc.py +248 -0
- package/python3.6.2/lib/python3.6/aifc.py +943 -0
- package/python3.6.2/lib/python3.6/antigravity.py +17 -0
- package/python3.6.2/lib/python3.6/argparse.py +2389 -0
- package/python3.6.2/lib/python3.6/ast.py +322 -0
- package/python3.6.2/lib/python3.6/asynchat.py +307 -0
- package/python3.6.2/lib/python3.6/asyncio/__init__.py +50 -0
- package/python3.6.2/lib/python3.6/asyncio/base_events.py +1474 -0
- package/python3.6.2/lib/python3.6/asyncio/base_futures.py +71 -0
- package/python3.6.2/lib/python3.6/asyncio/base_subprocess.py +293 -0
- package/python3.6.2/lib/python3.6/asyncio/base_tasks.py +76 -0
- package/python3.6.2/lib/python3.6/asyncio/compat.py +18 -0
- package/python3.6.2/lib/python3.6/asyncio/constants.py +12 -0
- package/python3.6.2/lib/python3.6/asyncio/coroutines.py +346 -0
- package/python3.6.2/lib/python3.6/asyncio/events.py +715 -0
- package/python3.6.2/lib/python3.6/asyncio/futures.py +439 -0
- package/python3.6.2/lib/python3.6/asyncio/locks.py +485 -0
- package/python3.6.2/lib/python3.6/asyncio/log.py +7 -0
- package/python3.6.2/lib/python3.6/asyncio/proactor_events.py +551 -0
- package/python3.6.2/lib/python3.6/asyncio/protocols.py +134 -0
- package/python3.6.2/lib/python3.6/asyncio/queues.py +259 -0
- package/python3.6.2/lib/python3.6/asyncio/selector_events.py +1141 -0
- package/python3.6.2/lib/python3.6/asyncio/sslproto.py +697 -0
- package/python3.6.2/lib/python3.6/asyncio/streams.py +701 -0
- package/python3.6.2/lib/python3.6/asyncio/subprocess.py +226 -0
- package/python3.6.2/lib/python3.6/asyncio/tasks.py +717 -0
- package/python3.6.2/lib/python3.6/asyncio/test_utils.py +519 -0
- package/python3.6.2/lib/python3.6/asyncio/transports.py +306 -0
- package/python3.6.2/lib/python3.6/asyncio/unix_events.py +1074 -0
- package/python3.6.2/lib/python3.6/asyncio/windows_events.py +779 -0
- package/python3.6.2/lib/python3.6/asyncio/windows_utils.py +224 -0
- package/python3.6.2/lib/python3.6/asyncore.py +645 -0
- package/python3.6.2/lib/python3.6/base64.py +602 -0
- package/python3.6.2/lib/python3.6/bdb.py +673 -0
- package/python3.6.2/lib/python3.6/binhex.py +479 -0
- package/python3.6.2/lib/python3.6/bisect.py +92 -0
- package/python3.6.2/lib/python3.6/bz2.py +361 -0
- package/python3.6.2/lib/python3.6/cProfile.py +160 -0
- package/python3.6.2/lib/python3.6/calendar.py +713 -0
- package/python3.6.2/lib/python3.6/cgi.py +1077 -0
- package/python3.6.2/lib/python3.6/cgitb.py +319 -0
- package/python3.6.2/lib/python3.6/chunk.py +169 -0
- package/python3.6.2/lib/python3.6/cmd.py +401 -0
- package/python3.6.2/lib/python3.6/code.py +314 -0
- package/python3.6.2/lib/python3.6/codecs.py +1113 -0
- package/python3.6.2/lib/python3.6/codeop.py +168 -0
- package/python3.6.2/lib/python3.6/collections/__init__.py +1244 -0
- package/python3.6.2/lib/python3.6/collections/abc.py +2 -0
- package/python3.6.2/lib/python3.6/colorsys.py +164 -0
- package/python3.6.2/lib/python3.6/compileall.py +295 -0
- package/python3.6.2/lib/python3.6/concurrent/__init__.py +1 -0
- package/python3.6.2/lib/python3.6/concurrent/futures/__init__.py +18 -0
- package/python3.6.2/lib/python3.6/concurrent/futures/_base.py +612 -0
- package/python3.6.2/lib/python3.6/concurrent/futures/process.py +515 -0
- package/python3.6.2/lib/python3.6/concurrent/futures/thread.py +153 -0
- package/python3.6.2/lib/python3.6/configparser.py +1342 -0
- package/python3.6.2/lib/python3.6/contextlib.py +384 -0
- package/python3.6.2/lib/python3.6/copy.py +313 -0
- package/python3.6.2/lib/python3.6/copyreg.py +206 -0
- package/python3.6.2/lib/python3.6/crypt.py +61 -0
- package/python3.6.2/lib/python3.6/csv.py +449 -0
- package/python3.6.2/lib/python3.6/ctypes/__init__.py +538 -0
- package/python3.6.2/lib/python3.6/ctypes/_endian.py +61 -0
- package/python3.6.2/lib/python3.6/ctypes/macholib/__init__.py +9 -0
- package/python3.6.2/lib/python3.6/ctypes/macholib/dyld.py +159 -0
- package/python3.6.2/lib/python3.6/ctypes/macholib/dylib.py +63 -0
- package/python3.6.2/lib/python3.6/ctypes/macholib/framework.py +65 -0
- package/python3.6.2/lib/python3.6/ctypes/test/__init__.py +14 -0
- package/python3.6.2/lib/python3.6/ctypes/test/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_anon.py +73 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_array_in_pointer.py +64 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_arrays.py +185 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_as_parameter.py +226 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_bitfields.py +290 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_buffers.py +64 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_bytes.py +65 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_byteswap.py +315 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_callbacks.py +293 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_cast.py +86 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_cfuncs.py +212 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_checkretval.py +36 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_delattr.py +21 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_errno.py +79 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_find.py +116 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_frombuffer.py +141 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_funcptr.py +132 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_functions.py +402 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_incomplete.py +42 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_init.py +40 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_internals.py +100 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_keeprefs.py +153 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_libc.py +33 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_loading.py +116 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_macholib.py +63 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_memfunctions.py +79 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_numbers.py +290 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_objects.py +67 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_parameters.py +207 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_pep3118.py +233 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_pickling.py +81 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_pointers.py +223 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_prototypes.py +222 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_python_api.py +89 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_random_things.py +74 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_refcounts.py +101 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_repr.py +29 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_returnfuncptrs.py +66 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_simplesubclasses.py +55 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_sizes.py +33 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_slicing.py +167 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_stringptr.py +77 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_strings.py +225 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_struct_fields.py +74 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_structures.py +491 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_unaligned_structures.py +45 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_unicode.py +56 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_values.py +100 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_varsize_struct.py +50 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_win32.py +147 -0
- package/python3.6.2/lib/python3.6/ctypes/test/test_wintypes.py +41 -0
- package/python3.6.2/lib/python3.6/ctypes/util.py +337 -0
- package/python3.6.2/lib/python3.6/ctypes/wintypes.py +202 -0
- package/python3.6.2/lib/python3.6/curses/__init__.py +101 -0
- package/python3.6.2/lib/python3.6/curses/ascii.py +99 -0
- package/python3.6.2/lib/python3.6/curses/has_key.py +192 -0
- package/python3.6.2/lib/python3.6/curses/panel.py +6 -0
- package/python3.6.2/lib/python3.6/curses/textpad.py +201 -0
- package/python3.6.2/lib/python3.6/datetime.py +2280 -0
- package/python3.6.2/lib/python3.6/dbm/__init__.py +188 -0
- package/python3.6.2/lib/python3.6/dbm/dumb.py +324 -0
- package/python3.6.2/lib/python3.6/dbm/gnu.py +3 -0
- package/python3.6.2/lib/python3.6/dbm/ndbm.py +3 -0
- package/python3.6.2/lib/python3.6/decimal.py +11 -0
- package/python3.6.2/lib/python3.6/difflib.py +2093 -0
- package/python3.6.2/lib/python3.6/dis.py +490 -0
- package/python3.6.2/lib/python3.6/distutils/__init__.py +13 -0
- package/python3.6.2/lib/python3.6/distutils/_msvccompiler.py +574 -0
- package/python3.6.2/lib/python3.6/distutils/archive_util.py +248 -0
- package/python3.6.2/lib/python3.6/distutils/bcppcompiler.py +393 -0
- package/python3.6.2/lib/python3.6/distutils/ccompiler.py +1115 -0
- package/python3.6.2/lib/python3.6/distutils/cmd.py +434 -0
- package/python3.6.2/lib/python3.6/distutils/command/__init__.py +31 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist.py +143 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist_dumb.py +123 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist_msi.py +741 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist_rpm.py +582 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist_wininst.py +365 -0
- package/python3.6.2/lib/python3.6/distutils/command/build.py +157 -0
- package/python3.6.2/lib/python3.6/distutils/command/build_clib.py +209 -0
- package/python3.6.2/lib/python3.6/distutils/command/build_ext.py +755 -0
- package/python3.6.2/lib/python3.6/distutils/command/build_py.py +416 -0
- package/python3.6.2/lib/python3.6/distutils/command/build_scripts.py +160 -0
- package/python3.6.2/lib/python3.6/distutils/command/check.py +145 -0
- package/python3.6.2/lib/python3.6/distutils/command/clean.py +76 -0
- package/python3.6.2/lib/python3.6/distutils/command/config.py +347 -0
- package/python3.6.2/lib/python3.6/distutils/command/install.py +656 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_data.py +79 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_egg_info.py +77 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_headers.py +47 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_lib.py +217 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_scripts.py +60 -0
- package/python3.6.2/lib/python3.6/distutils/command/register.py +304 -0
- package/python3.6.2/lib/python3.6/distutils/command/sdist.py +456 -0
- package/python3.6.2/lib/python3.6/distutils/command/upload.py +201 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-10.0-amd64.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-10.0.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-14.0-amd64.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-14.0.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-6.0.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-7.1.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-8.0.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-9.0-amd64.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-9.0.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/config.py +131 -0
- package/python3.6.2/lib/python3.6/distutils/core.py +234 -0
- package/python3.6.2/lib/python3.6/distutils/cygwinccompiler.py +405 -0
- package/python3.6.2/lib/python3.6/distutils/debug.py +5 -0
- package/python3.6.2/lib/python3.6/distutils/dep_util.py +92 -0
- package/python3.6.2/lib/python3.6/distutils/dir_util.py +210 -0
- package/python3.6.2/lib/python3.6/distutils/dist.py +1236 -0
- package/python3.6.2/lib/python3.6/distutils/errors.py +97 -0
- package/python3.6.2/lib/python3.6/distutils/extension.py +240 -0
- package/python3.6.2/lib/python3.6/distutils/fancy_getopt.py +457 -0
- package/python3.6.2/lib/python3.6/distutils/file_util.py +238 -0
- package/python3.6.2/lib/python3.6/distutils/filelist.py +327 -0
- package/python3.6.2/lib/python3.6/distutils/log.py +75 -0
- package/python3.6.2/lib/python3.6/distutils/msvc9compiler.py +791 -0
- package/python3.6.2/lib/python3.6/distutils/msvccompiler.py +643 -0
- package/python3.6.2/lib/python3.6/distutils/spawn.py +192 -0
- package/python3.6.2/lib/python3.6/distutils/sysconfig.py +532 -0
- package/python3.6.2/lib/python3.6/distutils/tests/Setup.sample +67 -0
- package/python3.6.2/lib/python3.6/distutils/tests/__init__.py +36 -0
- package/python3.6.2/lib/python3.6/distutils/tests/support.py +210 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_archive_util.py +395 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_bdist.py +50 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_bdist_dumb.py +97 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_bdist_msi.py +25 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_bdist_rpm.py +135 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_bdist_wininst.py +31 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_build.py +56 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_build_clib.py +135 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_build_ext.py +521 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_build_py.py +179 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_build_scripts.py +112 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_check.py +149 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_clean.py +49 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_cmd.py +126 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_config.py +140 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_config_cmd.py +92 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_core.py +140 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_cygwinccompiler.py +154 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_dep_util.py +80 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_dir_util.py +139 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_dist.py +456 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_extension.py +69 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_file_util.py +114 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_filelist.py +340 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_install.py +248 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_install_data.py +75 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_install_headers.py +39 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_install_lib.py +115 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_install_scripts.py +82 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_log.py +38 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_msvc9compiler.py +184 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_msvccompiler.py +132 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_register.py +323 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_sdist.py +484 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_spawn.py +58 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_sysconfig.py +198 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_text_file.py +107 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_unixccompiler.py +149 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_upload.py +181 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_util.py +300 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_version.py +71 -0
- package/python3.6.2/lib/python3.6/distutils/tests/test_versionpredicate.py +13 -0
- package/python3.6.2/lib/python3.6/distutils/text_file.py +286 -0
- package/python3.6.2/lib/python3.6/distutils/unixccompiler.py +322 -0
- package/python3.6.2/lib/python3.6/distutils/util.py +557 -0
- package/python3.6.2/lib/python3.6/distutils/version.py +343 -0
- package/python3.6.2/lib/python3.6/distutils/versionpredicate.py +166 -0
- package/python3.6.2/lib/python3.6/doctest.py +2787 -0
- package/python3.6.2/lib/python3.6/dummy_threading.py +78 -0
- package/python3.6.2/lib/python3.6/email/__init__.py +62 -0
- package/python3.6.2/lib/python3.6/email/_encoded_words.py +221 -0
- package/python3.6.2/lib/python3.6/email/_header_value_parser.py +2811 -0
- package/python3.6.2/lib/python3.6/email/_parseaddr.py +540 -0
- package/python3.6.2/lib/python3.6/email/_policybase.py +374 -0
- package/python3.6.2/lib/python3.6/email/base64mime.py +119 -0
- package/python3.6.2/lib/python3.6/email/charset.py +406 -0
- package/python3.6.2/lib/python3.6/email/contentmanager.py +250 -0
- package/python3.6.2/lib/python3.6/email/encoders.py +69 -0
- package/python3.6.2/lib/python3.6/email/errors.py +107 -0
- package/python3.6.2/lib/python3.6/email/feedparser.py +536 -0
- package/python3.6.2/lib/python3.6/email/generator.py +508 -0
- package/python3.6.2/lib/python3.6/email/header.py +578 -0
- package/python3.6.2/lib/python3.6/email/headerregistry.py +589 -0
- package/python3.6.2/lib/python3.6/email/iterators.py +71 -0
- package/python3.6.2/lib/python3.6/email/message.py +1164 -0
- package/python3.6.2/lib/python3.6/email/mime/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/email/mime/application.py +37 -0
- package/python3.6.2/lib/python3.6/email/mime/audio.py +74 -0
- package/python3.6.2/lib/python3.6/email/mime/base.py +30 -0
- package/python3.6.2/lib/python3.6/email/mime/image.py +47 -0
- package/python3.6.2/lib/python3.6/email/mime/message.py +34 -0
- package/python3.6.2/lib/python3.6/email/mime/multipart.py +48 -0
- package/python3.6.2/lib/python3.6/email/mime/nonmultipart.py +22 -0
- package/python3.6.2/lib/python3.6/email/mime/text.py +42 -0
- package/python3.6.2/lib/python3.6/email/parser.py +132 -0
- package/python3.6.2/lib/python3.6/email/policy.py +223 -0
- package/python3.6.2/lib/python3.6/email/quoprimime.py +299 -0
- package/python3.6.2/lib/python3.6/email/utils.py +388 -0
- package/python3.6.2/lib/python3.6/encodings/__init__.py +169 -0
- package/python3.6.2/lib/python3.6/encodings/aliases.py +550 -0
- package/python3.6.2/lib/python3.6/encodings/ascii.py +50 -0
- package/python3.6.2/lib/python3.6/encodings/base64_codec.py +55 -0
- package/python3.6.2/lib/python3.6/encodings/big5.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/big5hkscs.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/bz2_codec.py +78 -0
- package/python3.6.2/lib/python3.6/encodings/charmap.py +69 -0
- package/python3.6.2/lib/python3.6/encodings/cp037.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp1006.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp1026.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp1125.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp1140.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp1250.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp1251.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp1252.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp1253.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp1254.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp1255.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp1256.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp1257.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp1258.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp273.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp424.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp437.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp500.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp65001.py +43 -0
- package/python3.6.2/lib/python3.6/encodings/cp720.py +309 -0
- package/python3.6.2/lib/python3.6/encodings/cp737.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp775.py +697 -0
- package/python3.6.2/lib/python3.6/encodings/cp850.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp852.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp855.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp856.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp857.py +694 -0
- package/python3.6.2/lib/python3.6/encodings/cp858.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp860.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp861.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp862.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp863.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp864.py +690 -0
- package/python3.6.2/lib/python3.6/encodings/cp865.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp866.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/cp869.py +689 -0
- package/python3.6.2/lib/python3.6/encodings/cp874.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp875.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/cp932.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/cp949.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/cp950.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/euc_jis_2004.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/euc_jisx0213.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/euc_jp.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/euc_kr.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/gb18030.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/gb2312.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/gbk.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/hex_codec.py +55 -0
- package/python3.6.2/lib/python3.6/encodings/hp_roman8.py +314 -0
- package/python3.6.2/lib/python3.6/encodings/hz.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/idna.py +309 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_1.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_2.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_2004.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_3.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_ext.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_kr.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_1.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_10.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_11.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_13.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_14.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_15.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_16.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_2.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_3.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_4.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_5.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_6.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_7.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_8.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_9.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/johab.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/koi8_r.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/koi8_t.py +308 -0
- package/python3.6.2/lib/python3.6/encodings/koi8_u.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/kz1048.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/latin_1.py +50 -0
- package/python3.6.2/lib/python3.6/encodings/mac_arabic.py +698 -0
- package/python3.6.2/lib/python3.6/encodings/mac_centeuro.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/mac_croatian.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/mac_cyrillic.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/mac_farsi.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/mac_greek.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/mac_iceland.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/mac_latin2.py +312 -0
- package/python3.6.2/lib/python3.6/encodings/mac_roman.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/mac_romanian.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/mac_turkish.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/mbcs.py +47 -0
- package/python3.6.2/lib/python3.6/encodings/oem.py +41 -0
- package/python3.6.2/lib/python3.6/encodings/palmos.py +308 -0
- package/python3.6.2/lib/python3.6/encodings/ptcp154.py +312 -0
- package/python3.6.2/lib/python3.6/encodings/punycode.py +237 -0
- package/python3.6.2/lib/python3.6/encodings/quopri_codec.py +56 -0
- package/python3.6.2/lib/python3.6/encodings/raw_unicode_escape.py +45 -0
- package/python3.6.2/lib/python3.6/encodings/rot_13.py +113 -0
- package/python3.6.2/lib/python3.6/encodings/shift_jis.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/shift_jis_2004.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/shift_jisx0213.py +39 -0
- package/python3.6.2/lib/python3.6/encodings/tis_620.py +307 -0
- package/python3.6.2/lib/python3.6/encodings/undefined.py +49 -0
- package/python3.6.2/lib/python3.6/encodings/unicode_escape.py +45 -0
- package/python3.6.2/lib/python3.6/encodings/unicode_internal.py +45 -0
- package/python3.6.2/lib/python3.6/encodings/utf_16.py +155 -0
- package/python3.6.2/lib/python3.6/encodings/utf_16_be.py +42 -0
- package/python3.6.2/lib/python3.6/encodings/utf_16_le.py +42 -0
- package/python3.6.2/lib/python3.6/encodings/utf_32.py +150 -0
- package/python3.6.2/lib/python3.6/encodings/utf_32_be.py +37 -0
- package/python3.6.2/lib/python3.6/encodings/utf_32_le.py +37 -0
- package/python3.6.2/lib/python3.6/encodings/utf_7.py +38 -0
- package/python3.6.2/lib/python3.6/encodings/utf_8.py +42 -0
- package/python3.6.2/lib/python3.6/encodings/utf_8_sig.py +130 -0
- package/python3.6.2/lib/python3.6/encodings/uu_codec.py +99 -0
- package/python3.6.2/lib/python3.6/encodings/zlib_codec.py +77 -0
- package/python3.6.2/lib/python3.6/ensurepip/__init__.py +205 -0
- package/python3.6.2/lib/python3.6/ensurepip/__main__.py +5 -0
- package/python3.6.2/lib/python3.6/ensurepip/_uninstall.py +31 -0
- package/python3.6.2/lib/python3.6/enum.py +875 -0
- package/python3.6.2/lib/python3.6/filecmp.py +305 -0
- package/python3.6.2/lib/python3.6/fileinput.py +425 -0
- package/python3.6.2/lib/python3.6/fnmatch.py +109 -0
- package/python3.6.2/lib/python3.6/formatter.py +452 -0
- package/python3.6.2/lib/python3.6/fractions.py +643 -0
- package/python3.6.2/lib/python3.6/ftplib.py +989 -0
- package/python3.6.2/lib/python3.6/functools.py +811 -0
- package/python3.6.2/lib/python3.6/genericpath.py +151 -0
- package/python3.6.2/lib/python3.6/getopt.py +215 -0
- package/python3.6.2/lib/python3.6/getpass.py +185 -0
- package/python3.6.2/lib/python3.6/gettext.py +637 -0
- package/python3.6.2/lib/python3.6/glob.py +171 -0
- package/python3.6.2/lib/python3.6/gzip.py +574 -0
- package/python3.6.2/lib/python3.6/hashlib.py +251 -0
- package/python3.6.2/lib/python3.6/heapq.py +607 -0
- package/python3.6.2/lib/python3.6/hmac.py +144 -0
- package/python3.6.2/lib/python3.6/html/__init__.py +132 -0
- package/python3.6.2/lib/python3.6/html/entities.py +2509 -0
- package/python3.6.2/lib/python3.6/html/parser.py +470 -0
- package/python3.6.2/lib/python3.6/http/__init__.py +134 -0
- package/python3.6.2/lib/python3.6/http/client.py +1478 -0
- package/python3.6.2/lib/python3.6/http/cookiejar.py +2098 -0
- package/python3.6.2/lib/python3.6/http/cookies.py +635 -0
- package/python3.6.2/lib/python3.6/http/server.py +1211 -0
- package/python3.6.2/lib/python3.6/idlelib/CREDITS.txt +37 -0
- package/python3.6.2/lib/python3.6/idlelib/ChangeLog +1591 -0
- package/python3.6.2/lib/python3.6/idlelib/HISTORY.txt +296 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/folder.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle.icns +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle.ico +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle_16.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle_16.png +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle_32.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle_32.png +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle_48.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle_48.png +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/minusnode.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/openfolder.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/plusnode.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/python.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/tk.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/NEWS.txt +749 -0
- package/python3.6.2/lib/python3.6/idlelib/NEWS2x.txt +660 -0
- package/python3.6.2/lib/python3.6/idlelib/README.txt +251 -0
- package/python3.6.2/lib/python3.6/idlelib/TODO.txt +210 -0
- package/python3.6.2/lib/python3.6/idlelib/__init__.py +10 -0
- package/python3.6.2/lib/python3.6/idlelib/__main__.py +8 -0
- package/python3.6.2/lib/python3.6/idlelib/_pyclbr.py +402 -0
- package/python3.6.2/lib/python3.6/idlelib/autocomplete.py +232 -0
- package/python3.6.2/lib/python3.6/idlelib/autocomplete_w.py +460 -0
- package/python3.6.2/lib/python3.6/idlelib/autoexpand.py +96 -0
- package/python3.6.2/lib/python3.6/idlelib/browser.py +248 -0
- package/python3.6.2/lib/python3.6/idlelib/calltip_w.py +164 -0
- package/python3.6.2/lib/python3.6/idlelib/calltips.py +178 -0
- package/python3.6.2/lib/python3.6/idlelib/codecontext.py +185 -0
- package/python3.6.2/lib/python3.6/idlelib/colorizer.py +289 -0
- package/python3.6.2/lib/python3.6/idlelib/config-extensions.def +65 -0
- package/python3.6.2/lib/python3.6/idlelib/config-highlight.def +93 -0
- package/python3.6.2/lib/python3.6/idlelib/config-keys.def +304 -0
- package/python3.6.2/lib/python3.6/idlelib/config-main.def +88 -0
- package/python3.6.2/lib/python3.6/idlelib/config.py +929 -0
- package/python3.6.2/lib/python3.6/idlelib/config_key.py +298 -0
- package/python3.6.2/lib/python3.6/idlelib/configdialog.py +2254 -0
- package/python3.6.2/lib/python3.6/idlelib/debugger.py +544 -0
- package/python3.6.2/lib/python3.6/idlelib/debugger_r.py +388 -0
- package/python3.6.2/lib/python3.6/idlelib/debugobj.py +139 -0
- package/python3.6.2/lib/python3.6/idlelib/debugobj_r.py +36 -0
- package/python3.6.2/lib/python3.6/idlelib/delegator.py +33 -0
- package/python3.6.2/lib/python3.6/idlelib/dynoption.py +58 -0
- package/python3.6.2/lib/python3.6/idlelib/editor.py +1688 -0
- package/python3.6.2/lib/python3.6/idlelib/extend.txt +83 -0
- package/python3.6.2/lib/python3.6/idlelib/filelist.py +132 -0
- package/python3.6.2/lib/python3.6/idlelib/grep.py +200 -0
- package/python3.6.2/lib/python3.6/idlelib/help.html +791 -0
- package/python3.6.2/lib/python3.6/idlelib/help.py +275 -0
- package/python3.6.2/lib/python3.6/idlelib/help_about.py +205 -0
- package/python3.6.2/lib/python3.6/idlelib/history.py +106 -0
- package/python3.6.2/lib/python3.6/idlelib/hyperparser.py +312 -0
- package/python3.6.2/lib/python3.6/idlelib/idle.bat +4 -0
- package/python3.6.2/lib/python3.6/idlelib/idle.py +14 -0
- package/python3.6.2/lib/python3.6/idlelib/idle.pyw +17 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/README.txt +226 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/__init__.py +17 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/htest.py +421 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/mock_idle.py +60 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/mock_tk.py +303 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_autocomplete.py +149 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_autoexpand.py +143 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_browser.py +253 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_calltips.py +203 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_colorizer.py +56 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_config.py +824 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_config_key.py +102 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_configdialog.py +1415 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_debugger.py +29 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_delegator.py +40 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_editmenu.py +74 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_editor.py +14 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_grep.py +80 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_help.py +34 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_help_about.py +177 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_history.py +168 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_hyperparser.py +274 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_iomenu.py +234 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_macosx.py +106 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_outwin.py +172 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_paragraph.py +376 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_parenmatch.py +112 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_pathbrowser.py +88 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_percolator.py +118 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_query.py +354 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_redirector.py +124 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_replace.py +293 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_rstrip.py +49 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_run.py +35 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_scrolledlist.py +29 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_search.py +82 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_searchbase.py +156 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_searchengine.py +329 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_text.py +236 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_textview.py +179 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_tree.py +35 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_undo.py +135 -0
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_warning.py +73 -0
- package/python3.6.2/lib/python3.6/idlelib/iomenu.py +574 -0
- package/python3.6.2/lib/python3.6/idlelib/macosx.py +252 -0
- package/python3.6.2/lib/python3.6/idlelib/mainmenu.py +108 -0
- package/python3.6.2/lib/python3.6/idlelib/multicall.py +445 -0
- package/python3.6.2/lib/python3.6/idlelib/outwin.py +188 -0
- package/python3.6.2/lib/python3.6/idlelib/paragraph.py +195 -0
- package/python3.6.2/lib/python3.6/idlelib/parenmatch.py +183 -0
- package/python3.6.2/lib/python3.6/idlelib/pathbrowser.py +111 -0
- package/python3.6.2/lib/python3.6/idlelib/percolator.py +104 -0
- package/python3.6.2/lib/python3.6/idlelib/pyparse.py +617 -0
- package/python3.6.2/lib/python3.6/idlelib/pyshell.py +1542 -0
- package/python3.6.2/lib/python3.6/idlelib/query.py +308 -0
- package/python3.6.2/lib/python3.6/idlelib/redirector.py +175 -0
- package/python3.6.2/lib/python3.6/idlelib/replace.py +243 -0
- package/python3.6.2/lib/python3.6/idlelib/rpc.py +627 -0
- package/python3.6.2/lib/python3.6/idlelib/rstrip.py +29 -0
- package/python3.6.2/lib/python3.6/idlelib/run.py +525 -0
- package/python3.6.2/lib/python3.6/idlelib/runscript.py +195 -0
- package/python3.6.2/lib/python3.6/idlelib/scrolledlist.py +147 -0
- package/python3.6.2/lib/python3.6/idlelib/search.py +102 -0
- package/python3.6.2/lib/python3.6/idlelib/searchbase.py +200 -0
- package/python3.6.2/lib/python3.6/idlelib/searchengine.py +236 -0
- package/python3.6.2/lib/python3.6/idlelib/stackviewer.py +152 -0
- package/python3.6.2/lib/python3.6/idlelib/statusbar.py +46 -0
- package/python3.6.2/lib/python3.6/idlelib/textview.py +136 -0
- package/python3.6.2/lib/python3.6/idlelib/tooltip.py +96 -0
- package/python3.6.2/lib/python3.6/idlelib/tree.py +467 -0
- package/python3.6.2/lib/python3.6/idlelib/undo.py +366 -0
- package/python3.6.2/lib/python3.6/idlelib/windows.py +92 -0
- package/python3.6.2/lib/python3.6/idlelib/zoomheight.py +48 -0
- package/python3.6.2/lib/python3.6/idlelib/zzdummy.py +42 -0
- package/python3.6.2/lib/python3.6/imaplib.py +1609 -0
- package/python3.6.2/lib/python3.6/imghdr.py +168 -0
- package/python3.6.2/lib/python3.6/imp.py +346 -0
- package/python3.6.2/lib/python3.6/importlib/__init__.py +173 -0
- package/python3.6.2/lib/python3.6/importlib/_bootstrap.py +1161 -0
- package/python3.6.2/lib/python3.6/importlib/_bootstrap_external.py +1443 -0
- package/python3.6.2/lib/python3.6/importlib/abc.py +329 -0
- package/python3.6.2/lib/python3.6/importlib/machinery.py +21 -0
- package/python3.6.2/lib/python3.6/importlib/util.py +288 -0
- package/python3.6.2/lib/python3.6/inspect.py +3098 -0
- package/python3.6.2/lib/python3.6/io.py +99 -0
- package/python3.6.2/lib/python3.6/ipaddress.py +2299 -0
- package/python3.6.2/lib/python3.6/json/__init__.py +367 -0
- package/python3.6.2/lib/python3.6/json/decoder.py +358 -0
- package/python3.6.2/lib/python3.6/json/encoder.py +441 -0
- package/python3.6.2/lib/python3.6/json/scanner.py +73 -0
- package/python3.6.2/lib/python3.6/json/tool.py +50 -0
- package/python3.6.2/lib/python3.6/keyword.py +94 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_asyncio.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_bisect.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_blake2.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_bz2.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_codecs_cn.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_codecs_hk.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_codecs_iso2022.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_codecs_jp.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_codecs_kr.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_codecs_tw.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_crypt.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_csv.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_ctypes.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_ctypes_test.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_curses.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_curses_panel.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_datetime.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_elementtree.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_hashlib.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_heapq.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_json.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_lsprof.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_md5.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_multibytecodec.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_multiprocessing.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_opcode.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_pickle.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_random.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_sha1.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_sha256.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_sha3.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_sha512.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_socket.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_sqlite3.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_ssl.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_struct.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_sysconfigdata_m_linux_arm-linux-androideabi.py +743 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_testbuffer.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_testcapi.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_testimportmultiple.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_testmultiphase.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/array.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/audioop.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/binascii.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/cmath.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/fcntl.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/grp.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/math.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/mmap.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/ossaudiodev.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/parser.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/pyexpat.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/readline.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/resource.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/select.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/syslog.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/termios.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/unicodedata.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/xxlimited.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/zlib.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/__init__.py +1 -0
- package/python3.6.2/lib/python3.6/lib2to3/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/lib2to3/btm_matcher.py +168 -0
- package/python3.6.2/lib/python3.6/lib2to3/btm_utils.py +281 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixer_base.py +186 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixer_util.py +453 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/__init__.py +1 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_apply.py +70 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_asserts.py +34 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_basestring.py +14 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_buffer.py +22 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_dict.py +106 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_except.py +93 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_exec.py +39 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_execfile.py +52 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_exitfunc.py +72 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_filter.py +90 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_funcattrs.py +21 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_future.py +22 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_getcwdu.py +19 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_has_key.py +109 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_idioms.py +152 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_import.py +99 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_imports.py +145 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_imports2.py +16 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_input.py +26 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_intern.py +41 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_isinstance.py +52 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_itertools.py +43 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_itertools_imports.py +57 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_long.py +19 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_map.py +110 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_metaclass.py +228 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_methodattrs.py +24 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_ne.py +23 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_next.py +103 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_nonzero.py +21 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_numliterals.py +28 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_operator.py +98 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_paren.py +44 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_print.py +87 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_raise.py +90 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_raw_input.py +17 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_reduce.py +35 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_reload.py +38 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_renames.py +70 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_repr.py +23 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_set_literal.py +53 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_standarderror.py +18 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_sys_exc.py +30 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_throw.py +56 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_tuple_params.py +175 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_types.py +61 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_unicode.py +42 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_urllib.py +196 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_ws_comma.py +39 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_xrange.py +73 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_xreadlines.py +25 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_zip.py +46 -0
- package/python3.6.2/lib/python3.6/lib2to3/main.py +268 -0
- package/python3.6.2/lib/python3.6/lib2to3/patcomp.py +205 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/__init__.py +4 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/conv.py +257 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/driver.py +160 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/grammar.py +207 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/literals.py +60 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/parse.py +201 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/pgen.py +386 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/token.py +85 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/tokenize.py +590 -0
- package/python3.6.2/lib/python3.6/lib2to3/pygram.py +40 -0
- package/python3.6.2/lib/python3.6/lib2to3/pytree.py +854 -0
- package/python3.6.2/lib/python3.6/lib2to3/refactor.py +744 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/__init__.py +9 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/README +6 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/bom.py +2 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/crlf.py +3 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/different_encoding.py +6 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/false_encoding.py +2 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/bad_order.py +5 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/myfixes/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/myfixes/fix_explicit.py +6 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/myfixes/fix_first.py +6 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/myfixes/fix_last.py +7 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/myfixes/fix_parrot.py +13 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/myfixes/fix_preorder.py +6 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/no_fixer_cls.py +1 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/parrot_example.py +2 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/infinite_recursion.py +2669 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/py2_test_grammar.py +974 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/py3_test_grammar.py +945 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/pytree_idempotency.py +94 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/support.py +52 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_all_fixers.py +27 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_fixers.py +4640 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_main.py +139 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_parser.py +472 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_pytree.py +472 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_refactor.py +316 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_util.py +591 -0
- package/python3.6.2/lib/python3.6/linecache.py +177 -0
- package/python3.6.2/lib/python3.6/locale.py +1684 -0
- package/python3.6.2/lib/python3.6/logging/__init__.py +2019 -0
- package/python3.6.2/lib/python3.6/logging/config.py +933 -0
- package/python3.6.2/lib/python3.6/logging/handlers.py +1505 -0
- package/python3.6.2/lib/python3.6/lzma.py +347 -0
- package/python3.6.2/lib/python3.6/macpath.py +211 -0
- package/python3.6.2/lib/python3.6/macurl2path.py +77 -0
- package/python3.6.2/lib/python3.6/mailbox.py +2146 -0
- package/python3.6.2/lib/python3.6/mailcap.py +275 -0
- package/python3.6.2/lib/python3.6/mimetypes.py +598 -0
- package/python3.6.2/lib/python3.6/modulefinder.py +633 -0
- package/python3.6.2/lib/python3.6/msilib/__init__.py +483 -0
- package/python3.6.2/lib/python3.6/msilib/schema.py +1007 -0
- package/python3.6.2/lib/python3.6/msilib/sequence.py +126 -0
- package/python3.6.2/lib/python3.6/msilib/text.py +129 -0
- package/python3.6.2/lib/python3.6/multiprocessing/__init__.py +38 -0
- package/python3.6.2/lib/python3.6/multiprocessing/connection.py +953 -0
- package/python3.6.2/lib/python3.6/multiprocessing/context.py +357 -0
- package/python3.6.2/lib/python3.6/multiprocessing/dummy/__init__.py +119 -0
- package/python3.6.2/lib/python3.6/multiprocessing/dummy/connection.py +73 -0
- package/python3.6.2/lib/python3.6/multiprocessing/forkserver.py +266 -0
- package/python3.6.2/lib/python3.6/multiprocessing/heap.py +254 -0
- package/python3.6.2/lib/python3.6/multiprocessing/managers.py +1160 -0
- package/python3.6.2/lib/python3.6/multiprocessing/pool.py +803 -0
- package/python3.6.2/lib/python3.6/multiprocessing/popen_fork.py +86 -0
- package/python3.6.2/lib/python3.6/multiprocessing/popen_forkserver.py +68 -0
- package/python3.6.2/lib/python3.6/multiprocessing/popen_spawn_posix.py +68 -0
- package/python3.6.2/lib/python3.6/multiprocessing/popen_spawn_win32.py +98 -0
- package/python3.6.2/lib/python3.6/multiprocessing/process.py +336 -0
- package/python3.6.2/lib/python3.6/multiprocessing/queues.py +347 -0
- package/python3.6.2/lib/python3.6/multiprocessing/reduction.py +274 -0
- package/python3.6.2/lib/python3.6/multiprocessing/resource_sharer.py +158 -0
- package/python3.6.2/lib/python3.6/multiprocessing/semaphore_tracker.py +157 -0
- package/python3.6.2/lib/python3.6/multiprocessing/sharedctypes.py +239 -0
- package/python3.6.2/lib/python3.6/multiprocessing/spawn.py +286 -0
- package/python3.6.2/lib/python3.6/multiprocessing/synchronize.py +406 -0
- package/python3.6.2/lib/python3.6/multiprocessing/util.py +406 -0
- package/python3.6.2/lib/python3.6/netrc.py +142 -0
- package/python3.6.2/lib/python3.6/nntplib.py +1147 -0
- package/python3.6.2/lib/python3.6/ntpath.py +692 -0
- package/python3.6.2/lib/python3.6/nturl2path.py +68 -0
- package/python3.6.2/lib/python3.6/numbers.py +389 -0
- package/python3.6.2/lib/python3.6/opcode.py +215 -0
- package/python3.6.2/lib/python3.6/operator.py +464 -0
- package/python3.6.2/lib/python3.6/optparse.py +1681 -0
- package/python3.6.2/lib/python3.6/os.py +1069 -0
- package/python3.6.2/lib/python3.6/pathlib.py +1434 -0
- package/python3.6.2/lib/python3.6/pdb.py +1694 -0
- package/python3.6.2/lib/python3.6/pickle.py +1605 -0
- package/python3.6.2/lib/python3.6/pickletools.py +2840 -0
- package/python3.6.2/lib/python3.6/pipes.py +247 -0
- package/python3.6.2/lib/python3.6/pkgutil.py +634 -0
- package/python3.6.2/lib/python3.6/platform.py +1400 -0
- package/python3.6.2/lib/python3.6/plistlib.py +1043 -0
- package/python3.6.2/lib/python3.6/poplib.py +478 -0
- package/python3.6.2/lib/python3.6/posixpath.py +520 -0
- package/python3.6.2/lib/python3.6/pprint.py +597 -0
- package/python3.6.2/lib/python3.6/profile.py +589 -0
- package/python3.6.2/lib/python3.6/pstats.py +697 -0
- package/python3.6.2/lib/python3.6/pty.py +170 -0
- package/python3.6.2/lib/python3.6/py_compile.py +186 -0
- package/python3.6.2/lib/python3.6/pyclbr.py +352 -0
- package/python3.6.2/lib/python3.6/pydoc.py +2663 -0
- package/python3.6.2/lib/python3.6/pydoc_data/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/pydoc_data/topics.py +12951 -0
- package/python3.6.2/lib/python3.6/queue.py +246 -0
- package/python3.6.2/lib/python3.6/quopri.py +242 -0
- package/python3.6.2/lib/python3.6/random.py +768 -0
- package/python3.6.2/lib/python3.6/re.py +381 -0
- package/python3.6.2/lib/python3.6/reprlib.py +164 -0
- package/python3.6.2/lib/python3.6/rlcompleter.py +205 -0
- package/python3.6.2/lib/python3.6/runpy.py +294 -0
- package/python3.6.2/lib/python3.6/sched.py +170 -0
- package/python3.6.2/lib/python3.6/secrets.py +73 -0
- package/python3.6.2/lib/python3.6/selectors.py +611 -0
- package/python3.6.2/lib/python3.6/shelve.py +243 -0
- package/python3.6.2/lib/python3.6/shlex.py +335 -0
- package/python3.6.2/lib/python3.6/shutil.py +1153 -0
- package/python3.6.2/lib/python3.6/signal.py +79 -0
- package/python3.6.2/lib/python3.6/site.py +598 -0
- package/python3.6.2/lib/python3.6/smtpd.py +965 -0
- package/python3.6.2/lib/python3.6/smtplib.py +1115 -0
- package/python3.6.2/lib/python3.6/sndhdr.py +257 -0
- package/python3.6.2/lib/python3.6/socket.py +750 -0
- package/python3.6.2/lib/python3.6/socketserver.py +793 -0
- package/python3.6.2/lib/python3.6/sqlite3/__init__.py +23 -0
- package/python3.6.2/lib/python3.6/sqlite3/dbapi2.py +89 -0
- package/python3.6.2/lib/python3.6/sqlite3/dump.py +70 -0
- package/python3.6.2/lib/python3.6/sqlite3/test/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/sqlite3/test/dbapi.py +938 -0
- package/python3.6.2/lib/python3.6/sqlite3/test/dump.py +81 -0
- package/python3.6.2/lib/python3.6/sqlite3/test/factory.py +293 -0
- package/python3.6.2/lib/python3.6/sqlite3/test/hooks.py +264 -0
- package/python3.6.2/lib/python3.6/sqlite3/test/regression.py +410 -0
- package/python3.6.2/lib/python3.6/sqlite3/test/transactions.py +214 -0
- package/python3.6.2/lib/python3.6/sqlite3/test/types.py +421 -0
- package/python3.6.2/lib/python3.6/sqlite3/test/userfunctions.py +473 -0
- package/python3.6.2/lib/python3.6/sre_compile.py +580 -0
- package/python3.6.2/lib/python3.6/sre_constants.py +233 -0
- package/python3.6.2/lib/python3.6/sre_parse.py +973 -0
- package/python3.6.2/lib/python3.6/ssl.py +1228 -0
- package/python3.6.2/lib/python3.6/stat.py +178 -0
- package/python3.6.2/lib/python3.6/statistics.py +670 -0
- package/python3.6.2/lib/python3.6/string.py +309 -0
- package/python3.6.2/lib/python3.6/stringprep.py +272 -0
- package/python3.6.2/lib/python3.6/struct.py +15 -0
- package/python3.6.2/lib/python3.6/subprocess.py +1590 -0
- package/python3.6.2/lib/python3.6/sunau.py +525 -0
- package/python3.6.2/lib/python3.6/symbol.py +115 -0
- package/python3.6.2/lib/python3.6/symtable.py +238 -0
- package/python3.6.2/lib/python3.6/sysconfig.py +721 -0
- package/python3.6.2/lib/python3.6/tabnanny.py +332 -0
- package/python3.6.2/lib/python3.6/tarfile.py +2547 -0
- package/python3.6.2/lib/python3.6/telnetlib.py +675 -0
- package/python3.6.2/lib/python3.6/tempfile.py +811 -0
- package/python3.6.2/lib/python3.6/test/Sine-1000Hz-300ms.aif +0 -0
- package/python3.6.2/lib/python3.6/test/__init__.py +1 -0
- package/python3.6.2/lib/python3.6/test/__main__.py +2 -0
- package/python3.6.2/lib/python3.6/test/_test_multiprocessing.py +4458 -0
- package/python3.6.2/lib/python3.6/test/allsans.pem +37 -0
- package/python3.6.2/lib/python3.6/test/ann_module.py +53 -0
- package/python3.6.2/lib/python3.6/test/ann_module2.py +36 -0
- package/python3.6.2/lib/python3.6/test/ann_module3.py +18 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-alaw.aifc +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm16.aiff +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm16.au +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm16.wav +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm24.aiff +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm24.au +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm24.wav +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm32.aiff +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm32.au +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm32.wav +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm8.aiff +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm8.au +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm8.wav +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-ulaw.aifc +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-ulaw.au +0 -0
- package/python3.6.2/lib/python3.6/test/audiotest.au +0 -0
- package/python3.6.2/lib/python3.6/test/audiotests.py +329 -0
- package/python3.6.2/lib/python3.6/test/autotest.py +5 -0
- package/python3.6.2/lib/python3.6/test/bad_coding.py +1 -0
- package/python3.6.2/lib/python3.6/test/bad_coding2.py +2 -0
- package/python3.6.2/lib/python3.6/test/badcert.pem +36 -0
- package/python3.6.2/lib/python3.6/test/badkey.pem +40 -0
- package/python3.6.2/lib/python3.6/test/badsyntax_3131.py +2 -0
- package/python3.6.2/lib/python3.6/test/badsyntax_future10.py +3 -0
- package/python3.6.2/lib/python3.6/test/badsyntax_future3.py +10 -0
- package/python3.6.2/lib/python3.6/test/badsyntax_future4.py +10 -0
- package/python3.6.2/lib/python3.6/test/badsyntax_future5.py +12 -0
- package/python3.6.2/lib/python3.6/test/badsyntax_future6.py +10 -0
- package/python3.6.2/lib/python3.6/test/badsyntax_future7.py +11 -0
- package/python3.6.2/lib/python3.6/test/badsyntax_future8.py +10 -0
- package/python3.6.2/lib/python3.6/test/badsyntax_future9.py +10 -0
- package/python3.6.2/lib/python3.6/test/badsyntax_pep3120.py +1 -0
- package/python3.6.2/lib/python3.6/test/bisect.py +167 -0
- package/python3.6.2/lib/python3.6/test/bytecode_helper.py +41 -0
- package/python3.6.2/lib/python3.6/test/capath/4e1295a3.0 +14 -0
- package/python3.6.2/lib/python3.6/test/capath/5ed36f99.0 +41 -0
- package/python3.6.2/lib/python3.6/test/capath/6e88d7b8.0 +14 -0
- package/python3.6.2/lib/python3.6/test/capath/99d0fa06.0 +41 -0
- package/python3.6.2/lib/python3.6/test/capath/b1930218.0 +21 -0
- package/python3.6.2/lib/python3.6/test/capath/ceff1710.0 +21 -0
- package/python3.6.2/lib/python3.6/test/cfgparser.1 +3 -0
- package/python3.6.2/lib/python3.6/test/cfgparser.2 +537 -0
- package/python3.6.2/lib/python3.6/test/cfgparser.3 +69 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/big5-utf8.txt +9 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/big5.txt +9 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/big5hkscs-utf8.txt +2 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/big5hkscs.txt +2 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/cp949-utf8.txt +9 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/cp949.txt +9 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/euc_jisx0213-utf8.txt +8 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/euc_jisx0213.txt +8 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/euc_jp-utf8.txt +7 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/euc_jp.txt +7 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/euc_kr-utf8.txt +7 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/euc_kr.txt +7 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/gb18030-utf8.txt +15 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/gb18030.txt +15 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/gb2312-utf8.txt +6 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/gb2312.txt +6 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/gbk-utf8.txt +14 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/gbk.txt +14 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/hz-utf8.txt +2 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/hz.txt +2 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/iso2022_jp-utf8.txt +7 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/iso2022_jp.txt +7 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/iso2022_kr-utf8.txt +7 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/iso2022_kr.txt +7 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/johab-utf8.txt +9 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/johab.txt +9 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/shift_jis-utf8.txt +7 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/shift_jis.txt +7 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/shift_jisx0213-utf8.txt +8 -0
- package/python3.6.2/lib/python3.6/test/cjkencodings/shift_jisx0213.txt +8 -0
- package/python3.6.2/lib/python3.6/test/cmath_testcases.txt +2511 -0
- package/python3.6.2/lib/python3.6/test/coding20731.py +4 -0
- package/python3.6.2/lib/python3.6/test/crashers/README +20 -0
- package/python3.6.2/lib/python3.6/test/crashers/bogus_code_obj.py +19 -0
- package/python3.6.2/lib/python3.6/test/crashers/gc_inspection.py +32 -0
- package/python3.6.2/lib/python3.6/test/crashers/infinite_loop_re.py +16 -0
- package/python3.6.2/lib/python3.6/test/crashers/mutation_inside_cyclegc.py +31 -0
- package/python3.6.2/lib/python3.6/test/crashers/recursive_call.py +15 -0
- package/python3.6.2/lib/python3.6/test/crashers/trace_at_recursion_limit.py +27 -0
- package/python3.6.2/lib/python3.6/test/crashers/underlying_dict.py +20 -0
- package/python3.6.2/lib/python3.6/test/curses_tests.py +46 -0
- package/python3.6.2/lib/python3.6/test/data/README +2 -0
- package/python3.6.2/lib/python3.6/test/datetimetester.py +4929 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/abs.decTest +161 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/add.decTest +2716 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/and.decTest +338 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/base.decTest +1411 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/clamp.decTest +211 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/class.decTest +131 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/compare.decTest +758 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/comparetotal.decTest +798 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/comparetotmag.decTest +790 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/copy.decTest +86 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/copyabs.decTest +86 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/copynegate.decTest +86 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/copysign.decTest +177 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddAbs.decTest +126 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddAdd.decTest +1328 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddAnd.decTest +347 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddBase.decTest +1104 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCanonical.decTest +357 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddClass.decTest +76 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCompare.decTest +744 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCompareSig.decTest +647 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCompareTotal.decTest +706 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCompareTotalMag.decTest +706 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCopy.decTest +88 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCopyAbs.decTest +88 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCopyNegate.decTest +88 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCopySign.decTest +175 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddDivide.decTest +863 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddDivideInt.decTest +449 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddEncode.decTest +495 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddFMA.decTest +1698 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddInvert.decTest +202 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddLogB.decTest +159 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddMax.decTest +322 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddMaxMag.decTest +304 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddMin.decTest +309 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddMinMag.decTest +293 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddMinus.decTest +88 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddMultiply.decTest +553 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddNextMinus.decTest +126 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddNextPlus.decTest +124 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddNextToward.decTest +374 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddOr.decTest +292 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddPlus.decTest +88 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddQuantize.decTest +833 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddReduce.decTest +182 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddRemainder.decTest +600 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddRemainderNear.decTest +629 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddRotate.decTest +262 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddSameQuantum.decTest +389 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddScaleB.decTest +243 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddShift.decTest +262 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddSubtract.decTest +629 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddToIntegral.decTest +257 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddXor.decTest +337 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/decDouble.decTest +65 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/decQuad.decTest +65 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/decSingle.decTest +25 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/divide.decTest +854 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/divideint.decTest +486 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqAbs.decTest +126 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqAdd.decTest +1215 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqAnd.decTest +420 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqBase.decTest +1081 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCanonical.decTest +372 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqClass.decTest +77 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCompare.decTest +753 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCompareSig.decTest +647 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCompareTotal.decTest +706 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCompareTotalMag.decTest +706 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCopy.decTest +88 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCopyAbs.decTest +88 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCopyNegate.decTest +88 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCopySign.decTest +175 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqDivide.decTest +808 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqDivideInt.decTest +453 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqEncode.decTest +477 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqFMA.decTest +1786 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqInvert.decTest +245 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqLogB.decTest +160 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqMax.decTest +322 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqMaxMag.decTest +304 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqMin.decTest +309 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqMinMag.decTest +293 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqMinus.decTest +88 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqMultiply.decTest +589 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqNextMinus.decTest +126 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqNextPlus.decTest +124 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqNextToward.decTest +375 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqOr.decTest +401 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqPlus.decTest +88 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqQuantize.decTest +836 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqReduce.decTest +183 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqRemainder.decTest +597 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqRemainderNear.decTest +631 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqRotate.decTest +298 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqSameQuantum.decTest +389 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqScaleB.decTest +260 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqShift.decTest +298 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqSubtract.decTest +635 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqToIntegral.decTest +257 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqXor.decTest +410 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dsBase.decTest +1062 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dsEncode.decTest +372 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/exp.decTest +674 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/extra.decTest +2830 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/fma.decTest +3426 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/inexact.decTest +215 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/invert.decTest +176 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ln.decTest +611 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/log10.decTest +551 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/logb.decTest +188 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/max.decTest +424 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/maxmag.decTest +404 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/min.decTest +407 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/minmag.decTest +390 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/minus.decTest +182 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/multiply.decTest +731 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/nextminus.decTest +148 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/nextplus.decTest +150 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/nexttoward.decTest +426 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/or.decTest +334 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/plus.decTest +195 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/power.decTest +1624 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/powersqrt.decTest +2970 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/quantize.decTest +948 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/randomBound32.decTest +2443 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/randoms.decTest +4030 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/reduce.decTest +234 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/remainder.decTest +640 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/remainderNear.decTest +572 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/rescale.decTest +764 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/rotate.decTest +247 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/rounding.decTest +1303 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/samequantum.decTest +389 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/scaleb.decTest +209 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/shift.decTest +250 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/squareroot.decTest +3834 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/subtract.decTest +873 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/testall.decTest +87 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/tointegral.decTest +241 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/tointegralx.decTest +255 -0
- package/python3.6.2/lib/python3.6/test/decimaltestdata/xor.decTest +335 -0
- package/python3.6.2/lib/python3.6/test/dh1024.pem +7 -0
- package/python3.6.2/lib/python3.6/test/dis_module.py +5 -0
- package/python3.6.2/lib/python3.6/test/doctest_aliases.py +13 -0
- package/python3.6.2/lib/python3.6/test/double_const.py +30 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/assert_usable.d +5 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/assert_usable.stp +5 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/call_stack.d +31 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/call_stack.d.expected +18 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/call_stack.py +30 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/call_stack.stp +41 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/call_stack.stp.expected +14 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/gc.d +18 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/gc.d.expected +8 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/gc.py +13 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/gc.stp +26 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/gc.stp.expected +8 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/instance.py +24 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/line.d +7 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/line.d.expected +20 -0
- package/python3.6.2/lib/python3.6/test/dtracedata/line.py +17 -0
- package/python3.6.2/lib/python3.6/test/eintrdata/eintr_tester.py +493 -0
- package/python3.6.2/lib/python3.6/test/empty.vbs +1 -0
- package/python3.6.2/lib/python3.6/test/encoded_modules/__init__.py +23 -0
- package/python3.6.2/lib/python3.6/test/encoded_modules/module_iso_8859_1.py +5 -0
- package/python3.6.2/lib/python3.6/test/encoded_modules/module_koi8_r.py +3 -0
- package/python3.6.2/lib/python3.6/test/exception_hierarchy.txt +64 -0
- package/python3.6.2/lib/python3.6/test/final_a.py +19 -0
- package/python3.6.2/lib/python3.6/test/final_b.py +19 -0
- package/python3.6.2/lib/python3.6/test/floating_points.txt +1028 -0
- package/python3.6.2/lib/python3.6/test/fork_wait.py +91 -0
- package/python3.6.2/lib/python3.6/test/formatfloat_testcases.txt +355 -0
- package/python3.6.2/lib/python3.6/test/future_test1.py +11 -0
- package/python3.6.2/lib/python3.6/test/future_test2.py +10 -0
- package/python3.6.2/lib/python3.6/test/gdb_sample.py +12 -0
- package/python3.6.2/lib/python3.6/test/ieee754.txt +185 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.bmp +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.exr +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.gif +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.jpg +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.pbm +3 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.pgm +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.png +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.ppm +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.ras +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.sgi +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.tiff +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.webp +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.xbm +6 -0
- package/python3.6.2/lib/python3.6/test/imp_dummy.py +3 -0
- package/python3.6.2/lib/python3.6/test/inspect_fodder.py +76 -0
- package/python3.6.2/lib/python3.6/test/inspect_fodder2.py +139 -0
- package/python3.6.2/lib/python3.6/test/keycert.passwd.pem +33 -0
- package/python3.6.2/lib/python3.6/test/keycert.pem +31 -0
- package/python3.6.2/lib/python3.6/test/keycert2.pem +31 -0
- package/python3.6.2/lib/python3.6/test/keycert3.pem +73 -0
- package/python3.6.2/lib/python3.6/test/keycert4.pem +73 -0
- package/python3.6.2/lib/python3.6/test/leakers/README.txt +32 -0
- package/python3.6.2/lib/python3.6/test/leakers/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/test/leakers/test_ctypes.py +15 -0
- package/python3.6.2/lib/python3.6/test/leakers/test_selftype.py +13 -0
- package/python3.6.2/lib/python3.6/test/libregrtest/__init__.py +5 -0
- package/python3.6.2/lib/python3.6/test/libregrtest/cmdline.py +387 -0
- package/python3.6.2/lib/python3.6/test/libregrtest/main.py +584 -0
- package/python3.6.2/lib/python3.6/test/libregrtest/refleak.py +294 -0
- package/python3.6.2/lib/python3.6/test/libregrtest/runtest.py +254 -0
- package/python3.6.2/lib/python3.6/test/libregrtest/runtest_mp.py +244 -0
- package/python3.6.2/lib/python3.6/test/libregrtest/save_env.py +284 -0
- package/python3.6.2/lib/python3.6/test/libregrtest/setup.py +140 -0
- package/python3.6.2/lib/python3.6/test/list_tests.py +618 -0
- package/python3.6.2/lib/python3.6/test/lock_tests.py +936 -0
- package/python3.6.2/lib/python3.6/test/mailcap.txt +39 -0
- package/python3.6.2/lib/python3.6/test/make_ssl_certs.py +216 -0
- package/python3.6.2/lib/python3.6/test/mapping_tests.py +657 -0
- package/python3.6.2/lib/python3.6/test/math_testcases.txt +633 -0
- package/python3.6.2/lib/python3.6/test/memory_watchdog.py +28 -0
- package/python3.6.2/lib/python3.6/test/mime.types +1445 -0
- package/python3.6.2/lib/python3.6/test/mock_socket.py +159 -0
- package/python3.6.2/lib/python3.6/test/mod_generics_cache.py +53 -0
- package/python3.6.2/lib/python3.6/test/mp_fork_bomb.py +18 -0
- package/python3.6.2/lib/python3.6/test/mp_preload.py +18 -0
- package/python3.6.2/lib/python3.6/test/multibytecodec_support.py +384 -0
- package/python3.6.2/lib/python3.6/test/nokia.pem +31 -0
- package/python3.6.2/lib/python3.6/test/nullbytecert.pem +90 -0
- package/python3.6.2/lib/python3.6/test/nullcert.pem +0 -0
- package/python3.6.2/lib/python3.6/test/outstanding_bugs.py +18 -0
- package/python3.6.2/lib/python3.6/test/pickletester.py +2922 -0
- package/python3.6.2/lib/python3.6/test/profilee.py +115 -0
- package/python3.6.2/lib/python3.6/test/pstats.pck +0 -0
- package/python3.6.2/lib/python3.6/test/pycacert.pem +78 -0
- package/python3.6.2/lib/python3.6/test/pycakey.pem +28 -0
- package/python3.6.2/lib/python3.6/test/pyclbr_input.py +33 -0
- package/python3.6.2/lib/python3.6/test/pydoc_mod.py +37 -0
- package/python3.6.2/lib/python3.6/test/pydocfodder.py +216 -0
- package/python3.6.2/lib/python3.6/test/pystone.py +277 -0
- package/python3.6.2/lib/python3.6/test/pythoninfo.py +486 -0
- package/python3.6.2/lib/python3.6/test/randv2_32.pck +633 -0
- package/python3.6.2/lib/python3.6/test/randv2_64.pck +633 -0
- package/python3.6.2/lib/python3.6/test/randv3.pck +633 -0
- package/python3.6.2/lib/python3.6/test/re_tests.py +670 -0
- package/python3.6.2/lib/python3.6/test/regrtest.py +50 -0
- package/python3.6.2/lib/python3.6/test/relimport.py +1 -0
- package/python3.6.2/lib/python3.6/test/reperf.py +23 -0
- package/python3.6.2/lib/python3.6/test/revocation.crl +11 -0
- package/python3.6.2/lib/python3.6/test/sample_doctest.py +76 -0
- package/python3.6.2/lib/python3.6/test/sample_doctest_no_docstrings.py +12 -0
- package/python3.6.2/lib/python3.6/test/sample_doctest_no_doctests.py +15 -0
- package/python3.6.2/lib/python3.6/test/selfsigned_pythontestdotnet.pem +16 -0
- package/python3.6.2/lib/python3.6/test/seq_tests.py +414 -0
- package/python3.6.2/lib/python3.6/test/sgml_input.html +212 -0
- package/python3.6.2/lib/python3.6/test/signalinterproctester.py +84 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/README +5 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.8svx +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.aifc +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.aiff +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.au +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.hcom +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.sndt +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.voc +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.wav +0 -0
- package/python3.6.2/lib/python3.6/test/sortperf.py +169 -0
- package/python3.6.2/lib/python3.6/test/ssl_cert.pem +15 -0
- package/python3.6.2/lib/python3.6/test/ssl_key.passwd.pem +18 -0
- package/python3.6.2/lib/python3.6/test/ssl_key.pem +16 -0
- package/python3.6.2/lib/python3.6/test/ssl_servers.py +209 -0
- package/python3.6.2/lib/python3.6/test/ssltests.py +37 -0
- package/python3.6.2/lib/python3.6/test/string_tests.py +1383 -0
- package/python3.6.2/lib/python3.6/test/subprocessdata/fd_status.py +34 -0
- package/python3.6.2/lib/python3.6/test/subprocessdata/input_reader.py +7 -0
- package/python3.6.2/lib/python3.6/test/subprocessdata/qcat.py +7 -0
- package/python3.6.2/lib/python3.6/test/subprocessdata/qgrep.py +10 -0
- package/python3.6.2/lib/python3.6/test/subprocessdata/sigchild_ignore.py +15 -0
- package/python3.6.2/lib/python3.6/test/support/__init__.py +2706 -0
- package/python3.6.2/lib/python3.6/test/support/script_helper.py +259 -0
- package/python3.6.2/lib/python3.6/test/test___all__.py +109 -0
- package/python3.6.2/lib/python3.6/test/test___future__.py +61 -0
- package/python3.6.2/lib/python3.6/test/test__locale.py +193 -0
- package/python3.6.2/lib/python3.6/test/test__opcode.py +20 -0
- package/python3.6.2/lib/python3.6/test/test__osx_support.py +276 -0
- package/python3.6.2/lib/python3.6/test/test_abc.py +420 -0
- package/python3.6.2/lib/python3.6/test/test_abstract_numbers.py +44 -0
- package/python3.6.2/lib/python3.6/test/test_aifc.py +399 -0
- package/python3.6.2/lib/python3.6/test/test_argparse.py +5006 -0
- package/python3.6.2/lib/python3.6/test/test_array.py +1388 -0
- package/python3.6.2/lib/python3.6/test/test_asdl_parser.py +122 -0
- package/python3.6.2/lib/python3.6/test/test_ast.py +1170 -0
- package/python3.6.2/lib/python3.6/test/test_asyncgen.py +1044 -0
- package/python3.6.2/lib/python3.6/test/test_asynchat.py +308 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/__init__.py +10 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/echo.py +8 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/echo2.py +6 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/echo3.py +11 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/keycert3.pem +73 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/pycacert.pem +78 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/ssl_cert.pem +15 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/ssl_key.pem +16 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_base_events.py +1761 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_events.py +2791 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_futures.py +692 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_locks.py +943 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_pep492.py +232 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_proactor_events.py +593 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_queues.py +643 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_selector_events.py +1833 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_sslproto.py +134 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_streams.py +868 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_subprocess.py +532 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_tasks.py +2598 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_transports.py +91 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_unix_events.py +1621 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_windows_events.py +164 -0
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_windows_utils.py +182 -0
- package/python3.6.2/lib/python3.6/test/test_asyncore.py +847 -0
- package/python3.6.2/lib/python3.6/test/test_atexit.py +192 -0
- package/python3.6.2/lib/python3.6/test/test_audioop.py +565 -0
- package/python3.6.2/lib/python3.6/test/test_augassign.py +326 -0
- package/python3.6.2/lib/python3.6/test/test_base64.py +681 -0
- package/python3.6.2/lib/python3.6/test/test_baseexception.py +183 -0
- package/python3.6.2/lib/python3.6/test/test_bigaddrspace.py +101 -0
- package/python3.6.2/lib/python3.6/test/test_bigmem.py +1256 -0
- package/python3.6.2/lib/python3.6/test/test_binascii.py +373 -0
- package/python3.6.2/lib/python3.6/test/test_binhex.py +55 -0
- package/python3.6.2/lib/python3.6/test/test_binop.py +441 -0
- package/python3.6.2/lib/python3.6/test/test_bisect.py +328 -0
- package/python3.6.2/lib/python3.6/test/test_bool.py +368 -0
- package/python3.6.2/lib/python3.6/test/test_buffer.py +4396 -0
- package/python3.6.2/lib/python3.6/test/test_bufio.py +73 -0
- package/python3.6.2/lib/python3.6/test/test_builtin.py +1851 -0
- package/python3.6.2/lib/python3.6/test/test_bytes.py +1759 -0
- package/python3.6.2/lib/python3.6/test/test_bz2.py +1002 -0
- package/python3.6.2/lib/python3.6/test/test_calendar.py +848 -0
- package/python3.6.2/lib/python3.6/test/test_call.py +302 -0
- package/python3.6.2/lib/python3.6/test/test_capi.py +753 -0
- package/python3.6.2/lib/python3.6/test/test_cgi.py +539 -0
- package/python3.6.2/lib/python3.6/test/test_cgitb.py +67 -0
- package/python3.6.2/lib/python3.6/test/test_charmapcodec.py +53 -0
- package/python3.6.2/lib/python3.6/test/test_class.py +599 -0
- package/python3.6.2/lib/python3.6/test/test_cmath.py +643 -0
- package/python3.6.2/lib/python3.6/test/test_cmd.py +243 -0
- package/python3.6.2/lib/python3.6/test/test_cmd_line.py +494 -0
- package/python3.6.2/lib/python3.6/test/test_cmd_line_script.py +648 -0
- package/python3.6.2/lib/python3.6/test/test_code.py +367 -0
- package/python3.6.2/lib/python3.6/test/test_code_module.py +154 -0
- package/python3.6.2/lib/python3.6/test/test_codeccallbacks.py +1074 -0
- package/python3.6.2/lib/python3.6/test/test_codecencodings_cn.py +96 -0
- package/python3.6.2/lib/python3.6/test/test_codecencodings_hk.py +22 -0
- package/python3.6.2/lib/python3.6/test/test_codecencodings_iso2022.py +41 -0
- package/python3.6.2/lib/python3.6/test/test_codecencodings_jp.py +126 -0
- package/python3.6.2/lib/python3.6/test/test_codecencodings_kr.py +69 -0
- package/python3.6.2/lib/python3.6/test/test_codecencodings_tw.py +22 -0
- package/python3.6.2/lib/python3.6/test/test_codecmaps_cn.py +26 -0
- package/python3.6.2/lib/python3.6/test/test_codecmaps_hk.py +15 -0
- package/python3.6.2/lib/python3.6/test/test_codecmaps_jp.py +60 -0
- package/python3.6.2/lib/python3.6/test/test_codecmaps_kr.py +37 -0
- package/python3.6.2/lib/python3.6/test/test_codecmaps_tw.py +27 -0
- package/python3.6.2/lib/python3.6/test/test_codecs.py +3272 -0
- package/python3.6.2/lib/python3.6/test/test_codeop.py +299 -0
- package/python3.6.2/lib/python3.6/test/test_collections.py +1926 -0
- package/python3.6.2/lib/python3.6/test/test_colorsys.py +100 -0
- package/python3.6.2/lib/python3.6/test/test_compare.py +124 -0
- package/python3.6.2/lib/python3.6/test/test_compile.py +720 -0
- package/python3.6.2/lib/python3.6/test/test_compileall.py +547 -0
- package/python3.6.2/lib/python3.6/test/test_complex.py +688 -0
- package/python3.6.2/lib/python3.6/test/test_concurrent_futures.py +836 -0
- package/python3.6.2/lib/python3.6/test/test_configparser.py +2096 -0
- package/python3.6.2/lib/python3.6/test/test_contains.py +114 -0
- package/python3.6.2/lib/python3.6/test/test_contextlib.py +990 -0
- package/python3.6.2/lib/python3.6/test/test_copy.py +888 -0
- package/python3.6.2/lib/python3.6/test/test_copyreg.py +126 -0
- package/python3.6.2/lib/python3.6/test/test_coroutines.py +2151 -0
- package/python3.6.2/lib/python3.6/test/test_cprofile.py +98 -0
- package/python3.6.2/lib/python3.6/test/test_crashers.py +37 -0
- package/python3.6.2/lib/python3.6/test/test_crypt.py +45 -0
- package/python3.6.2/lib/python3.6/test/test_csv.py +1175 -0
- package/python3.6.2/lib/python3.6/test/test_ctypes.py +9 -0
- package/python3.6.2/lib/python3.6/test/test_curses.py +549 -0
- package/python3.6.2/lib/python3.6/test/test_datetime.py +57 -0
- package/python3.6.2/lib/python3.6/test/test_dbm.py +192 -0
- package/python3.6.2/lib/python3.6/test/test_dbm_dumb.py +286 -0
- package/python3.6.2/lib/python3.6/test/test_dbm_gnu.py +97 -0
- package/python3.6.2/lib/python3.6/test/test_dbm_ndbm.py +52 -0
- package/python3.6.2/lib/python3.6/test/test_decimal.py +5707 -0
- package/python3.6.2/lib/python3.6/test/test_decorators.py +304 -0
- package/python3.6.2/lib/python3.6/test/test_defaultdict.py +187 -0
- package/python3.6.2/lib/python3.6/test/test_deque.py +1059 -0
- package/python3.6.2/lib/python3.6/test/test_descr.py +5452 -0
- package/python3.6.2/lib/python3.6/test/test_descrtut.py +486 -0
- package/python3.6.2/lib/python3.6/test/test_devpoll.py +145 -0
- package/python3.6.2/lib/python3.6/test/test_dict.py +1217 -0
- package/python3.6.2/lib/python3.6/test/test_dict_version.py +186 -0
- package/python3.6.2/lib/python3.6/test/test_dictcomps.py +86 -0
- package/python3.6.2/lib/python3.6/test/test_dictviews.py +272 -0
- package/python3.6.2/lib/python3.6/test/test_difflib.py +478 -0
- package/python3.6.2/lib/python3.6/test/test_difflib_expect.html +526 -0
- package/python3.6.2/lib/python3.6/test/test_dis.py +960 -0
- package/python3.6.2/lib/python3.6/test/test_distutils.py +18 -0
- package/python3.6.2/lib/python3.6/test/test_doctest.py +2962 -0
- package/python3.6.2/lib/python3.6/test/test_doctest.txt +17 -0
- package/python3.6.2/lib/python3.6/test/test_doctest2.py +123 -0
- package/python3.6.2/lib/python3.6/test/test_doctest2.txt +14 -0
- package/python3.6.2/lib/python3.6/test/test_doctest3.txt +5 -0
- package/python3.6.2/lib/python3.6/test/test_doctest4.txt +11 -0
- package/python3.6.2/lib/python3.6/test/test_docxmlrpc.py +198 -0
- package/python3.6.2/lib/python3.6/test/test_dtrace.py +178 -0
- package/python3.6.2/lib/python3.6/test/test_dummy_thread.py +256 -0
- package/python3.6.2/lib/python3.6/test/test_dummy_threading.py +60 -0
- package/python3.6.2/lib/python3.6/test/test_dynamic.py +138 -0
- package/python3.6.2/lib/python3.6/test/test_dynamicclassattribute.py +300 -0
- package/python3.6.2/lib/python3.6/test/test_eintr.py +22 -0
- package/python3.6.2/lib/python3.6/test/test_email/__init__.py +166 -0
- package/python3.6.2/lib/python3.6/test/test_email/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/PyBanner048.gif +0 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/audiotest.au +0 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_01.txt +19 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_02.txt +136 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_03.txt +16 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_04.txt +37 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_05.txt +28 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_06.txt +33 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_07.txt +83 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_08.txt +24 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_09.txt +24 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_10.txt +39 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_11.txt +7 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_12.txt +36 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_12a.txt +38 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_13.txt +94 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_14.txt +23 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_15.txt +52 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_16.txt +123 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_17.txt +12 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_18.txt +6 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_19.txt +43 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_20.txt +22 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_21.txt +20 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_22.txt +46 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_23.txt +8 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_24.txt +10 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_25.txt +117 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_26.txt +46 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_27.txt +15 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_28.txt +25 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_29.txt +22 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_30.txt +23 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_31.txt +15 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_32.txt +14 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_33.txt +29 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_34.txt +19 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_35.txt +4 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_36.txt +40 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_37.txt +22 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_38.txt +101 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_39.txt +83 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_40.txt +10 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_41.txt +8 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_42.txt +20 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_43.txt +217 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_44.txt +33 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_45.txt +33 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_46.txt +23 -0
- package/python3.6.2/lib/python3.6/test/test_email/test__encoded_words.py +192 -0
- package/python3.6.2/lib/python3.6/test/test_email/test__header_value_parser.py +2723 -0
- package/python3.6.2/lib/python3.6/test/test_email/test_asian_codecs.py +81 -0
- package/python3.6.2/lib/python3.6/test/test_email/test_contentmanager.py +796 -0
- package/python3.6.2/lib/python3.6/test/test_email/test_defect_handling.py +320 -0
- package/python3.6.2/lib/python3.6/test/test_email/test_email.py +5402 -0
- package/python3.6.2/lib/python3.6/test/test_email/test_generator.py +296 -0
- package/python3.6.2/lib/python3.6/test/test_email/test_headerregistry.py +1653 -0
- package/python3.6.2/lib/python3.6/test/test_email/test_inversion.py +70 -0
- package/python3.6.2/lib/python3.6/test/test_email/test_message.py +803 -0
- package/python3.6.2/lib/python3.6/test/test_email/test_parser.py +110 -0
- package/python3.6.2/lib/python3.6/test/test_email/test_pickleable.py +76 -0
- package/python3.6.2/lib/python3.6/test/test_email/test_policy.py +346 -0
- package/python3.6.2/lib/python3.6/test/test_email/test_utils.py +163 -0
- package/python3.6.2/lib/python3.6/test/test_email/torture_test.py +133 -0
- package/python3.6.2/lib/python3.6/test/test_ensurepip.py +310 -0
- package/python3.6.2/lib/python3.6/test/test_enum.py +2618 -0
- package/python3.6.2/lib/python3.6/test/test_enumerate.py +269 -0
- package/python3.6.2/lib/python3.6/test/test_eof.py +28 -0
- package/python3.6.2/lib/python3.6/test/test_epoll.py +255 -0
- package/python3.6.2/lib/python3.6/test/test_errno.py +35 -0
- package/python3.6.2/lib/python3.6/test/test_exception_hierarchy.py +204 -0
- package/python3.6.2/lib/python3.6/test/test_exception_variations.py +176 -0
- package/python3.6.2/lib/python3.6/test/test_exceptions.py +1288 -0
- package/python3.6.2/lib/python3.6/test/test_extcall.py +465 -0
- package/python3.6.2/lib/python3.6/test/test_faulthandler.py +817 -0
- package/python3.6.2/lib/python3.6/test/test_fcntl.py +152 -0
- package/python3.6.2/lib/python3.6/test/test_file.py +329 -0
- package/python3.6.2/lib/python3.6/test/test_file_eintr.py +252 -0
- package/python3.6.2/lib/python3.6/test/test_filecmp.py +217 -0
- package/python3.6.2/lib/python3.6/test/test_fileinput.py +1015 -0
- package/python3.6.2/lib/python3.6/test/test_fileio.py +595 -0
- package/python3.6.2/lib/python3.6/test/test_finalization.py +519 -0
- package/python3.6.2/lib/python3.6/test/test_float.py +1422 -0
- package/python3.6.2/lib/python3.6/test/test_flufl.py +22 -0
- package/python3.6.2/lib/python3.6/test/test_fnmatch.py +128 -0
- package/python3.6.2/lib/python3.6/test/test_fork1.py +112 -0
- package/python3.6.2/lib/python3.6/test/test_format.py +494 -0
- package/python3.6.2/lib/python3.6/test/test_fractions.py +635 -0
- package/python3.6.2/lib/python3.6/test/test_frame.py +165 -0
- package/python3.6.2/lib/python3.6/test/test_fstring.py +1038 -0
- package/python3.6.2/lib/python3.6/test/test_ftplib.py +1091 -0
- package/python3.6.2/lib/python3.6/test/test_funcattrs.py +377 -0
- package/python3.6.2/lib/python3.6/test/test_functools.py +2083 -0
- package/python3.6.2/lib/python3.6/test/test_future.py +108 -0
- package/python3.6.2/lib/python3.6/test/test_future3.py +26 -0
- package/python3.6.2/lib/python3.6/test/test_future4.py +6 -0
- package/python3.6.2/lib/python3.6/test/test_future5.py +21 -0
- package/python3.6.2/lib/python3.6/test/test_gc.py +1031 -0
- package/python3.6.2/lib/python3.6/test/test_gdb.py +936 -0
- package/python3.6.2/lib/python3.6/test/test_generator_stop.py +34 -0
- package/python3.6.2/lib/python3.6/test/test_generators.py +2232 -0
- package/python3.6.2/lib/python3.6/test/test_genericpath.py +537 -0
- package/python3.6.2/lib/python3.6/test/test_genexps.py +285 -0
- package/python3.6.2/lib/python3.6/test/test_getargs2.py +958 -0
- package/python3.6.2/lib/python3.6/test/test_getopt.py +184 -0
- package/python3.6.2/lib/python3.6/test/test_getpass.py +163 -0
- package/python3.6.2/lib/python3.6/test/test_gettext.py +770 -0
- package/python3.6.2/lib/python3.6/test/test_glob.py +317 -0
- package/python3.6.2/lib/python3.6/test/test_global.py +61 -0
- package/python3.6.2/lib/python3.6/test/test_grammar.py +1417 -0
- package/python3.6.2/lib/python3.6/test/test_grp.py +108 -0
- package/python3.6.2/lib/python3.6/test/test_gzip.py +672 -0
- package/python3.6.2/lib/python3.6/test/test_hash.py +346 -0
- package/python3.6.2/lib/python3.6/test/test_hashlib.py +954 -0
- package/python3.6.2/lib/python3.6/test/test_heapq.py +427 -0
- package/python3.6.2/lib/python3.6/test/test_hmac.py +496 -0
- package/python3.6.2/lib/python3.6/test/test_html.py +103 -0
- package/python3.6.2/lib/python3.6/test/test_htmlparser.py +778 -0
- package/python3.6.2/lib/python3.6/test/test_http_cookiejar.py +1772 -0
- package/python3.6.2/lib/python3.6/test/test_http_cookies.py +472 -0
- package/python3.6.2/lib/python3.6/test/test_httplib.py +1903 -0
- package/python3.6.2/lib/python3.6/test/test_httpservers.py +1060 -0
- package/python3.6.2/lib/python3.6/test/test_idle.py +23 -0
- package/python3.6.2/lib/python3.6/test/test_imaplib.py +998 -0
- package/python3.6.2/lib/python3.6/test/test_imghdr.py +140 -0
- package/python3.6.2/lib/python3.6/test/test_imp.py +416 -0
- package/python3.6.2/lib/python3.6/test/test_import/__init__.py +1199 -0
- package/python3.6.2/lib/python3.6/test/test_import/__main__.py +3 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/basic.py +2 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/basic2.py +1 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/indirect.py +1 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/rebinding.py +3 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/rebinding2.py +3 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/subpackage.py +2 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/subpkg/subpackage2.py +2 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/subpkg/util.py +2 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/util.py +2 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/package/__init__.py +2 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/package/submodule.py +0 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/package2/submodule1.py +3 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/package2/submodule2.py +0 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/__init__.py +5 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/abc.py +94 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/builtin/__init__.py +5 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/builtin/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/builtin/test_finder.py +90 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/builtin/test_loader.py +108 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/extension/__init__.py +5 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/extension/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/extension/test_case_sensitivity.py +46 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/extension/test_finder.py +44 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/extension/test_loader.py +277 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/extension/test_path_hook.py +31 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/frozen/__init__.py +5 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/frozen/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/frozen/test_finder.py +84 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/frozen/test_loader.py +225 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/__init__.py +5 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test___loader__.py +75 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test___package__.py +163 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_api.py +119 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_caching.py +93 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_fromlist.py +175 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_meta_path.py +125 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_packages.py +110 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_path.py +257 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_relative_imports.py +232 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/both_portions/foo/one.py +1 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/both_portions/foo/two.py +1 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/missing_directory.zip +0 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test/empty +0 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test.py +1 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/nested_portion1.zip +0 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/one.py +1 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/portion1/foo/one.py +1 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/portion2/foo/two.py +1 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/project1/parent/child/one.py +1 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/project2/parent/child/two.py +1 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/project3/parent/child/three.py +1 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/top_level_portion1.zip +0 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/source/__init__.py +5 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/source/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/source/test_case_sensitivity.py +85 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/source/test_file_loader.py +602 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/source/test_finder.py +236 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/source/test_path_hook.py +41 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/source/test_source_encoding.py +175 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/test_abc.py +953 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/test_api.py +449 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/test_lazy.py +145 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/test_locks.py +175 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/test_namespace_pkgs.py +321 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/test_spec.py +819 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/test_util.py +805 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/test_windows.py +109 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/util.py +388 -0
- package/python3.6.2/lib/python3.6/test/test_index.py +275 -0
- package/python3.6.2/lib/python3.6/test/test_inspect.py +3725 -0
- package/python3.6.2/lib/python3.6/test/test_int.py +518 -0
- package/python3.6.2/lib/python3.6/test/test_int_literal.py +143 -0
- package/python3.6.2/lib/python3.6/test/test_io.py +4054 -0
- package/python3.6.2/lib/python3.6/test/test_ioctl.py +91 -0
- package/python3.6.2/lib/python3.6/test/test_ipaddress.py +1972 -0
- package/python3.6.2/lib/python3.6/test/test_isinstance.py +280 -0
- package/python3.6.2/lib/python3.6/test/test_iter.py +1016 -0
- package/python3.6.2/lib/python3.6/test/test_iterlen.py +228 -0
- package/python3.6.2/lib/python3.6/test/test_itertools.py +2340 -0
- package/python3.6.2/lib/python3.6/test/test_json/__init__.py +56 -0
- package/python3.6.2/lib/python3.6/test/test_json/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_decode.py +97 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_default.py +12 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_dump.py +68 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_encode_basestring_ascii.py +48 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_enum.py +120 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_fail.py +216 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_float.py +33 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_indent.py +67 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_pass1.py +75 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_pass2.py +18 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_pass3.py +24 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_recursion.py +100 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_scanstring.py +141 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_separators.py +50 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_speedups.py +71 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_tool.py +107 -0
- package/python3.6.2/lib/python3.6/test/test_json/test_unicode.py +98 -0
- package/python3.6.2/lib/python3.6/test/test_keyword.py +138 -0
- package/python3.6.2/lib/python3.6/test/test_keywordonlyarg.py +189 -0
- package/python3.6.2/lib/python3.6/test/test_kqueue.py +263 -0
- package/python3.6.2/lib/python3.6/test/test_largefile.py +180 -0
- package/python3.6.2/lib/python3.6/test/test_lib2to3.py +5 -0
- package/python3.6.2/lib/python3.6/test/test_linecache.py +242 -0
- package/python3.6.2/lib/python3.6/test/test_list.py +155 -0
- package/python3.6.2/lib/python3.6/test/test_listcomps.py +148 -0
- package/python3.6.2/lib/python3.6/test/test_locale.py +587 -0
- package/python3.6.2/lib/python3.6/test/test_logging.py +4442 -0
- package/python3.6.2/lib/python3.6/test/test_long.py +1322 -0
- package/python3.6.2/lib/python3.6/test/test_longexp.py +10 -0
- package/python3.6.2/lib/python3.6/test/test_lzma.py +1764 -0
- package/python3.6.2/lib/python3.6/test/test_macpath.py +149 -0
- package/python3.6.2/lib/python3.6/test/test_macurl2path.py +31 -0
- package/python3.6.2/lib/python3.6/test/test_mailbox.py +2288 -0
- package/python3.6.2/lib/python3.6/test/test_mailcap.py +239 -0
- package/python3.6.2/lib/python3.6/test/test_marshal.py +556 -0
- package/python3.6.2/lib/python3.6/test/test_math.py +1422 -0
- package/python3.6.2/lib/python3.6/test/test_memoryio.py +842 -0
- package/python3.6.2/lib/python3.6/test/test_memoryview.py +537 -0
- package/python3.6.2/lib/python3.6/test/test_metaclass.py +265 -0
- package/python3.6.2/lib/python3.6/test/test_mimetypes.py +111 -0
- package/python3.6.2/lib/python3.6/test/test_minidom.py +1574 -0
- package/python3.6.2/lib/python3.6/test/test_mmap.py +803 -0
- package/python3.6.2/lib/python3.6/test/test_module.py +244 -0
- package/python3.6.2/lib/python3.6/test/test_modulefinder.py +337 -0
- package/python3.6.2/lib/python3.6/test/test_msilib.py +99 -0
- package/python3.6.2/lib/python3.6/test/test_multibytecodec.py +270 -0
- package/python3.6.2/lib/python3.6/test/test_multiprocessing_fork.py +13 -0
- package/python3.6.2/lib/python3.6/test/test_multiprocessing_forkserver.py +12 -0
- package/python3.6.2/lib/python3.6/test/test_multiprocessing_main_handling.py +290 -0
- package/python3.6.2/lib/python3.6/test/test_multiprocessing_spawn.py +12 -0
- package/python3.6.2/lib/python3.6/test/test_netrc.py +133 -0
- package/python3.6.2/lib/python3.6/test/test_nis.py +39 -0
- package/python3.6.2/lib/python3.6/test/test_nntplib.py +1581 -0
- package/python3.6.2/lib/python3.6/test/test_normalization.py +108 -0
- package/python3.6.2/lib/python3.6/test/test_ntpath.py +539 -0
- package/python3.6.2/lib/python3.6/test/test_numeric_tower.py +202 -0
- package/python3.6.2/lib/python3.6/test/test_opcodes.py +135 -0
- package/python3.6.2/lib/python3.6/test/test_openpty.py +21 -0
- package/python3.6.2/lib/python3.6/test/test_operator.py +609 -0
- package/python3.6.2/lib/python3.6/test/test_optparse.py +1664 -0
- package/python3.6.2/lib/python3.6/test/test_ordered_dict.py +787 -0
- package/python3.6.2/lib/python3.6/test/test_os.py +3548 -0
- package/python3.6.2/lib/python3.6/test/test_ossaudiodev.py +202 -0
- package/python3.6.2/lib/python3.6/test/test_osx_env.py +34 -0
- package/python3.6.2/lib/python3.6/test/test_parser.py +905 -0
- package/python3.6.2/lib/python3.6/test/test_pathlib.py +2252 -0
- package/python3.6.2/lib/python3.6/test/test_pdb.py +1124 -0
- package/python3.6.2/lib/python3.6/test/test_peepholer.py +325 -0
- package/python3.6.2/lib/python3.6/test/test_pickle.py +514 -0
- package/python3.6.2/lib/python3.6/test/test_pickletools.py +99 -0
- package/python3.6.2/lib/python3.6/test/test_pipes.py +203 -0
- package/python3.6.2/lib/python3.6/test/test_pkg.py +295 -0
- package/python3.6.2/lib/python3.6/test/test_pkgimport.py +80 -0
- package/python3.6.2/lib/python3.6/test/test_pkgutil.py +491 -0
- package/python3.6.2/lib/python3.6/test/test_platform.py +370 -0
- package/python3.6.2/lib/python3.6/test/test_plistlib.py +662 -0
- package/python3.6.2/lib/python3.6/test/test_poll.py +238 -0
- package/python3.6.2/lib/python3.6/test/test_popen.py +65 -0
- package/python3.6.2/lib/python3.6/test/test_poplib.py +520 -0
- package/python3.6.2/lib/python3.6/test/test_posix.py +1298 -0
- package/python3.6.2/lib/python3.6/test/test_posixpath.py +680 -0
- package/python3.6.2/lib/python3.6/test/test_pow.py +123 -0
- package/python3.6.2/lib/python3.6/test/test_pprint.py +1012 -0
- package/python3.6.2/lib/python3.6/test/test_print.py +193 -0
- package/python3.6.2/lib/python3.6/test/test_profile.py +187 -0
- package/python3.6.2/lib/python3.6/test/test_property.py +272 -0
- package/python3.6.2/lib/python3.6/test/test_pstats.py +38 -0
- package/python3.6.2/lib/python3.6/test/test_pty.py +316 -0
- package/python3.6.2/lib/python3.6/test/test_pulldom.py +342 -0
- package/python3.6.2/lib/python3.6/test/test_pwd.py +125 -0
- package/python3.6.2/lib/python3.6/test/test_py_compile.py +127 -0
- package/python3.6.2/lib/python3.6/test/test_pyclbr.py +176 -0
- package/python3.6.2/lib/python3.6/test/test_pydoc.py +1107 -0
- package/python3.6.2/lib/python3.6/test/test_pyexpat.py +733 -0
- package/python3.6.2/lib/python3.6/test/test_queue.py +362 -0
- package/python3.6.2/lib/python3.6/test/test_quopri.py +210 -0
- package/python3.6.2/lib/python3.6/test/test_raise.py +419 -0
- package/python3.6.2/lib/python3.6/test/test_random.py +939 -0
- package/python3.6.2/lib/python3.6/test/test_range.py +693 -0
- package/python3.6.2/lib/python3.6/test/test_re.py +2087 -0
- package/python3.6.2/lib/python3.6/test/test_readline.py +309 -0
- package/python3.6.2/lib/python3.6/test/test_regrtest.py +967 -0
- package/python3.6.2/lib/python3.6/test/test_repl.py +62 -0
- package/python3.6.2/lib/python3.6/test/test_reprlib.py +405 -0
- package/python3.6.2/lib/python3.6/test/test_resource.py +180 -0
- package/python3.6.2/lib/python3.6/test/test_richcmp.py +355 -0
- package/python3.6.2/lib/python3.6/test/test_rlcompleter.py +141 -0
- package/python3.6.2/lib/python3.6/test/test_robotparser.py +335 -0
- package/python3.6.2/lib/python3.6/test/test_runpy.py +749 -0
- package/python3.6.2/lib/python3.6/test/test_sax.py +1273 -0
- package/python3.6.2/lib/python3.6/test/test_sched.py +204 -0
- package/python3.6.2/lib/python3.6/test/test_scope.py +761 -0
- package/python3.6.2/lib/python3.6/test/test_script_helper.py +110 -0
- package/python3.6.2/lib/python3.6/test/test_secrets.py +124 -0
- package/python3.6.2/lib/python3.6/test/test_select.py +82 -0
- package/python3.6.2/lib/python3.6/test/test_selectors.py +526 -0
- package/python3.6.2/lib/python3.6/test/test_set.py +1903 -0
- package/python3.6.2/lib/python3.6/test/test_setcomps.py +151 -0
- package/python3.6.2/lib/python3.6/test/test_shelve.py +228 -0
- package/python3.6.2/lib/python3.6/test/test_shlex.py +318 -0
- package/python3.6.2/lib/python3.6/test/test_shutil.py +1925 -0
- package/python3.6.2/lib/python3.6/test/test_signal.py +1093 -0
- package/python3.6.2/lib/python3.6/test/test_site.py +595 -0
- package/python3.6.2/lib/python3.6/test/test_slice.py +255 -0
- package/python3.6.2/lib/python3.6/test/test_smtpd.py +1013 -0
- package/python3.6.2/lib/python3.6/test/test_smtplib.py +1292 -0
- package/python3.6.2/lib/python3.6/test/test_smtpnet.py +83 -0
- package/python3.6.2/lib/python3.6/test/test_sndhdr.py +37 -0
- package/python3.6.2/lib/python3.6/test/test_socket.py +5648 -0
- package/python3.6.2/lib/python3.6/test/test_socketserver.py +505 -0
- package/python3.6.2/lib/python3.6/test/test_sort.py +265 -0
- package/python3.6.2/lib/python3.6/test/test_source_encoding.py +225 -0
- package/python3.6.2/lib/python3.6/test/test_spwd.py +75 -0
- package/python3.6.2/lib/python3.6/test/test_sqlite.py +24 -0
- package/python3.6.2/lib/python3.6/test/test_ssl.py +3663 -0
- package/python3.6.2/lib/python3.6/test/test_startfile.py +34 -0
- package/python3.6.2/lib/python3.6/test/test_stat.py +234 -0
- package/python3.6.2/lib/python3.6/test/test_statistics.py +1992 -0
- package/python3.6.2/lib/python3.6/test/test_strftime.py +206 -0
- package/python3.6.2/lib/python3.6/test/test_string.py +439 -0
- package/python3.6.2/lib/python3.6/test/test_string_literals.py +249 -0
- package/python3.6.2/lib/python3.6/test/test_stringprep.py +92 -0
- package/python3.6.2/lib/python3.6/test/test_strptime.py +673 -0
- package/python3.6.2/lib/python3.6/test/test_strtod.py +433 -0
- package/python3.6.2/lib/python3.6/test/test_struct.py +756 -0
- package/python3.6.2/lib/python3.6/test/test_structmembers.py +144 -0
- package/python3.6.2/lib/python3.6/test/test_structseq.py +126 -0
- package/python3.6.2/lib/python3.6/test/test_subclassinit.py +284 -0
- package/python3.6.2/lib/python3.6/test/test_subprocess.py +3005 -0
- package/python3.6.2/lib/python3.6/test/test_sunau.py +121 -0
- package/python3.6.2/lib/python3.6/test/test_sundry.py +57 -0
- package/python3.6.2/lib/python3.6/test/test_super.py +347 -0
- package/python3.6.2/lib/python3.6/test/test_support.py +459 -0
- package/python3.6.2/lib/python3.6/test/test_symbol.py +54 -0
- package/python3.6.2/lib/python3.6/test/test_symtable.py +193 -0
- package/python3.6.2/lib/python3.6/test/test_syntax.py +618 -0
- package/python3.6.2/lib/python3.6/test/test_sys.py +1270 -0
- package/python3.6.2/lib/python3.6/test/test_sys_setprofile.py +376 -0
- package/python3.6.2/lib/python3.6/test/test_sys_settrace.py +854 -0
- package/python3.6.2/lib/python3.6/test/test_sysconfig.py +445 -0
- package/python3.6.2/lib/python3.6/test/test_syslog.py +40 -0
- package/python3.6.2/lib/python3.6/test/test_tarfile.py +2635 -0
- package/python3.6.2/lib/python3.6/test/test_tcl.py +715 -0
- package/python3.6.2/lib/python3.6/test/test_telnetlib.py +401 -0
- package/python3.6.2/lib/python3.6/test/test_tempfile.py +1458 -0
- package/python3.6.2/lib/python3.6/test/test_textwrap.py +981 -0
- package/python3.6.2/lib/python3.6/test/test_thread.py +269 -0
- package/python3.6.2/lib/python3.6/test/test_threaded_import.py +254 -0
- package/python3.6.2/lib/python3.6/test/test_threadedtempfile.py +62 -0
- package/python3.6.2/lib/python3.6/test/test_threading.py +1170 -0
- package/python3.6.2/lib/python3.6/test/test_threading_local.py +220 -0
- package/python3.6.2/lib/python3.6/test/test_threadsignals.py +227 -0
- package/python3.6.2/lib/python3.6/test/test_time.py +1000 -0
- package/python3.6.2/lib/python3.6/test/test_timeit.py +381 -0
- package/python3.6.2/lib/python3.6/test/test_timeout.py +303 -0
- package/python3.6.2/lib/python3.6/test/test_tix.py +32 -0
- package/python3.6.2/lib/python3.6/test/test_tk.py +15 -0
- package/python3.6.2/lib/python3.6/test/test_tokenize.py +1590 -0
- package/python3.6.2/lib/python3.6/test/test_tools/__init__.py +24 -0
- package/python3.6.2/lib/python3.6/test/test_tools/__main__.py +4 -0
- package/python3.6.2/lib/python3.6/test/test_tools/test_fixcid.py +92 -0
- package/python3.6.2/lib/python3.6/test/test_tools/test_gprof2html.py +35 -0
- package/python3.6.2/lib/python3.6/test/test_tools/test_i18n.py +72 -0
- package/python3.6.2/lib/python3.6/test/test_tools/test_md5sum.py +76 -0
- package/python3.6.2/lib/python3.6/test/test_tools/test_pdeps.py +32 -0
- package/python3.6.2/lib/python3.6/test/test_tools/test_pindent.py +339 -0
- package/python3.6.2/lib/python3.6/test/test_tools/test_reindent.py +35 -0
- package/python3.6.2/lib/python3.6/test/test_tools/test_sundry.py +53 -0
- package/python3.6.2/lib/python3.6/test/test_tools/test_unparse.py +313 -0
- package/python3.6.2/lib/python3.6/test/test_trace.py +391 -0
- package/python3.6.2/lib/python3.6/test/test_traceback.py +1111 -0
- package/python3.6.2/lib/python3.6/test/test_tracemalloc.py +994 -0
- package/python3.6.2/lib/python3.6/test/test_ttk_guionly.py +34 -0
- package/python3.6.2/lib/python3.6/test/test_ttk_textonly.py +13 -0
- package/python3.6.2/lib/python3.6/test/test_tuple.py +221 -0
- package/python3.6.2/lib/python3.6/test/test_turtle.py +436 -0
- package/python3.6.2/lib/python3.6/test/test_typechecks.py +71 -0
- package/python3.6.2/lib/python3.6/test/test_types.py +1550 -0
- package/python3.6.2/lib/python3.6/test/test_typing.py +2577 -0
- package/python3.6.2/lib/python3.6/test/test_ucn.py +237 -0
- package/python3.6.2/lib/python3.6/test/test_unary.py +53 -0
- package/python3.6.2/lib/python3.6/test/test_unicode.py +2894 -0
- package/python3.6.2/lib/python3.6/test/test_unicode_file.py +140 -0
- package/python3.6.2/lib/python3.6/test/test_unicode_file_functions.py +195 -0
- package/python3.6.2/lib/python3.6/test/test_unicode_identifiers.py +31 -0
- package/python3.6.2/lib/python3.6/test/test_unicodedata.py +316 -0
- package/python3.6.2/lib/python3.6/test/test_unittest.py +16 -0
- package/python3.6.2/lib/python3.6/test/test_univnewlines.py +123 -0
- package/python3.6.2/lib/python3.6/test/test_unpack.py +151 -0
- package/python3.6.2/lib/python3.6/test/test_unpack_ex.py +365 -0
- package/python3.6.2/lib/python3.6/test/test_urllib.py +1572 -0
- package/python3.6.2/lib/python3.6/test/test_urllib2.py +1930 -0
- package/python3.6.2/lib/python3.6/test/test_urllib2_localnet.py +679 -0
- package/python3.6.2/lib/python3.6/test/test_urllib2net.py +329 -0
- package/python3.6.2/lib/python3.6/test/test_urllib_response.py +59 -0
- package/python3.6.2/lib/python3.6/test/test_urllibnet.py +218 -0
- package/python3.6.2/lib/python3.6/test/test_urlparse.py +1122 -0
- package/python3.6.2/lib/python3.6/test/test_userdict.py +220 -0
- package/python3.6.2/lib/python3.6/test/test_userlist.py +63 -0
- package/python3.6.2/lib/python3.6/test/test_userstring.py +44 -0
- package/python3.6.2/lib/python3.6/test/test_utf8source.py +43 -0
- package/python3.6.2/lib/python3.6/test/test_uu.py +260 -0
- package/python3.6.2/lib/python3.6/test/test_uuid.py +511 -0
- package/python3.6.2/lib/python3.6/test/test_venv.py +433 -0
- package/python3.6.2/lib/python3.6/test/test_wait3.py +38 -0
- package/python3.6.2/lib/python3.6/test/test_wait4.py +39 -0
- package/python3.6.2/lib/python3.6/test/test_warnings/__init__.py +1216 -0
- package/python3.6.2/lib/python3.6/test/test_warnings/__main__.py +3 -0
- package/python3.6.2/lib/python3.6/test/test_warnings/data/import_warning.py +3 -0
- package/python3.6.2/lib/python3.6/test/test_warnings/data/stacklevel.py +9 -0
- package/python3.6.2/lib/python3.6/test/test_wave.py +113 -0
- package/python3.6.2/lib/python3.6/test/test_weakref.py +1952 -0
- package/python3.6.2/lib/python3.6/test/test_weakset.py +439 -0
- package/python3.6.2/lib/python3.6/test/test_webbrowser.py +217 -0
- package/python3.6.2/lib/python3.6/test/test_winconsoleio.py +191 -0
- package/python3.6.2/lib/python3.6/test/test_winreg.py +498 -0
- package/python3.6.2/lib/python3.6/test/test_winsound.py +150 -0
- package/python3.6.2/lib/python3.6/test/test_with.py +746 -0
- package/python3.6.2/lib/python3.6/test/test_wsgiref.py +785 -0
- package/python3.6.2/lib/python3.6/test/test_xdrlib.py +77 -0
- package/python3.6.2/lib/python3.6/test/test_xml_dom_minicompat.py +138 -0
- package/python3.6.2/lib/python3.6/test/test_xml_etree.py +3166 -0
- package/python3.6.2/lib/python3.6/test/test_xml_etree_c.py +188 -0
- package/python3.6.2/lib/python3.6/test/test_xmlrpc.py +1415 -0
- package/python3.6.2/lib/python3.6/test/test_xmlrpc_net.py +32 -0
- package/python3.6.2/lib/python3.6/test/test_yield_from.py +1052 -0
- package/python3.6.2/lib/python3.6/test/test_zipapp.py +349 -0
- package/python3.6.2/lib/python3.6/test/test_zipfile.py +2241 -0
- package/python3.6.2/lib/python3.6/test/test_zipfile64.py +155 -0
- package/python3.6.2/lib/python3.6/test/test_zipimport.py +759 -0
- package/python3.6.2/lib/python3.6/test/test_zipimport_support.py +244 -0
- package/python3.6.2/lib/python3.6/test/test_zlib.py +898 -0
- package/python3.6.2/lib/python3.6/test/testcodec.py +48 -0
- package/python3.6.2/lib/python3.6/test/testtar.tar +0 -0
- package/python3.6.2/lib/python3.6/test/tf_inherit_check.py +27 -0
- package/python3.6.2/lib/python3.6/test/threaded_import_hangers.py +45 -0
- package/python3.6.2/lib/python3.6/test/time_hashlib.py +88 -0
- package/python3.6.2/lib/python3.6/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt +13 -0
- package/python3.6.2/lib/python3.6/test/tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt +11 -0
- package/python3.6.2/lib/python3.6/test/tokenize_tests-utf8-coding-cookie-and-no-utf8-bom-sig.txt +13 -0
- package/python3.6.2/lib/python3.6/test/tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt +12 -0
- package/python3.6.2/lib/python3.6/test/tokenize_tests.txt +189 -0
- package/python3.6.2/lib/python3.6/test/tracedmodules/__init__.py +4 -0
- package/python3.6.2/lib/python3.6/test/tracedmodules/testmod.py +9 -0
- package/python3.6.2/lib/python3.6/test/win_console_handler.py +49 -0
- package/python3.6.2/lib/python3.6/test/wrongcert.pem +32 -0
- package/python3.6.2/lib/python3.6/test/xmltestdata/expat224_utf8_bug.xml +2 -0
- package/python3.6.2/lib/python3.6/test/xmltestdata/simple-ns.xml +7 -0
- package/python3.6.2/lib/python3.6/test/xmltestdata/simple.xml +6 -0
- package/python3.6.2/lib/python3.6/test/xmltestdata/test.xml +115 -0
- package/python3.6.2/lib/python3.6/test/xmltestdata/test.xml.out +115 -0
- package/python3.6.2/lib/python3.6/test/xmltests.py +21 -0
- package/python3.6.2/lib/python3.6/test/zip_cp437_header.zip +0 -0
- package/python3.6.2/lib/python3.6/test/zipdir.zip +0 -0
- package/python3.6.2/lib/python3.6/textwrap.py +488 -0
- package/python3.6.2/lib/python3.6/this.py +28 -0
- package/python3.6.2/lib/python3.6/threading.py +1357 -0
- package/python3.6.2/lib/python3.6/timeit.py +362 -0
- package/python3.6.2/lib/python3.6/tkinter/__init__.py +4002 -0
- package/python3.6.2/lib/python3.6/tkinter/__main__.py +7 -0
- package/python3.6.2/lib/python3.6/tkinter/colorchooser.py +72 -0
- package/python3.6.2/lib/python3.6/tkinter/commondialog.py +55 -0
- package/python3.6.2/lib/python3.6/tkinter/constants.py +110 -0
- package/python3.6.2/lib/python3.6/tkinter/dialog.py +46 -0
- package/python3.6.2/lib/python3.6/tkinter/dnd.py +321 -0
- package/python3.6.2/lib/python3.6/tkinter/filedialog.py +479 -0
- package/python3.6.2/lib/python3.6/tkinter/font.py +232 -0
- package/python3.6.2/lib/python3.6/tkinter/messagebox.py +134 -0
- package/python3.6.2/lib/python3.6/tkinter/scrolledtext.py +54 -0
- package/python3.6.2/lib/python3.6/tkinter/simpledialog.py +423 -0
- package/python3.6.2/lib/python3.6/tkinter/test/README +14 -0
- package/python3.6.2/lib/python3.6/tkinter/test/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/tkinter/test/runtktests.py +69 -0
- package/python3.6.2/lib/python3.6/tkinter/test/support.py +105 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_font.py +96 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_geometry_managers.py +906 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_images.py +327 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_loadtk.py +46 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_misc.py +55 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_text.py +47 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_variables.py +310 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_widgets.py +1204 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_ttk/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_ttk/test_extensions.py +323 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_ttk/test_functions.py +461 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_ttk/test_style.py +92 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_ttk/test_widgets.py +1707 -0
- package/python3.6.2/lib/python3.6/tkinter/test/widget_tests.py +548 -0
- package/python3.6.2/lib/python3.6/tkinter/tix.py +1946 -0
- package/python3.6.2/lib/python3.6/tkinter/ttk.py +1655 -0
- package/python3.6.2/lib/python3.6/token.py +143 -0
- package/python3.6.2/lib/python3.6/tokenize.py +793 -0
- package/python3.6.2/lib/python3.6/trace.py +742 -0
- package/python3.6.2/lib/python3.6/traceback.py +600 -0
- package/python3.6.2/lib/python3.6/tracemalloc.py +524 -0
- package/python3.6.2/lib/python3.6/tty.py +36 -0
- package/python3.6.2/lib/python3.6/turtle.py +4139 -0
- package/python3.6.2/lib/python3.6/turtledemo/__init__.py +14 -0
- package/python3.6.2/lib/python3.6/turtledemo/__main__.py +386 -0
- package/python3.6.2/lib/python3.6/turtledemo/bytedesign.py +161 -0
- package/python3.6.2/lib/python3.6/turtledemo/chaos.py +59 -0
- package/python3.6.2/lib/python3.6/turtledemo/clock.py +132 -0
- package/python3.6.2/lib/python3.6/turtledemo/colormixer.py +58 -0
- package/python3.6.2/lib/python3.6/turtledemo/forest.py +108 -0
- package/python3.6.2/lib/python3.6/turtledemo/fractalcurves.py +138 -0
- package/python3.6.2/lib/python3.6/turtledemo/lindenmayer.py +119 -0
- package/python3.6.2/lib/python3.6/turtledemo/minimal_hanoi.py +79 -0
- package/python3.6.2/lib/python3.6/turtledemo/nim.py +226 -0
- package/python3.6.2/lib/python3.6/turtledemo/paint.py +54 -0
- package/python3.6.2/lib/python3.6/turtledemo/peace.py +61 -0
- package/python3.6.2/lib/python3.6/turtledemo/penrose.py +181 -0
- package/python3.6.2/lib/python3.6/turtledemo/planet_and_moon.py +111 -0
- package/python3.6.2/lib/python3.6/turtledemo/round_dance.py +86 -0
- package/python3.6.2/lib/python3.6/turtledemo/sorting_animate.py +204 -0
- package/python3.6.2/lib/python3.6/turtledemo/tree.py +63 -0
- package/python3.6.2/lib/python3.6/turtledemo/turtle.cfg +10 -0
- package/python3.6.2/lib/python3.6/turtledemo/two_canvases.py +54 -0
- package/python3.6.2/lib/python3.6/turtledemo/wikipedia.py +65 -0
- package/python3.6.2/lib/python3.6/turtledemo/yinyang.py +49 -0
- package/python3.6.2/lib/python3.6/types.py +266 -0
- package/python3.6.2/lib/python3.6/typing.py +2403 -0
- package/python3.6.2/lib/python3.6/unittest/__init__.py +78 -0
- package/python3.6.2/lib/python3.6/unittest/__main__.py +18 -0
- package/python3.6.2/lib/python3.6/unittest/case.py +1429 -0
- package/python3.6.2/lib/python3.6/unittest/loader.py +508 -0
- package/python3.6.2/lib/python3.6/unittest/main.py +260 -0
- package/python3.6.2/lib/python3.6/unittest/mock.py +2407 -0
- package/python3.6.2/lib/python3.6/unittest/result.py +216 -0
- package/python3.6.2/lib/python3.6/unittest/runner.py +221 -0
- package/python3.6.2/lib/python3.6/unittest/signals.py +71 -0
- package/python3.6.2/lib/python3.6/unittest/suite.py +321 -0
- package/python3.6.2/lib/python3.6/unittest/test/__init__.py +22 -0
- package/python3.6.2/lib/python3.6/unittest/test/__main__.py +18 -0
- package/python3.6.2/lib/python3.6/unittest/test/_test_warnings.py +73 -0
- package/python3.6.2/lib/python3.6/unittest/test/dummy.py +1 -0
- package/python3.6.2/lib/python3.6/unittest/test/support.py +138 -0
- package/python3.6.2/lib/python3.6/unittest/test/test_assertions.py +411 -0
- package/python3.6.2/lib/python3.6/unittest/test/test_break.py +291 -0
- package/python3.6.2/lib/python3.6/unittest/test/test_case.py +1833 -0
- package/python3.6.2/lib/python3.6/unittest/test/test_discovery.py +872 -0
- package/python3.6.2/lib/python3.6/unittest/test/test_functiontestcase.py +148 -0
- package/python3.6.2/lib/python3.6/unittest/test/test_loader.py +1529 -0
- package/python3.6.2/lib/python3.6/unittest/test/test_program.py +414 -0
- package/python3.6.2/lib/python3.6/unittest/test/test_result.py +695 -0
- package/python3.6.2/lib/python3.6/unittest/test/test_runner.py +353 -0
- package/python3.6.2/lib/python3.6/unittest/test/test_setups.py +507 -0
- package/python3.6.2/lib/python3.6/unittest/test/test_skipping.py +260 -0
- package/python3.6.2/lib/python3.6/unittest/test/test_suite.py +447 -0
- package/python3.6.2/lib/python3.6/unittest/test/testmock/__init__.py +17 -0
- package/python3.6.2/lib/python3.6/unittest/test/testmock/__main__.py +18 -0
- package/python3.6.2/lib/python3.6/unittest/test/testmock/support.py +21 -0
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testcallable.py +151 -0
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testhelpers.py +946 -0
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testmagicmethods.py +468 -0
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testmock.py +1569 -0
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testpatch.py +1853 -0
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testsentinel.py +28 -0
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testwith.py +301 -0
- package/python3.6.2/lib/python3.6/unittest/util.py +177 -0
- package/python3.6.2/lib/python3.6/urllib/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/urllib/error.py +77 -0
- package/python3.6.2/lib/python3.6/urllib/parse.py +1021 -0
- package/python3.6.2/lib/python3.6/urllib/request.py +2739 -0
- package/python3.6.2/lib/python3.6/urllib/response.py +80 -0
- package/python3.6.2/lib/python3.6/urllib/robotparser.py +250 -0
- package/python3.6.2/lib/python3.6/uu.py +199 -0
- package/python3.6.2/lib/python3.6/uuid.py +629 -0
- package/python3.6.2/lib/python3.6/venv/__init__.py +425 -0
- package/python3.6.2/lib/python3.6/venv/__main__.py +10 -0
- package/python3.6.2/lib/python3.6/venv/scripts/nt/Activate.ps1 +51 -0
- package/python3.6.2/lib/python3.6/venv/scripts/nt/activate.bat +32 -0
- package/python3.6.2/lib/python3.6/venv/scripts/nt/deactivate.bat +21 -0
- package/python3.6.2/lib/python3.6/warnings.py +526 -0
- package/python3.6.2/lib/python3.6/wave.py +505 -0
- package/python3.6.2/lib/python3.6/weakref.py +632 -0
- package/python3.6.2/lib/python3.6/webbrowser.py +664 -0
- package/python3.6.2/lib/python3.6/wsgiref/__init__.py +23 -0
- package/python3.6.2/lib/python3.6/wsgiref/handlers.py +557 -0
- package/python3.6.2/lib/python3.6/wsgiref/headers.py +184 -0
- package/python3.6.2/lib/python3.6/wsgiref/simple_server.py +164 -0
- package/python3.6.2/lib/python3.6/wsgiref/util.py +165 -0
- package/python3.6.2/lib/python3.6/wsgiref/validate.py +443 -0
- package/python3.6.2/lib/python3.6/xdrlib.py +241 -0
- package/python3.6.2/lib/python3.6/xml/__init__.py +20 -0
- package/python3.6.2/lib/python3.6/xml/dom/NodeFilter.py +27 -0
- package/python3.6.2/lib/python3.6/xml/dom/__init__.py +140 -0
- package/python3.6.2/lib/python3.6/xml/dom/domreg.py +97 -0
- package/python3.6.2/lib/python3.6/xml/dom/expatbuilder.py +965 -0
- package/python3.6.2/lib/python3.6/xml/dom/minicompat.py +109 -0
- package/python3.6.2/lib/python3.6/xml/dom/minidom.py +1981 -0
- package/python3.6.2/lib/python3.6/xml/dom/pulldom.py +342 -0
- package/python3.6.2/lib/python3.6/xml/dom/xmlbuilder.py +410 -0
- package/python3.6.2/lib/python3.6/xml/etree/ElementInclude.py +143 -0
- package/python3.6.2/lib/python3.6/xml/etree/ElementPath.py +314 -0
- package/python3.6.2/lib/python3.6/xml/etree/ElementTree.py +1656 -0
- package/python3.6.2/lib/python3.6/xml/etree/__init__.py +33 -0
- package/python3.6.2/lib/python3.6/xml/etree/cElementTree.py +3 -0
- package/python3.6.2/lib/python3.6/xml/parsers/__init__.py +8 -0
- package/python3.6.2/lib/python3.6/xml/parsers/expat.py +8 -0
- package/python3.6.2/lib/python3.6/xml/sax/__init__.py +107 -0
- package/python3.6.2/lib/python3.6/xml/sax/_exceptions.py +131 -0
- package/python3.6.2/lib/python3.6/xml/sax/expatreader.py +446 -0
- package/python3.6.2/lib/python3.6/xml/sax/handler.py +342 -0
- package/python3.6.2/lib/python3.6/xml/sax/saxutils.py +368 -0
- package/python3.6.2/lib/python3.6/xml/sax/xmlreader.py +380 -0
- package/python3.6.2/lib/python3.6/xmlrpc/__init__.py +1 -0
- package/python3.6.2/lib/python3.6/xmlrpc/client.py +1518 -0
- package/python3.6.2/lib/python3.6/xmlrpc/server.py +1002 -0
- package/python3.6.2/lib/python3.6/zipapp.py +201 -0
- package/python3.6.2/lib/python3.6/zipfile.py +2036 -0
- package/python3.6.2/lib/python3.6/LICENSE.txt +0 -254
- package/python3.6.2/lib/python3.6/__future__.pyc +0 -0
- package/python3.6.2/lib/python3.6/__phello__.foo.pyc +0 -0
- package/python3.6.2/lib/python3.6/_bootlocale.pyc +0 -0
- package/python3.6.2/lib/python3.6/_collections_abc.pyc +0 -0
- package/python3.6.2/lib/python3.6/_compat_pickle.pyc +0 -0
- package/python3.6.2/lib/python3.6/_compression.pyc +0 -0
- package/python3.6.2/lib/python3.6/_dummy_thread.pyc +0 -0
- package/python3.6.2/lib/python3.6/_markupbase.pyc +0 -0
- package/python3.6.2/lib/python3.6/_osx_support.pyc +0 -0
- package/python3.6.2/lib/python3.6/_pydecimal.pyc +0 -0
- package/python3.6.2/lib/python3.6/_pyio.pyc +0 -0
- package/python3.6.2/lib/python3.6/_sitebuiltins.pyc +0 -0
- package/python3.6.2/lib/python3.6/_strptime.pyc +0 -0
- package/python3.6.2/lib/python3.6/_threading_local.pyc +0 -0
- package/python3.6.2/lib/python3.6/_weakrefset.pyc +0 -0
- package/python3.6.2/lib/python3.6/abc.pyc +0 -0
- package/python3.6.2/lib/python3.6/aifc.pyc +0 -0
- package/python3.6.2/lib/python3.6/android.pyc +0 -0
- package/python3.6.2/lib/python3.6/antigravity.pyc +0 -0
- package/python3.6.2/lib/python3.6/argparse.pyc +0 -0
- package/python3.6.2/lib/python3.6/ast.pyc +0 -0
- package/python3.6.2/lib/python3.6/asynchat.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/base_events.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/base_futures.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/base_subprocess.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/base_tasks.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/compat.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/constants.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/coroutines.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/events.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/futures.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/locks.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/log.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/proactor_events.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/protocols.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/queues.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/selector_events.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/sslproto.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/streams.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/subprocess.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/tasks.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/test_utils.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/transports.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/unix_events.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/windows_events.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/windows_utils.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncore.pyc +0 -0
- package/python3.6.2/lib/python3.6/base64.pyc +0 -0
- package/python3.6.2/lib/python3.6/bdb.pyc +0 -0
- package/python3.6.2/lib/python3.6/binhex.pyc +0 -0
- package/python3.6.2/lib/python3.6/bisect.pyc +0 -0
- package/python3.6.2/lib/python3.6/bz2.pyc +0 -0
- package/python3.6.2/lib/python3.6/cProfile.pyc +0 -0
- package/python3.6.2/lib/python3.6/calendar.pyc +0 -0
- package/python3.6.2/lib/python3.6/cgi.pyc +0 -0
- package/python3.6.2/lib/python3.6/cgitb.pyc +0 -0
- package/python3.6.2/lib/python3.6/chunk.pyc +0 -0
- package/python3.6.2/lib/python3.6/cmd.pyc +0 -0
- package/python3.6.2/lib/python3.6/code.pyc +0 -0
- package/python3.6.2/lib/python3.6/codecs.pyc +0 -0
- package/python3.6.2/lib/python3.6/codeop.pyc +0 -0
- package/python3.6.2/lib/python3.6/collections/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/collections/abc.pyc +0 -0
- package/python3.6.2/lib/python3.6/colorsys.pyc +0 -0
- package/python3.6.2/lib/python3.6/compileall.pyc +0 -0
- package/python3.6.2/lib/python3.6/concurrent/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/concurrent/futures/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/concurrent/futures/_base.pyc +0 -0
- package/python3.6.2/lib/python3.6/concurrent/futures/process.pyc +0 -0
- package/python3.6.2/lib/python3.6/concurrent/futures/thread.pyc +0 -0
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/Makefile +0 -1808
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/Setup +0 -397
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/Setup.config +0 -10
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/Setup.local +0 -1
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/config.c +0 -114
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/config.c.in +0 -67
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/install-sh +0 -294
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/makesetup +0 -296
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/python-config.pyc +0 -0
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/python.o +0 -0
- package/python3.6.2/lib/python3.6/configparser.pyc +0 -0
- package/python3.6.2/lib/python3.6/contextlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/copy.pyc +0 -0
- package/python3.6.2/lib/python3.6/copyreg.pyc +0 -0
- package/python3.6.2/lib/python3.6/crypt.pyc +0 -0
- package/python3.6.2/lib/python3.6/csv.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/_endian.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/macholib/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/macholib/dyld.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/macholib/dylib.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/macholib/framework.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/util.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/wintypes.pyc +0 -0
- package/python3.6.2/lib/python3.6/curses/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/curses/ascii.pyc +0 -0
- package/python3.6.2/lib/python3.6/curses/has_key.pyc +0 -0
- package/python3.6.2/lib/python3.6/curses/panel.pyc +0 -0
- package/python3.6.2/lib/python3.6/curses/textpad.pyc +0 -0
- package/python3.6.2/lib/python3.6/datetime.pyc +0 -0
- package/python3.6.2/lib/python3.6/dbm/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/dbm/dumb.pyc +0 -0
- package/python3.6.2/lib/python3.6/dbm/gnu.pyc +0 -0
- package/python3.6.2/lib/python3.6/dbm/ndbm.pyc +0 -0
- package/python3.6.2/lib/python3.6/decimal.pyc +0 -0
- package/python3.6.2/lib/python3.6/difflib.pyc +0 -0
- package/python3.6.2/lib/python3.6/dis.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/_msvccompiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/archive_util.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/bcppcompiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/ccompiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/cmd.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist_dumb.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist_msi.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist_rpm.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist_wininst.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/build.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/build_clib.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/build_ext.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/build_py.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/build_scripts.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/check.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/clean.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/config.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/install.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_data.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_egg_info.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_headers.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_lib.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_scripts.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/register.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/sdist.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/upload.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/config.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/core.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/cygwinccompiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/debug.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/dep_util.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/dir_util.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/dist.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/errors.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/extension.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/fancy_getopt.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/file_util.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/filelist.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/log.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/msvc9compiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/msvccompiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/spawn.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/sysconfig.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/text_file.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/unixccompiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/util.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/version.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/versionpredicate.pyc +0 -0
- package/python3.6.2/lib/python3.6/doctest.pyc +0 -0
- package/python3.6.2/lib/python3.6/dummy_threading.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/_encoded_words.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/_header_value_parser.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/_parseaddr.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/_policybase.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/base64mime.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/charset.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/contentmanager.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/encoders.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/errors.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/feedparser.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/generator.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/header.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/headerregistry.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/iterators.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/message.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/application.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/audio.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/base.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/image.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/message.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/multipart.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/nonmultipart.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/text.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/parser.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/policy.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/quoprimime.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/utils.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/aliases.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/ascii.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/base64_codec.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/big5.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/big5hkscs.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/bz2_codec.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/charmap.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp037.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1006.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1026.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1125.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1140.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1250.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1251.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1252.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1253.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1254.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1255.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1256.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1257.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1258.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp273.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp424.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp437.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp500.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp65001.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp720.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp737.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp775.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp850.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp852.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp855.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp856.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp857.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp858.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp860.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp861.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp862.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp863.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp864.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp865.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp866.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp869.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp874.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp875.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp932.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp949.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp950.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/euc_jis_2004.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/euc_jisx0213.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/euc_jp.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/euc_kr.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/gb18030.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/gb2312.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/gbk.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/hex_codec.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/hp_roman8.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/hz.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/idna.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_1.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_2.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_2004.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_3.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_ext.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_kr.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_1.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_10.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_11.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_13.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_14.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_15.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_16.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_2.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_3.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_4.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_5.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_6.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_7.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_8.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_9.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/johab.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/koi8_r.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/koi8_t.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/koi8_u.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/kz1048.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/latin_1.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_arabic.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_centeuro.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_croatian.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_cyrillic.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_farsi.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_greek.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_iceland.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_latin2.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_roman.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_romanian.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_turkish.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mbcs.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/oem.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/palmos.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/ptcp154.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/punycode.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/quopri_codec.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/raw_unicode_escape.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/rot_13.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/shift_jis.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/shift_jis_2004.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/shift_jisx0213.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/tis_620.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/undefined.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/unicode_escape.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/unicode_internal.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_16.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_16_be.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_16_le.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_32.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_32_be.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_32_le.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_7.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_8.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_8_sig.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/uu_codec.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/zlib_codec.pyc +0 -0
- package/python3.6.2/lib/python3.6/ensurepip/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/ensurepip/__main__.pyc +0 -0
- package/python3.6.2/lib/python3.6/ensurepip/_uninstall.pyc +0 -0
- package/python3.6.2/lib/python3.6/enum.pyc +0 -0
- package/python3.6.2/lib/python3.6/filecmp.pyc +0 -0
- package/python3.6.2/lib/python3.6/fileinput.pyc +0 -0
- package/python3.6.2/lib/python3.6/fnmatch.pyc +0 -0
- package/python3.6.2/lib/python3.6/formatter.pyc +0 -0
- package/python3.6.2/lib/python3.6/fractions.pyc +0 -0
- package/python3.6.2/lib/python3.6/ftplib.pyc +0 -0
- package/python3.6.2/lib/python3.6/functools.pyc +0 -0
- package/python3.6.2/lib/python3.6/genericpath.pyc +0 -0
- package/python3.6.2/lib/python3.6/getopt.pyc +0 -0
- package/python3.6.2/lib/python3.6/getpass.pyc +0 -0
- package/python3.6.2/lib/python3.6/gettext.pyc +0 -0
- package/python3.6.2/lib/python3.6/glob.pyc +0 -0
- package/python3.6.2/lib/python3.6/gzip.pyc +0 -0
- package/python3.6.2/lib/python3.6/hashlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/heapq.pyc +0 -0
- package/python3.6.2/lib/python3.6/hmac.pyc +0 -0
- package/python3.6.2/lib/python3.6/html/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/html/entities.pyc +0 -0
- package/python3.6.2/lib/python3.6/html/parser.pyc +0 -0
- package/python3.6.2/lib/python3.6/http/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/http/client.pyc +0 -0
- package/python3.6.2/lib/python3.6/http/cookiejar.pyc +0 -0
- package/python3.6.2/lib/python3.6/http/cookies.pyc +0 -0
- package/python3.6.2/lib/python3.6/http/server.pyc +0 -0
- package/python3.6.2/lib/python3.6/imaplib.pyc +0 -0
- package/python3.6.2/lib/python3.6/imghdr.pyc +0 -0
- package/python3.6.2/lib/python3.6/imp.pyc +0 -0
- package/python3.6.2/lib/python3.6/importlib/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/importlib/_bootstrap.pyc +0 -0
- package/python3.6.2/lib/python3.6/importlib/_bootstrap_external.pyc +0 -0
- package/python3.6.2/lib/python3.6/importlib/abc.pyc +0 -0
- package/python3.6.2/lib/python3.6/importlib/machinery.pyc +0 -0
- package/python3.6.2/lib/python3.6/importlib/util.pyc +0 -0
- package/python3.6.2/lib/python3.6/inspect.pyc +0 -0
- package/python3.6.2/lib/python3.6/io.pyc +0 -0
- package/python3.6.2/lib/python3.6/ipaddress.pyc +0 -0
- package/python3.6.2/lib/python3.6/json/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/json/decoder.pyc +0 -0
- package/python3.6.2/lib/python3.6/json/encoder.pyc +0 -0
- package/python3.6.2/lib/python3.6/json/scanner.pyc +0 -0
- package/python3.6.2/lib/python3.6/json/tool.pyc +0 -0
- package/python3.6.2/lib/python3.6/keyword.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/Grammar3.6.3.final.0.pickle +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/PatternGrammar3.6.3.final.0.pickle +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/__main__.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/btm_matcher.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/btm_utils.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixer_base.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixer_util.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_apply.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_asserts.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_basestring.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_buffer.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_dict.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_except.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_exec.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_execfile.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_exitfunc.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_filter.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_funcattrs.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_future.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_getcwdu.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_has_key.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_idioms.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_import.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_imports.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_imports2.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_input.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_intern.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_isinstance.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_itertools.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_itertools_imports.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_long.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_map.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_metaclass.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_methodattrs.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_ne.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_next.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_nonzero.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_numliterals.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_operator.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_paren.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_print.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_raise.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_raw_input.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_reduce.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_reload.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_renames.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_repr.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_set_literal.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_standarderror.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_sys_exc.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_throw.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_tuple_params.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_types.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_unicode.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_urllib.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_ws_comma.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_xrange.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_xreadlines.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_zip.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/main.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/patcomp.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/conv.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/driver.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/grammar.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/literals.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/parse.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/pgen.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/token.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/tokenize.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pygram.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pytree.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/refactor.pyc +0 -0
- package/python3.6.2/lib/python3.6/linecache.pyc +0 -0
- package/python3.6.2/lib/python3.6/locale.pyc +0 -0
- package/python3.6.2/lib/python3.6/logging/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/logging/config.pyc +0 -0
- package/python3.6.2/lib/python3.6/logging/handlers.pyc +0 -0
- package/python3.6.2/lib/python3.6/lzma.pyc +0 -0
- package/python3.6.2/lib/python3.6/macpath.pyc +0 -0
- package/python3.6.2/lib/python3.6/macurl2path.pyc +0 -0
- package/python3.6.2/lib/python3.6/mailbox.pyc +0 -0
- package/python3.6.2/lib/python3.6/mailcap.pyc +0 -0
- package/python3.6.2/lib/python3.6/mimetypes.pyc +0 -0
- package/python3.6.2/lib/python3.6/modulefinder.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/connection.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/context.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/dummy/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/dummy/connection.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/forkserver.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/heap.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/managers.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/pool.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/popen_fork.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/popen_forkserver.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/popen_spawn_posix.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/popen_spawn_win32.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/process.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/queues.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/reduction.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/resource_sharer.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/semaphore_tracker.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/sharedctypes.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/spawn.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/synchronize.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/util.pyc +0 -0
- package/python3.6.2/lib/python3.6/netrc.pyc +0 -0
- package/python3.6.2/lib/python3.6/nntplib.pyc +0 -0
- package/python3.6.2/lib/python3.6/ntpath.pyc +0 -0
- package/python3.6.2/lib/python3.6/nturl2path.pyc +0 -0
- package/python3.6.2/lib/python3.6/numbers.pyc +0 -0
- package/python3.6.2/lib/python3.6/opcode.pyc +0 -0
- package/python3.6.2/lib/python3.6/operator.pyc +0 -0
- package/python3.6.2/lib/python3.6/optparse.pyc +0 -0
- package/python3.6.2/lib/python3.6/os.pyc +0 -0
- package/python3.6.2/lib/python3.6/pathlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/pdb.pyc +0 -0
- package/python3.6.2/lib/python3.6/pickle.pyc +0 -0
- package/python3.6.2/lib/python3.6/pickletools.pyc +0 -0
- package/python3.6.2/lib/python3.6/pipes.pyc +0 -0
- package/python3.6.2/lib/python3.6/pkgutil.pyc +0 -0
- package/python3.6.2/lib/python3.6/platform.pyc +0 -0
- package/python3.6.2/lib/python3.6/plistlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/poplib.pyc +0 -0
- package/python3.6.2/lib/python3.6/posixpath.pyc +0 -0
- package/python3.6.2/lib/python3.6/pprint.pyc +0 -0
- package/python3.6.2/lib/python3.6/profile.pyc +0 -0
- package/python3.6.2/lib/python3.6/pstats.pyc +0 -0
- package/python3.6.2/lib/python3.6/pty.pyc +0 -0
- package/python3.6.2/lib/python3.6/py_compile.pyc +0 -0
- package/python3.6.2/lib/python3.6/pyclbr.pyc +0 -0
- package/python3.6.2/lib/python3.6/pydoc.pyc +0 -0
- package/python3.6.2/lib/python3.6/pydoc_data/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/pydoc_data/topics.pyc +0 -0
- package/python3.6.2/lib/python3.6/queue.pyc +0 -0
- package/python3.6.2/lib/python3.6/quopri.pyc +0 -0
- package/python3.6.2/lib/python3.6/random.pyc +0 -0
- package/python3.6.2/lib/python3.6/re.pyc +0 -0
- package/python3.6.2/lib/python3.6/reprlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/rlcompleter.pyc +0 -0
- package/python3.6.2/lib/python3.6/runpy.pyc +0 -0
- package/python3.6.2/lib/python3.6/sched.pyc +0 -0
- package/python3.6.2/lib/python3.6/secrets.pyc +0 -0
- package/python3.6.2/lib/python3.6/selectors.pyc +0 -0
- package/python3.6.2/lib/python3.6/shelve.pyc +0 -0
- package/python3.6.2/lib/python3.6/shlex.pyc +0 -0
- package/python3.6.2/lib/python3.6/shutil.pyc +0 -0
- package/python3.6.2/lib/python3.6/signal.pyc +0 -0
- package/python3.6.2/lib/python3.6/site.pyc +0 -0
- package/python3.6.2/lib/python3.6/smtpd.pyc +0 -0
- package/python3.6.2/lib/python3.6/smtplib.pyc +0 -0
- package/python3.6.2/lib/python3.6/sndhdr.pyc +0 -0
- package/python3.6.2/lib/python3.6/socket.pyc +0 -0
- package/python3.6.2/lib/python3.6/socketserver.pyc +0 -0
- package/python3.6.2/lib/python3.6/sqlite3/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/sqlite3/dbapi2.pyc +0 -0
- package/python3.6.2/lib/python3.6/sqlite3/dump.pyc +0 -0
- package/python3.6.2/lib/python3.6/sre_compile.pyc +0 -0
- package/python3.6.2/lib/python3.6/sre_constants.pyc +0 -0
- package/python3.6.2/lib/python3.6/sre_parse.pyc +0 -0
- package/python3.6.2/lib/python3.6/ssl.pyc +0 -0
- package/python3.6.2/lib/python3.6/stat.pyc +0 -0
- package/python3.6.2/lib/python3.6/statistics.pyc +0 -0
- package/python3.6.2/lib/python3.6/string.pyc +0 -0
- package/python3.6.2/lib/python3.6/stringprep.pyc +0 -0
- package/python3.6.2/lib/python3.6/struct.pyc +0 -0
- package/python3.6.2/lib/python3.6/subprocess.pyc +0 -0
- package/python3.6.2/lib/python3.6/sunau.pyc +0 -0
- package/python3.6.2/lib/python3.6/symbol.pyc +0 -0
- package/python3.6.2/lib/python3.6/symtable.pyc +0 -0
- package/python3.6.2/lib/python3.6/sysconfig.pyc +0 -0
- package/python3.6.2/lib/python3.6/tabnanny.pyc +0 -0
- package/python3.6.2/lib/python3.6/tarfile.pyc +0 -0
- package/python3.6.2/lib/python3.6/telnetlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/tempfile.pyc +0 -0
- package/python3.6.2/lib/python3.6/textwrap.pyc +0 -0
- package/python3.6.2/lib/python3.6/this.pyc +0 -0
- package/python3.6.2/lib/python3.6/threading.pyc +0 -0
- package/python3.6.2/lib/python3.6/timeit.pyc +0 -0
- package/python3.6.2/lib/python3.6/token.pyc +0 -0
- package/python3.6.2/lib/python3.6/tokenize.pyc +0 -0
- package/python3.6.2/lib/python3.6/trace.pyc +0 -0
- package/python3.6.2/lib/python3.6/traceback.pyc +0 -0
- package/python3.6.2/lib/python3.6/tracemalloc.pyc +0 -0
- package/python3.6.2/lib/python3.6/tty.pyc +0 -0
- package/python3.6.2/lib/python3.6/turtle.pyc +0 -0
- package/python3.6.2/lib/python3.6/types.pyc +0 -0
- package/python3.6.2/lib/python3.6/typing.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/__main__.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/case.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/loader.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/main.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/mock.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/result.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/runner.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/signals.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/suite.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/util.pyc +0 -0
- package/python3.6.2/lib/python3.6/urllib/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/urllib/error.pyc +0 -0
- package/python3.6.2/lib/python3.6/urllib/parse.pyc +0 -0
- package/python3.6.2/lib/python3.6/urllib/request.pyc +0 -0
- package/python3.6.2/lib/python3.6/urllib/response.pyc +0 -0
- package/python3.6.2/lib/python3.6/urllib/robotparser.pyc +0 -0
- package/python3.6.2/lib/python3.6/uu.pyc +0 -0
- package/python3.6.2/lib/python3.6/uuid.pyc +0 -0
- package/python3.6.2/lib/python3.6/venv/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/venv/__main__.pyc +0 -0
- package/python3.6.2/lib/python3.6/warnings.pyc +0 -0
- package/python3.6.2/lib/python3.6/wave.pyc +0 -0
- package/python3.6.2/lib/python3.6/weakref.pyc +0 -0
- package/python3.6.2/lib/python3.6/webbrowser.pyc +0 -0
- package/python3.6.2/lib/python3.6/wsgiref/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/wsgiref/handlers.pyc +0 -0
- package/python3.6.2/lib/python3.6/wsgiref/headers.pyc +0 -0
- package/python3.6.2/lib/python3.6/wsgiref/simple_server.pyc +0 -0
- package/python3.6.2/lib/python3.6/wsgiref/util.pyc +0 -0
- package/python3.6.2/lib/python3.6/wsgiref/validate.pyc +0 -0
- package/python3.6.2/lib/python3.6/xdrlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/NodeFilter.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/domreg.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/expatbuilder.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/minicompat.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/minidom.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/pulldom.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/xmlbuilder.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/etree/ElementInclude.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/etree/ElementPath.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/etree/ElementTree.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/etree/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/etree/cElementTree.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/parsers/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/parsers/expat.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/sax/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/sax/_exceptions.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/sax/expatreader.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/sax/handler.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/sax/saxutils.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/sax/xmlreader.pyc +0 -0
- package/python3.6.2/lib/python3.6/xmlrpc/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/xmlrpc/client.pyc +0 -0
- package/python3.6.2/lib/python3.6/xmlrpc/server.pyc +0 -0
- package/python3.6.2/lib/python3.6/zipapp.pyc +0 -0
- package/python3.6.2/lib/python3.6/zipfile.pyc +0 -0
|
@@ -0,0 +1,4054 @@
|
|
|
1
|
+
"""Unit tests for the io module."""
|
|
2
|
+
|
|
3
|
+
# Tests of io are scattered over the test suite:
|
|
4
|
+
# * test_bufio - tests file buffering
|
|
5
|
+
# * test_memoryio - tests BytesIO and StringIO
|
|
6
|
+
# * test_fileio - tests FileIO
|
|
7
|
+
# * test_file - tests the file interface
|
|
8
|
+
# * test_io - tests everything else in the io module
|
|
9
|
+
# * test_univnewlines - tests universal newline support
|
|
10
|
+
# * test_largefile - tests operations on a file greater than 2**32 bytes
|
|
11
|
+
# (only enabled with -ulargefile)
|
|
12
|
+
|
|
13
|
+
################################################################################
|
|
14
|
+
# ATTENTION TEST WRITERS!!!
|
|
15
|
+
################################################################################
|
|
16
|
+
# When writing tests for io, it's important to test both the C and Python
|
|
17
|
+
# implementations. This is usually done by writing a base test that refers to
|
|
18
|
+
# the type it is testing as an attribute. Then it provides custom subclasses to
|
|
19
|
+
# test both implementations. This file has lots of examples.
|
|
20
|
+
################################################################################
|
|
21
|
+
|
|
22
|
+
import abc
|
|
23
|
+
import array
|
|
24
|
+
import errno
|
|
25
|
+
import locale
|
|
26
|
+
import os
|
|
27
|
+
import pickle
|
|
28
|
+
import random
|
|
29
|
+
import signal
|
|
30
|
+
import sys
|
|
31
|
+
import time
|
|
32
|
+
import unittest
|
|
33
|
+
import warnings
|
|
34
|
+
import weakref
|
|
35
|
+
from collections import deque, UserList
|
|
36
|
+
from itertools import cycle, count
|
|
37
|
+
from test import support
|
|
38
|
+
from test.support.script_helper import assert_python_ok, run_python_until_end
|
|
39
|
+
|
|
40
|
+
import codecs
|
|
41
|
+
import io # C implementation of io
|
|
42
|
+
import _pyio as pyio # Python implementation of io
|
|
43
|
+
try:
|
|
44
|
+
import threading
|
|
45
|
+
except ImportError:
|
|
46
|
+
threading = None
|
|
47
|
+
|
|
48
|
+
try:
|
|
49
|
+
import ctypes
|
|
50
|
+
except ImportError:
|
|
51
|
+
def byteslike(*pos, **kw):
|
|
52
|
+
return array.array("b", bytes(*pos, **kw))
|
|
53
|
+
else:
|
|
54
|
+
def byteslike(*pos, **kw):
|
|
55
|
+
"""Create a bytes-like object having no string or sequence methods"""
|
|
56
|
+
data = bytes(*pos, **kw)
|
|
57
|
+
obj = EmptyStruct()
|
|
58
|
+
ctypes.resize(obj, len(data))
|
|
59
|
+
memoryview(obj).cast("B")[:] = data
|
|
60
|
+
return obj
|
|
61
|
+
class EmptyStruct(ctypes.Structure):
|
|
62
|
+
pass
|
|
63
|
+
|
|
64
|
+
def _default_chunk_size():
|
|
65
|
+
"""Get the default TextIOWrapper chunk size"""
|
|
66
|
+
with open(__file__, "r", encoding="latin-1") as f:
|
|
67
|
+
return f._CHUNK_SIZE
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class MockRawIOWithoutRead:
|
|
71
|
+
"""A RawIO implementation without read(), so as to exercise the default
|
|
72
|
+
RawIO.read() which calls readinto()."""
|
|
73
|
+
|
|
74
|
+
def __init__(self, read_stack=()):
|
|
75
|
+
self._read_stack = list(read_stack)
|
|
76
|
+
self._write_stack = []
|
|
77
|
+
self._reads = 0
|
|
78
|
+
self._extraneous_reads = 0
|
|
79
|
+
|
|
80
|
+
def write(self, b):
|
|
81
|
+
self._write_stack.append(bytes(b))
|
|
82
|
+
return len(b)
|
|
83
|
+
|
|
84
|
+
def writable(self):
|
|
85
|
+
return True
|
|
86
|
+
|
|
87
|
+
def fileno(self):
|
|
88
|
+
return 42
|
|
89
|
+
|
|
90
|
+
def readable(self):
|
|
91
|
+
return True
|
|
92
|
+
|
|
93
|
+
def seekable(self):
|
|
94
|
+
return True
|
|
95
|
+
|
|
96
|
+
def seek(self, pos, whence):
|
|
97
|
+
return 0 # wrong but we gotta return something
|
|
98
|
+
|
|
99
|
+
def tell(self):
|
|
100
|
+
return 0 # same comment as above
|
|
101
|
+
|
|
102
|
+
def readinto(self, buf):
|
|
103
|
+
self._reads += 1
|
|
104
|
+
max_len = len(buf)
|
|
105
|
+
try:
|
|
106
|
+
data = self._read_stack[0]
|
|
107
|
+
except IndexError:
|
|
108
|
+
self._extraneous_reads += 1
|
|
109
|
+
return 0
|
|
110
|
+
if data is None:
|
|
111
|
+
del self._read_stack[0]
|
|
112
|
+
return None
|
|
113
|
+
n = len(data)
|
|
114
|
+
if len(data) <= max_len:
|
|
115
|
+
del self._read_stack[0]
|
|
116
|
+
buf[:n] = data
|
|
117
|
+
return n
|
|
118
|
+
else:
|
|
119
|
+
buf[:] = data[:max_len]
|
|
120
|
+
self._read_stack[0] = data[max_len:]
|
|
121
|
+
return max_len
|
|
122
|
+
|
|
123
|
+
def truncate(self, pos=None):
|
|
124
|
+
return pos
|
|
125
|
+
|
|
126
|
+
class CMockRawIOWithoutRead(MockRawIOWithoutRead, io.RawIOBase):
|
|
127
|
+
pass
|
|
128
|
+
|
|
129
|
+
class PyMockRawIOWithoutRead(MockRawIOWithoutRead, pyio.RawIOBase):
|
|
130
|
+
pass
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
class MockRawIO(MockRawIOWithoutRead):
|
|
134
|
+
|
|
135
|
+
def read(self, n=None):
|
|
136
|
+
self._reads += 1
|
|
137
|
+
try:
|
|
138
|
+
return self._read_stack.pop(0)
|
|
139
|
+
except:
|
|
140
|
+
self._extraneous_reads += 1
|
|
141
|
+
return b""
|
|
142
|
+
|
|
143
|
+
class CMockRawIO(MockRawIO, io.RawIOBase):
|
|
144
|
+
pass
|
|
145
|
+
|
|
146
|
+
class PyMockRawIO(MockRawIO, pyio.RawIOBase):
|
|
147
|
+
pass
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class MisbehavedRawIO(MockRawIO):
|
|
151
|
+
def write(self, b):
|
|
152
|
+
return super().write(b) * 2
|
|
153
|
+
|
|
154
|
+
def read(self, n=None):
|
|
155
|
+
return super().read(n) * 2
|
|
156
|
+
|
|
157
|
+
def seek(self, pos, whence):
|
|
158
|
+
return -123
|
|
159
|
+
|
|
160
|
+
def tell(self):
|
|
161
|
+
return -456
|
|
162
|
+
|
|
163
|
+
def readinto(self, buf):
|
|
164
|
+
super().readinto(buf)
|
|
165
|
+
return len(buf) * 5
|
|
166
|
+
|
|
167
|
+
class CMisbehavedRawIO(MisbehavedRawIO, io.RawIOBase):
|
|
168
|
+
pass
|
|
169
|
+
|
|
170
|
+
class PyMisbehavedRawIO(MisbehavedRawIO, pyio.RawIOBase):
|
|
171
|
+
pass
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
class CloseFailureIO(MockRawIO):
|
|
175
|
+
closed = 0
|
|
176
|
+
|
|
177
|
+
def close(self):
|
|
178
|
+
if not self.closed:
|
|
179
|
+
self.closed = 1
|
|
180
|
+
raise OSError
|
|
181
|
+
|
|
182
|
+
class CCloseFailureIO(CloseFailureIO, io.RawIOBase):
|
|
183
|
+
pass
|
|
184
|
+
|
|
185
|
+
class PyCloseFailureIO(CloseFailureIO, pyio.RawIOBase):
|
|
186
|
+
pass
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
class MockFileIO:
|
|
190
|
+
|
|
191
|
+
def __init__(self, data):
|
|
192
|
+
self.read_history = []
|
|
193
|
+
super().__init__(data)
|
|
194
|
+
|
|
195
|
+
def read(self, n=None):
|
|
196
|
+
res = super().read(n)
|
|
197
|
+
self.read_history.append(None if res is None else len(res))
|
|
198
|
+
return res
|
|
199
|
+
|
|
200
|
+
def readinto(self, b):
|
|
201
|
+
res = super().readinto(b)
|
|
202
|
+
self.read_history.append(res)
|
|
203
|
+
return res
|
|
204
|
+
|
|
205
|
+
class CMockFileIO(MockFileIO, io.BytesIO):
|
|
206
|
+
pass
|
|
207
|
+
|
|
208
|
+
class PyMockFileIO(MockFileIO, pyio.BytesIO):
|
|
209
|
+
pass
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
class MockUnseekableIO:
|
|
213
|
+
def seekable(self):
|
|
214
|
+
return False
|
|
215
|
+
|
|
216
|
+
def seek(self, *args):
|
|
217
|
+
raise self.UnsupportedOperation("not seekable")
|
|
218
|
+
|
|
219
|
+
def tell(self, *args):
|
|
220
|
+
raise self.UnsupportedOperation("not seekable")
|
|
221
|
+
|
|
222
|
+
def truncate(self, *args):
|
|
223
|
+
raise self.UnsupportedOperation("not seekable")
|
|
224
|
+
|
|
225
|
+
class CMockUnseekableIO(MockUnseekableIO, io.BytesIO):
|
|
226
|
+
UnsupportedOperation = io.UnsupportedOperation
|
|
227
|
+
|
|
228
|
+
class PyMockUnseekableIO(MockUnseekableIO, pyio.BytesIO):
|
|
229
|
+
UnsupportedOperation = pyio.UnsupportedOperation
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
class MockNonBlockWriterIO:
|
|
233
|
+
|
|
234
|
+
def __init__(self):
|
|
235
|
+
self._write_stack = []
|
|
236
|
+
self._blocker_char = None
|
|
237
|
+
|
|
238
|
+
def pop_written(self):
|
|
239
|
+
s = b"".join(self._write_stack)
|
|
240
|
+
self._write_stack[:] = []
|
|
241
|
+
return s
|
|
242
|
+
|
|
243
|
+
def block_on(self, char):
|
|
244
|
+
"""Block when a given char is encountered."""
|
|
245
|
+
self._blocker_char = char
|
|
246
|
+
|
|
247
|
+
def readable(self):
|
|
248
|
+
return True
|
|
249
|
+
|
|
250
|
+
def seekable(self):
|
|
251
|
+
return True
|
|
252
|
+
|
|
253
|
+
def writable(self):
|
|
254
|
+
return True
|
|
255
|
+
|
|
256
|
+
def write(self, b):
|
|
257
|
+
b = bytes(b)
|
|
258
|
+
n = -1
|
|
259
|
+
if self._blocker_char:
|
|
260
|
+
try:
|
|
261
|
+
n = b.index(self._blocker_char)
|
|
262
|
+
except ValueError:
|
|
263
|
+
pass
|
|
264
|
+
else:
|
|
265
|
+
if n > 0:
|
|
266
|
+
# write data up to the first blocker
|
|
267
|
+
self._write_stack.append(b[:n])
|
|
268
|
+
return n
|
|
269
|
+
else:
|
|
270
|
+
# cancel blocker and indicate would block
|
|
271
|
+
self._blocker_char = None
|
|
272
|
+
return None
|
|
273
|
+
self._write_stack.append(b)
|
|
274
|
+
return len(b)
|
|
275
|
+
|
|
276
|
+
class CMockNonBlockWriterIO(MockNonBlockWriterIO, io.RawIOBase):
|
|
277
|
+
BlockingIOError = io.BlockingIOError
|
|
278
|
+
|
|
279
|
+
class PyMockNonBlockWriterIO(MockNonBlockWriterIO, pyio.RawIOBase):
|
|
280
|
+
BlockingIOError = pyio.BlockingIOError
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
class IOTest(unittest.TestCase):
|
|
284
|
+
|
|
285
|
+
def setUp(self):
|
|
286
|
+
support.unlink(support.TESTFN)
|
|
287
|
+
|
|
288
|
+
def tearDown(self):
|
|
289
|
+
support.unlink(support.TESTFN)
|
|
290
|
+
|
|
291
|
+
def write_ops(self, f):
|
|
292
|
+
self.assertEqual(f.write(b"blah."), 5)
|
|
293
|
+
f.truncate(0)
|
|
294
|
+
self.assertEqual(f.tell(), 5)
|
|
295
|
+
f.seek(0)
|
|
296
|
+
|
|
297
|
+
self.assertEqual(f.write(b"blah."), 5)
|
|
298
|
+
self.assertEqual(f.seek(0), 0)
|
|
299
|
+
self.assertEqual(f.write(b"Hello."), 6)
|
|
300
|
+
self.assertEqual(f.tell(), 6)
|
|
301
|
+
self.assertEqual(f.seek(-1, 1), 5)
|
|
302
|
+
self.assertEqual(f.tell(), 5)
|
|
303
|
+
buffer = bytearray(b" world\n\n\n")
|
|
304
|
+
self.assertEqual(f.write(buffer), 9)
|
|
305
|
+
buffer[:] = b"*" * 9 # Overwrite our copy of the data
|
|
306
|
+
self.assertEqual(f.seek(0), 0)
|
|
307
|
+
self.assertEqual(f.write(b"h"), 1)
|
|
308
|
+
self.assertEqual(f.seek(-1, 2), 13)
|
|
309
|
+
self.assertEqual(f.tell(), 13)
|
|
310
|
+
|
|
311
|
+
self.assertEqual(f.truncate(12), 12)
|
|
312
|
+
self.assertEqual(f.tell(), 13)
|
|
313
|
+
self.assertRaises(TypeError, f.seek, 0.0)
|
|
314
|
+
|
|
315
|
+
def read_ops(self, f, buffered=False):
|
|
316
|
+
data = f.read(5)
|
|
317
|
+
self.assertEqual(data, b"hello")
|
|
318
|
+
data = byteslike(data)
|
|
319
|
+
self.assertEqual(f.readinto(data), 5)
|
|
320
|
+
self.assertEqual(bytes(data), b" worl")
|
|
321
|
+
data = bytearray(5)
|
|
322
|
+
self.assertEqual(f.readinto(data), 2)
|
|
323
|
+
self.assertEqual(len(data), 5)
|
|
324
|
+
self.assertEqual(data[:2], b"d\n")
|
|
325
|
+
self.assertEqual(f.seek(0), 0)
|
|
326
|
+
self.assertEqual(f.read(20), b"hello world\n")
|
|
327
|
+
self.assertEqual(f.read(1), b"")
|
|
328
|
+
self.assertEqual(f.readinto(byteslike(b"x")), 0)
|
|
329
|
+
self.assertEqual(f.seek(-6, 2), 6)
|
|
330
|
+
self.assertEqual(f.read(5), b"world")
|
|
331
|
+
self.assertEqual(f.read(0), b"")
|
|
332
|
+
self.assertEqual(f.readinto(byteslike()), 0)
|
|
333
|
+
self.assertEqual(f.seek(-6, 1), 5)
|
|
334
|
+
self.assertEqual(f.read(5), b" worl")
|
|
335
|
+
self.assertEqual(f.tell(), 10)
|
|
336
|
+
self.assertRaises(TypeError, f.seek, 0.0)
|
|
337
|
+
if buffered:
|
|
338
|
+
f.seek(0)
|
|
339
|
+
self.assertEqual(f.read(), b"hello world\n")
|
|
340
|
+
f.seek(6)
|
|
341
|
+
self.assertEqual(f.read(), b"world\n")
|
|
342
|
+
self.assertEqual(f.read(), b"")
|
|
343
|
+
f.seek(0)
|
|
344
|
+
data = byteslike(5)
|
|
345
|
+
self.assertEqual(f.readinto1(data), 5)
|
|
346
|
+
self.assertEqual(bytes(data), b"hello")
|
|
347
|
+
|
|
348
|
+
LARGE = 2**31
|
|
349
|
+
|
|
350
|
+
def large_file_ops(self, f):
|
|
351
|
+
assert f.readable()
|
|
352
|
+
assert f.writable()
|
|
353
|
+
try:
|
|
354
|
+
self.assertEqual(f.seek(self.LARGE), self.LARGE)
|
|
355
|
+
except (OverflowError, ValueError):
|
|
356
|
+
self.skipTest("no largefile support")
|
|
357
|
+
self.assertEqual(f.tell(), self.LARGE)
|
|
358
|
+
self.assertEqual(f.write(b"xxx"), 3)
|
|
359
|
+
self.assertEqual(f.tell(), self.LARGE + 3)
|
|
360
|
+
self.assertEqual(f.seek(-1, 1), self.LARGE + 2)
|
|
361
|
+
self.assertEqual(f.truncate(), self.LARGE + 2)
|
|
362
|
+
self.assertEqual(f.tell(), self.LARGE + 2)
|
|
363
|
+
self.assertEqual(f.seek(0, 2), self.LARGE + 2)
|
|
364
|
+
self.assertEqual(f.truncate(self.LARGE + 1), self.LARGE + 1)
|
|
365
|
+
self.assertEqual(f.tell(), self.LARGE + 2)
|
|
366
|
+
self.assertEqual(f.seek(0, 2), self.LARGE + 1)
|
|
367
|
+
self.assertEqual(f.seek(-1, 2), self.LARGE)
|
|
368
|
+
self.assertEqual(f.read(2), b"x")
|
|
369
|
+
|
|
370
|
+
def test_invalid_operations(self):
|
|
371
|
+
# Try writing on a file opened in read mode and vice-versa.
|
|
372
|
+
exc = self.UnsupportedOperation
|
|
373
|
+
for mode in ("w", "wb"):
|
|
374
|
+
with self.open(support.TESTFN, mode) as fp:
|
|
375
|
+
self.assertRaises(exc, fp.read)
|
|
376
|
+
self.assertRaises(exc, fp.readline)
|
|
377
|
+
with self.open(support.TESTFN, "wb", buffering=0) as fp:
|
|
378
|
+
self.assertRaises(exc, fp.read)
|
|
379
|
+
self.assertRaises(exc, fp.readline)
|
|
380
|
+
with self.open(support.TESTFN, "rb", buffering=0) as fp:
|
|
381
|
+
self.assertRaises(exc, fp.write, b"blah")
|
|
382
|
+
self.assertRaises(exc, fp.writelines, [b"blah\n"])
|
|
383
|
+
with self.open(support.TESTFN, "rb") as fp:
|
|
384
|
+
self.assertRaises(exc, fp.write, b"blah")
|
|
385
|
+
self.assertRaises(exc, fp.writelines, [b"blah\n"])
|
|
386
|
+
with self.open(support.TESTFN, "r") as fp:
|
|
387
|
+
self.assertRaises(exc, fp.write, "blah")
|
|
388
|
+
self.assertRaises(exc, fp.writelines, ["blah\n"])
|
|
389
|
+
# Non-zero seeking from current or end pos
|
|
390
|
+
self.assertRaises(exc, fp.seek, 1, self.SEEK_CUR)
|
|
391
|
+
self.assertRaises(exc, fp.seek, -1, self.SEEK_END)
|
|
392
|
+
|
|
393
|
+
def test_optional_abilities(self):
|
|
394
|
+
# Test for OSError when optional APIs are not supported
|
|
395
|
+
# The purpose of this test is to try fileno(), reading, writing and
|
|
396
|
+
# seeking operations with various objects that indicate they do not
|
|
397
|
+
# support these operations.
|
|
398
|
+
|
|
399
|
+
def pipe_reader():
|
|
400
|
+
[r, w] = os.pipe()
|
|
401
|
+
os.close(w) # So that read() is harmless
|
|
402
|
+
return self.FileIO(r, "r")
|
|
403
|
+
|
|
404
|
+
def pipe_writer():
|
|
405
|
+
[r, w] = os.pipe()
|
|
406
|
+
self.addCleanup(os.close, r)
|
|
407
|
+
# Guarantee that we can write into the pipe without blocking
|
|
408
|
+
thread = threading.Thread(target=os.read, args=(r, 100))
|
|
409
|
+
thread.start()
|
|
410
|
+
self.addCleanup(thread.join)
|
|
411
|
+
return self.FileIO(w, "w")
|
|
412
|
+
|
|
413
|
+
def buffered_reader():
|
|
414
|
+
return self.BufferedReader(self.MockUnseekableIO())
|
|
415
|
+
|
|
416
|
+
def buffered_writer():
|
|
417
|
+
return self.BufferedWriter(self.MockUnseekableIO())
|
|
418
|
+
|
|
419
|
+
def buffered_random():
|
|
420
|
+
return self.BufferedRandom(self.BytesIO())
|
|
421
|
+
|
|
422
|
+
def buffered_rw_pair():
|
|
423
|
+
return self.BufferedRWPair(self.MockUnseekableIO(),
|
|
424
|
+
self.MockUnseekableIO())
|
|
425
|
+
|
|
426
|
+
def text_reader():
|
|
427
|
+
class UnseekableReader(self.MockUnseekableIO):
|
|
428
|
+
writable = self.BufferedIOBase.writable
|
|
429
|
+
write = self.BufferedIOBase.write
|
|
430
|
+
return self.TextIOWrapper(UnseekableReader(), "ascii")
|
|
431
|
+
|
|
432
|
+
def text_writer():
|
|
433
|
+
class UnseekableWriter(self.MockUnseekableIO):
|
|
434
|
+
readable = self.BufferedIOBase.readable
|
|
435
|
+
read = self.BufferedIOBase.read
|
|
436
|
+
return self.TextIOWrapper(UnseekableWriter(), "ascii")
|
|
437
|
+
|
|
438
|
+
tests = (
|
|
439
|
+
(pipe_reader, "fr"), (pipe_writer, "fw"),
|
|
440
|
+
(buffered_reader, "r"), (buffered_writer, "w"),
|
|
441
|
+
(buffered_random, "rws"), (buffered_rw_pair, "rw"),
|
|
442
|
+
(text_reader, "r"), (text_writer, "w"),
|
|
443
|
+
(self.BytesIO, "rws"), (self.StringIO, "rws"),
|
|
444
|
+
)
|
|
445
|
+
for [test, abilities] in tests:
|
|
446
|
+
if test is pipe_writer and not threading:
|
|
447
|
+
continue # Skip subtest that uses a background thread
|
|
448
|
+
with self.subTest(test), test() as obj:
|
|
449
|
+
readable = "r" in abilities
|
|
450
|
+
self.assertEqual(obj.readable(), readable)
|
|
451
|
+
writable = "w" in abilities
|
|
452
|
+
self.assertEqual(obj.writable(), writable)
|
|
453
|
+
|
|
454
|
+
if isinstance(obj, self.TextIOBase):
|
|
455
|
+
data = "3"
|
|
456
|
+
elif isinstance(obj, (self.BufferedIOBase, self.RawIOBase)):
|
|
457
|
+
data = b"3"
|
|
458
|
+
else:
|
|
459
|
+
self.fail("Unknown base class")
|
|
460
|
+
|
|
461
|
+
if "f" in abilities:
|
|
462
|
+
obj.fileno()
|
|
463
|
+
else:
|
|
464
|
+
self.assertRaises(OSError, obj.fileno)
|
|
465
|
+
|
|
466
|
+
if readable:
|
|
467
|
+
obj.read(1)
|
|
468
|
+
obj.read()
|
|
469
|
+
else:
|
|
470
|
+
self.assertRaises(OSError, obj.read, 1)
|
|
471
|
+
self.assertRaises(OSError, obj.read)
|
|
472
|
+
|
|
473
|
+
if writable:
|
|
474
|
+
obj.write(data)
|
|
475
|
+
else:
|
|
476
|
+
self.assertRaises(OSError, obj.write, data)
|
|
477
|
+
|
|
478
|
+
if sys.platform.startswith("win") and test in (
|
|
479
|
+
pipe_reader, pipe_writer):
|
|
480
|
+
# Pipes seem to appear as seekable on Windows
|
|
481
|
+
continue
|
|
482
|
+
seekable = "s" in abilities
|
|
483
|
+
self.assertEqual(obj.seekable(), seekable)
|
|
484
|
+
|
|
485
|
+
if seekable:
|
|
486
|
+
obj.tell()
|
|
487
|
+
obj.seek(0)
|
|
488
|
+
else:
|
|
489
|
+
self.assertRaises(OSError, obj.tell)
|
|
490
|
+
self.assertRaises(OSError, obj.seek, 0)
|
|
491
|
+
|
|
492
|
+
if writable and seekable:
|
|
493
|
+
obj.truncate()
|
|
494
|
+
obj.truncate(0)
|
|
495
|
+
else:
|
|
496
|
+
self.assertRaises(OSError, obj.truncate)
|
|
497
|
+
self.assertRaises(OSError, obj.truncate, 0)
|
|
498
|
+
|
|
499
|
+
def test_open_handles_NUL_chars(self):
|
|
500
|
+
fn_with_NUL = 'foo\0bar'
|
|
501
|
+
self.assertRaises(ValueError, self.open, fn_with_NUL, 'w')
|
|
502
|
+
|
|
503
|
+
bytes_fn = bytes(fn_with_NUL, 'ascii')
|
|
504
|
+
with warnings.catch_warnings():
|
|
505
|
+
warnings.simplefilter("ignore", DeprecationWarning)
|
|
506
|
+
self.assertRaises(ValueError, self.open, bytes_fn, 'w')
|
|
507
|
+
|
|
508
|
+
def test_raw_file_io(self):
|
|
509
|
+
with self.open(support.TESTFN, "wb", buffering=0) as f:
|
|
510
|
+
self.assertEqual(f.readable(), False)
|
|
511
|
+
self.assertEqual(f.writable(), True)
|
|
512
|
+
self.assertEqual(f.seekable(), True)
|
|
513
|
+
self.write_ops(f)
|
|
514
|
+
with self.open(support.TESTFN, "rb", buffering=0) as f:
|
|
515
|
+
self.assertEqual(f.readable(), True)
|
|
516
|
+
self.assertEqual(f.writable(), False)
|
|
517
|
+
self.assertEqual(f.seekable(), True)
|
|
518
|
+
self.read_ops(f)
|
|
519
|
+
|
|
520
|
+
def test_buffered_file_io(self):
|
|
521
|
+
with self.open(support.TESTFN, "wb") as f:
|
|
522
|
+
self.assertEqual(f.readable(), False)
|
|
523
|
+
self.assertEqual(f.writable(), True)
|
|
524
|
+
self.assertEqual(f.seekable(), True)
|
|
525
|
+
self.write_ops(f)
|
|
526
|
+
with self.open(support.TESTFN, "rb") as f:
|
|
527
|
+
self.assertEqual(f.readable(), True)
|
|
528
|
+
self.assertEqual(f.writable(), False)
|
|
529
|
+
self.assertEqual(f.seekable(), True)
|
|
530
|
+
self.read_ops(f, True)
|
|
531
|
+
|
|
532
|
+
def test_readline(self):
|
|
533
|
+
with self.open(support.TESTFN, "wb") as f:
|
|
534
|
+
f.write(b"abc\ndef\nxyzzy\nfoo\x00bar\nanother line")
|
|
535
|
+
with self.open(support.TESTFN, "rb") as f:
|
|
536
|
+
self.assertEqual(f.readline(), b"abc\n")
|
|
537
|
+
self.assertEqual(f.readline(10), b"def\n")
|
|
538
|
+
self.assertEqual(f.readline(2), b"xy")
|
|
539
|
+
self.assertEqual(f.readline(4), b"zzy\n")
|
|
540
|
+
self.assertEqual(f.readline(), b"foo\x00bar\n")
|
|
541
|
+
self.assertEqual(f.readline(None), b"another line")
|
|
542
|
+
self.assertRaises(TypeError, f.readline, 5.3)
|
|
543
|
+
with self.open(support.TESTFN, "r") as f:
|
|
544
|
+
self.assertRaises(TypeError, f.readline, 5.3)
|
|
545
|
+
|
|
546
|
+
def test_readline_nonsizeable(self):
|
|
547
|
+
# Issue #30061
|
|
548
|
+
# Crash when readline() returns an object without __len__
|
|
549
|
+
class R(self.IOBase):
|
|
550
|
+
def readline(self):
|
|
551
|
+
return None
|
|
552
|
+
self.assertRaises((TypeError, StopIteration), next, R())
|
|
553
|
+
|
|
554
|
+
def test_next_nonsizeable(self):
|
|
555
|
+
# Issue #30061
|
|
556
|
+
# Crash when __next__() returns an object without __len__
|
|
557
|
+
class R(self.IOBase):
|
|
558
|
+
def __next__(self):
|
|
559
|
+
return None
|
|
560
|
+
self.assertRaises(TypeError, R().readlines, 1)
|
|
561
|
+
|
|
562
|
+
def test_raw_bytes_io(self):
|
|
563
|
+
f = self.BytesIO()
|
|
564
|
+
self.write_ops(f)
|
|
565
|
+
data = f.getvalue()
|
|
566
|
+
self.assertEqual(data, b"hello world\n")
|
|
567
|
+
f = self.BytesIO(data)
|
|
568
|
+
self.read_ops(f, True)
|
|
569
|
+
|
|
570
|
+
def test_large_file_ops(self):
|
|
571
|
+
# On Windows and Mac OSX this test comsumes large resources; It takes
|
|
572
|
+
# a long time to build the >2GB file and takes >2GB of disk space
|
|
573
|
+
# therefore the resource must be enabled to run this test.
|
|
574
|
+
if sys.platform[:3] == 'win' or sys.platform == 'darwin':
|
|
575
|
+
support.requires(
|
|
576
|
+
'largefile',
|
|
577
|
+
'test requires %s bytes and a long time to run' % self.LARGE)
|
|
578
|
+
with self.open(support.TESTFN, "w+b", 0) as f:
|
|
579
|
+
self.large_file_ops(f)
|
|
580
|
+
with self.open(support.TESTFN, "w+b") as f:
|
|
581
|
+
self.large_file_ops(f)
|
|
582
|
+
|
|
583
|
+
def test_with_open(self):
|
|
584
|
+
for bufsize in (0, 1, 100):
|
|
585
|
+
f = None
|
|
586
|
+
with self.open(support.TESTFN, "wb", bufsize) as f:
|
|
587
|
+
f.write(b"xxx")
|
|
588
|
+
self.assertEqual(f.closed, True)
|
|
589
|
+
f = None
|
|
590
|
+
try:
|
|
591
|
+
with self.open(support.TESTFN, "wb", bufsize) as f:
|
|
592
|
+
1/0
|
|
593
|
+
except ZeroDivisionError:
|
|
594
|
+
self.assertEqual(f.closed, True)
|
|
595
|
+
else:
|
|
596
|
+
self.fail("1/0 didn't raise an exception")
|
|
597
|
+
|
|
598
|
+
# issue 5008
|
|
599
|
+
def test_append_mode_tell(self):
|
|
600
|
+
with self.open(support.TESTFN, "wb") as f:
|
|
601
|
+
f.write(b"xxx")
|
|
602
|
+
with self.open(support.TESTFN, "ab", buffering=0) as f:
|
|
603
|
+
self.assertEqual(f.tell(), 3)
|
|
604
|
+
with self.open(support.TESTFN, "ab") as f:
|
|
605
|
+
self.assertEqual(f.tell(), 3)
|
|
606
|
+
with self.open(support.TESTFN, "a") as f:
|
|
607
|
+
self.assertGreater(f.tell(), 0)
|
|
608
|
+
|
|
609
|
+
def test_destructor(self):
|
|
610
|
+
record = []
|
|
611
|
+
class MyFileIO(self.FileIO):
|
|
612
|
+
def __del__(self):
|
|
613
|
+
record.append(1)
|
|
614
|
+
try:
|
|
615
|
+
f = super().__del__
|
|
616
|
+
except AttributeError:
|
|
617
|
+
pass
|
|
618
|
+
else:
|
|
619
|
+
f()
|
|
620
|
+
def close(self):
|
|
621
|
+
record.append(2)
|
|
622
|
+
super().close()
|
|
623
|
+
def flush(self):
|
|
624
|
+
record.append(3)
|
|
625
|
+
super().flush()
|
|
626
|
+
with support.check_warnings(('', ResourceWarning)):
|
|
627
|
+
f = MyFileIO(support.TESTFN, "wb")
|
|
628
|
+
f.write(b"xxx")
|
|
629
|
+
del f
|
|
630
|
+
support.gc_collect()
|
|
631
|
+
self.assertEqual(record, [1, 2, 3])
|
|
632
|
+
with self.open(support.TESTFN, "rb") as f:
|
|
633
|
+
self.assertEqual(f.read(), b"xxx")
|
|
634
|
+
|
|
635
|
+
def _check_base_destructor(self, base):
|
|
636
|
+
record = []
|
|
637
|
+
class MyIO(base):
|
|
638
|
+
def __init__(self):
|
|
639
|
+
# This exercises the availability of attributes on object
|
|
640
|
+
# destruction.
|
|
641
|
+
# (in the C version, close() is called by the tp_dealloc
|
|
642
|
+
# function, not by __del__)
|
|
643
|
+
self.on_del = 1
|
|
644
|
+
self.on_close = 2
|
|
645
|
+
self.on_flush = 3
|
|
646
|
+
def __del__(self):
|
|
647
|
+
record.append(self.on_del)
|
|
648
|
+
try:
|
|
649
|
+
f = super().__del__
|
|
650
|
+
except AttributeError:
|
|
651
|
+
pass
|
|
652
|
+
else:
|
|
653
|
+
f()
|
|
654
|
+
def close(self):
|
|
655
|
+
record.append(self.on_close)
|
|
656
|
+
super().close()
|
|
657
|
+
def flush(self):
|
|
658
|
+
record.append(self.on_flush)
|
|
659
|
+
super().flush()
|
|
660
|
+
f = MyIO()
|
|
661
|
+
del f
|
|
662
|
+
support.gc_collect()
|
|
663
|
+
self.assertEqual(record, [1, 2, 3])
|
|
664
|
+
|
|
665
|
+
def test_IOBase_destructor(self):
|
|
666
|
+
self._check_base_destructor(self.IOBase)
|
|
667
|
+
|
|
668
|
+
def test_RawIOBase_destructor(self):
|
|
669
|
+
self._check_base_destructor(self.RawIOBase)
|
|
670
|
+
|
|
671
|
+
def test_BufferedIOBase_destructor(self):
|
|
672
|
+
self._check_base_destructor(self.BufferedIOBase)
|
|
673
|
+
|
|
674
|
+
def test_TextIOBase_destructor(self):
|
|
675
|
+
self._check_base_destructor(self.TextIOBase)
|
|
676
|
+
|
|
677
|
+
def test_close_flushes(self):
|
|
678
|
+
with self.open(support.TESTFN, "wb") as f:
|
|
679
|
+
f.write(b"xxx")
|
|
680
|
+
with self.open(support.TESTFN, "rb") as f:
|
|
681
|
+
self.assertEqual(f.read(), b"xxx")
|
|
682
|
+
|
|
683
|
+
def test_array_writes(self):
|
|
684
|
+
a = array.array('i', range(10))
|
|
685
|
+
n = len(a.tobytes())
|
|
686
|
+
def check(f):
|
|
687
|
+
with f:
|
|
688
|
+
self.assertEqual(f.write(a), n)
|
|
689
|
+
f.writelines((a,))
|
|
690
|
+
check(self.BytesIO())
|
|
691
|
+
check(self.FileIO(support.TESTFN, "w"))
|
|
692
|
+
check(self.BufferedWriter(self.MockRawIO()))
|
|
693
|
+
check(self.BufferedRandom(self.MockRawIO()))
|
|
694
|
+
check(self.BufferedRWPair(self.MockRawIO(), self.MockRawIO()))
|
|
695
|
+
|
|
696
|
+
def test_closefd(self):
|
|
697
|
+
self.assertRaises(ValueError, self.open, support.TESTFN, 'w',
|
|
698
|
+
closefd=False)
|
|
699
|
+
|
|
700
|
+
def test_read_closed(self):
|
|
701
|
+
with self.open(support.TESTFN, "w") as f:
|
|
702
|
+
f.write("egg\n")
|
|
703
|
+
with self.open(support.TESTFN, "r") as f:
|
|
704
|
+
file = self.open(f.fileno(), "r", closefd=False)
|
|
705
|
+
self.assertEqual(file.read(), "egg\n")
|
|
706
|
+
file.seek(0)
|
|
707
|
+
file.close()
|
|
708
|
+
self.assertRaises(ValueError, file.read)
|
|
709
|
+
|
|
710
|
+
def test_no_closefd_with_filename(self):
|
|
711
|
+
# can't use closefd in combination with a file name
|
|
712
|
+
self.assertRaises(ValueError, self.open, support.TESTFN, "r", closefd=False)
|
|
713
|
+
|
|
714
|
+
def test_closefd_attr(self):
|
|
715
|
+
with self.open(support.TESTFN, "wb") as f:
|
|
716
|
+
f.write(b"egg\n")
|
|
717
|
+
with self.open(support.TESTFN, "r") as f:
|
|
718
|
+
self.assertEqual(f.buffer.raw.closefd, True)
|
|
719
|
+
file = self.open(f.fileno(), "r", closefd=False)
|
|
720
|
+
self.assertEqual(file.buffer.raw.closefd, False)
|
|
721
|
+
|
|
722
|
+
def test_garbage_collection(self):
|
|
723
|
+
# FileIO objects are collected, and collecting them flushes
|
|
724
|
+
# all data to disk.
|
|
725
|
+
with support.check_warnings(('', ResourceWarning)):
|
|
726
|
+
f = self.FileIO(support.TESTFN, "wb")
|
|
727
|
+
f.write(b"abcxxx")
|
|
728
|
+
f.f = f
|
|
729
|
+
wr = weakref.ref(f)
|
|
730
|
+
del f
|
|
731
|
+
support.gc_collect()
|
|
732
|
+
self.assertIsNone(wr(), wr)
|
|
733
|
+
with self.open(support.TESTFN, "rb") as f:
|
|
734
|
+
self.assertEqual(f.read(), b"abcxxx")
|
|
735
|
+
|
|
736
|
+
def test_unbounded_file(self):
|
|
737
|
+
# Issue #1174606: reading from an unbounded stream such as /dev/zero.
|
|
738
|
+
zero = "/dev/zero"
|
|
739
|
+
if not os.path.exists(zero):
|
|
740
|
+
self.skipTest("{0} does not exist".format(zero))
|
|
741
|
+
if sys.maxsize > 0x7FFFFFFF:
|
|
742
|
+
self.skipTest("test can only run in a 32-bit address space")
|
|
743
|
+
if support.real_max_memuse < support._2G:
|
|
744
|
+
self.skipTest("test requires at least 2GB of memory")
|
|
745
|
+
with self.open(zero, "rb", buffering=0) as f:
|
|
746
|
+
self.assertRaises(OverflowError, f.read)
|
|
747
|
+
with self.open(zero, "rb") as f:
|
|
748
|
+
self.assertRaises(OverflowError, f.read)
|
|
749
|
+
with self.open(zero, "r") as f:
|
|
750
|
+
self.assertRaises(OverflowError, f.read)
|
|
751
|
+
|
|
752
|
+
def check_flush_error_on_close(self, *args, **kwargs):
|
|
753
|
+
# Test that the file is closed despite failed flush
|
|
754
|
+
# and that flush() is called before file closed.
|
|
755
|
+
f = self.open(*args, **kwargs)
|
|
756
|
+
closed = []
|
|
757
|
+
def bad_flush():
|
|
758
|
+
closed[:] = [f.closed]
|
|
759
|
+
raise OSError()
|
|
760
|
+
f.flush = bad_flush
|
|
761
|
+
self.assertRaises(OSError, f.close) # exception not swallowed
|
|
762
|
+
self.assertTrue(f.closed)
|
|
763
|
+
self.assertTrue(closed) # flush() called
|
|
764
|
+
self.assertFalse(closed[0]) # flush() called before file closed
|
|
765
|
+
f.flush = lambda: None # break reference loop
|
|
766
|
+
|
|
767
|
+
def test_flush_error_on_close(self):
|
|
768
|
+
# raw file
|
|
769
|
+
# Issue #5700: io.FileIO calls flush() after file closed
|
|
770
|
+
self.check_flush_error_on_close(support.TESTFN, 'wb', buffering=0)
|
|
771
|
+
fd = os.open(support.TESTFN, os.O_WRONLY|os.O_CREAT)
|
|
772
|
+
self.check_flush_error_on_close(fd, 'wb', buffering=0)
|
|
773
|
+
fd = os.open(support.TESTFN, os.O_WRONLY|os.O_CREAT)
|
|
774
|
+
self.check_flush_error_on_close(fd, 'wb', buffering=0, closefd=False)
|
|
775
|
+
os.close(fd)
|
|
776
|
+
# buffered io
|
|
777
|
+
self.check_flush_error_on_close(support.TESTFN, 'wb')
|
|
778
|
+
fd = os.open(support.TESTFN, os.O_WRONLY|os.O_CREAT)
|
|
779
|
+
self.check_flush_error_on_close(fd, 'wb')
|
|
780
|
+
fd = os.open(support.TESTFN, os.O_WRONLY|os.O_CREAT)
|
|
781
|
+
self.check_flush_error_on_close(fd, 'wb', closefd=False)
|
|
782
|
+
os.close(fd)
|
|
783
|
+
# text io
|
|
784
|
+
self.check_flush_error_on_close(support.TESTFN, 'w')
|
|
785
|
+
fd = os.open(support.TESTFN, os.O_WRONLY|os.O_CREAT)
|
|
786
|
+
self.check_flush_error_on_close(fd, 'w')
|
|
787
|
+
fd = os.open(support.TESTFN, os.O_WRONLY|os.O_CREAT)
|
|
788
|
+
self.check_flush_error_on_close(fd, 'w', closefd=False)
|
|
789
|
+
os.close(fd)
|
|
790
|
+
|
|
791
|
+
def test_multi_close(self):
|
|
792
|
+
f = self.open(support.TESTFN, "wb", buffering=0)
|
|
793
|
+
f.close()
|
|
794
|
+
f.close()
|
|
795
|
+
f.close()
|
|
796
|
+
self.assertRaises(ValueError, f.flush)
|
|
797
|
+
|
|
798
|
+
def test_RawIOBase_read(self):
|
|
799
|
+
# Exercise the default RawIOBase.read() implementation (which calls
|
|
800
|
+
# readinto() internally).
|
|
801
|
+
rawio = self.MockRawIOWithoutRead((b"abc", b"d", None, b"efg", None))
|
|
802
|
+
self.assertEqual(rawio.read(2), b"ab")
|
|
803
|
+
self.assertEqual(rawio.read(2), b"c")
|
|
804
|
+
self.assertEqual(rawio.read(2), b"d")
|
|
805
|
+
self.assertEqual(rawio.read(2), None)
|
|
806
|
+
self.assertEqual(rawio.read(2), b"ef")
|
|
807
|
+
self.assertEqual(rawio.read(2), b"g")
|
|
808
|
+
self.assertEqual(rawio.read(2), None)
|
|
809
|
+
self.assertEqual(rawio.read(2), b"")
|
|
810
|
+
|
|
811
|
+
def test_types_have_dict(self):
|
|
812
|
+
test = (
|
|
813
|
+
self.IOBase(),
|
|
814
|
+
self.RawIOBase(),
|
|
815
|
+
self.TextIOBase(),
|
|
816
|
+
self.StringIO(),
|
|
817
|
+
self.BytesIO()
|
|
818
|
+
)
|
|
819
|
+
for obj in test:
|
|
820
|
+
self.assertTrue(hasattr(obj, "__dict__"))
|
|
821
|
+
|
|
822
|
+
def test_opener(self):
|
|
823
|
+
with self.open(support.TESTFN, "w") as f:
|
|
824
|
+
f.write("egg\n")
|
|
825
|
+
fd = os.open(support.TESTFN, os.O_RDONLY)
|
|
826
|
+
def opener(path, flags):
|
|
827
|
+
return fd
|
|
828
|
+
with self.open("non-existent", "r", opener=opener) as f:
|
|
829
|
+
self.assertEqual(f.read(), "egg\n")
|
|
830
|
+
|
|
831
|
+
def test_bad_opener_negative_1(self):
|
|
832
|
+
# Issue #27066.
|
|
833
|
+
def badopener(fname, flags):
|
|
834
|
+
return -1
|
|
835
|
+
with self.assertRaises(ValueError) as cm:
|
|
836
|
+
open('non-existent', 'r', opener=badopener)
|
|
837
|
+
self.assertEqual(str(cm.exception), 'opener returned -1')
|
|
838
|
+
|
|
839
|
+
def test_bad_opener_other_negative(self):
|
|
840
|
+
# Issue #27066.
|
|
841
|
+
def badopener(fname, flags):
|
|
842
|
+
return -2
|
|
843
|
+
with self.assertRaises(ValueError) as cm:
|
|
844
|
+
open('non-existent', 'r', opener=badopener)
|
|
845
|
+
self.assertEqual(str(cm.exception), 'opener returned -2')
|
|
846
|
+
|
|
847
|
+
def test_fileio_closefd(self):
|
|
848
|
+
# Issue #4841
|
|
849
|
+
with self.open(__file__, 'rb') as f1, \
|
|
850
|
+
self.open(__file__, 'rb') as f2:
|
|
851
|
+
fileio = self.FileIO(f1.fileno(), closefd=False)
|
|
852
|
+
# .__init__() must not close f1
|
|
853
|
+
fileio.__init__(f2.fileno(), closefd=False)
|
|
854
|
+
f1.readline()
|
|
855
|
+
# .close() must not close f2
|
|
856
|
+
fileio.close()
|
|
857
|
+
f2.readline()
|
|
858
|
+
|
|
859
|
+
def test_nonbuffered_textio(self):
|
|
860
|
+
with support.check_no_resource_warning(self):
|
|
861
|
+
with self.assertRaises(ValueError):
|
|
862
|
+
self.open(support.TESTFN, 'w', buffering=0)
|
|
863
|
+
|
|
864
|
+
def test_invalid_newline(self):
|
|
865
|
+
with support.check_no_resource_warning(self):
|
|
866
|
+
with self.assertRaises(ValueError):
|
|
867
|
+
self.open(support.TESTFN, 'w', newline='invalid')
|
|
868
|
+
|
|
869
|
+
def test_buffered_readinto_mixin(self):
|
|
870
|
+
# Test the implementation provided by BufferedIOBase
|
|
871
|
+
class Stream(self.BufferedIOBase):
|
|
872
|
+
def read(self, size):
|
|
873
|
+
return b"12345"
|
|
874
|
+
read1 = read
|
|
875
|
+
stream = Stream()
|
|
876
|
+
for method in ("readinto", "readinto1"):
|
|
877
|
+
with self.subTest(method):
|
|
878
|
+
buffer = byteslike(5)
|
|
879
|
+
self.assertEqual(getattr(stream, method)(buffer), 5)
|
|
880
|
+
self.assertEqual(bytes(buffer), b"12345")
|
|
881
|
+
|
|
882
|
+
def test_fspath_support(self):
|
|
883
|
+
class PathLike:
|
|
884
|
+
def __init__(self, path):
|
|
885
|
+
self.path = path
|
|
886
|
+
|
|
887
|
+
def __fspath__(self):
|
|
888
|
+
return self.path
|
|
889
|
+
|
|
890
|
+
def check_path_succeeds(path):
|
|
891
|
+
with self.open(path, "w") as f:
|
|
892
|
+
f.write("egg\n")
|
|
893
|
+
|
|
894
|
+
with self.open(path, "r") as f:
|
|
895
|
+
self.assertEqual(f.read(), "egg\n")
|
|
896
|
+
|
|
897
|
+
check_path_succeeds(PathLike(support.TESTFN))
|
|
898
|
+
check_path_succeeds(PathLike(support.TESTFN.encode('utf-8')))
|
|
899
|
+
|
|
900
|
+
bad_path = PathLike(TypeError)
|
|
901
|
+
with self.assertRaises(TypeError):
|
|
902
|
+
self.open(bad_path, 'w')
|
|
903
|
+
|
|
904
|
+
# ensure that refcounting is correct with some error conditions
|
|
905
|
+
with self.assertRaisesRegex(ValueError, 'read/write/append mode'):
|
|
906
|
+
self.open(PathLike(support.TESTFN), 'rwxa')
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
class CIOTest(IOTest):
|
|
910
|
+
|
|
911
|
+
def test_IOBase_finalize(self):
|
|
912
|
+
# Issue #12149: segmentation fault on _PyIOBase_finalize when both a
|
|
913
|
+
# class which inherits IOBase and an object of this class are caught
|
|
914
|
+
# in a reference cycle and close() is already in the method cache.
|
|
915
|
+
class MyIO(self.IOBase):
|
|
916
|
+
def close(self):
|
|
917
|
+
pass
|
|
918
|
+
|
|
919
|
+
# create an instance to populate the method cache
|
|
920
|
+
MyIO()
|
|
921
|
+
obj = MyIO()
|
|
922
|
+
obj.obj = obj
|
|
923
|
+
wr = weakref.ref(obj)
|
|
924
|
+
del MyIO
|
|
925
|
+
del obj
|
|
926
|
+
support.gc_collect()
|
|
927
|
+
self.assertIsNone(wr(), wr)
|
|
928
|
+
|
|
929
|
+
class PyIOTest(IOTest):
|
|
930
|
+
pass
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
@support.cpython_only
|
|
934
|
+
class APIMismatchTest(unittest.TestCase):
|
|
935
|
+
|
|
936
|
+
def test_RawIOBase_io_in_pyio_match(self):
|
|
937
|
+
"""Test that pyio RawIOBase class has all c RawIOBase methods"""
|
|
938
|
+
mismatch = support.detect_api_mismatch(pyio.RawIOBase, io.RawIOBase,
|
|
939
|
+
ignore=('__weakref__',))
|
|
940
|
+
self.assertEqual(mismatch, set(), msg='Python RawIOBase does not have all C RawIOBase methods')
|
|
941
|
+
|
|
942
|
+
def test_RawIOBase_pyio_in_io_match(self):
|
|
943
|
+
"""Test that c RawIOBase class has all pyio RawIOBase methods"""
|
|
944
|
+
mismatch = support.detect_api_mismatch(io.RawIOBase, pyio.RawIOBase)
|
|
945
|
+
self.assertEqual(mismatch, set(), msg='C RawIOBase does not have all Python RawIOBase methods')
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
class CommonBufferedTests:
|
|
949
|
+
# Tests common to BufferedReader, BufferedWriter and BufferedRandom
|
|
950
|
+
|
|
951
|
+
def test_detach(self):
|
|
952
|
+
raw = self.MockRawIO()
|
|
953
|
+
buf = self.tp(raw)
|
|
954
|
+
self.assertIs(buf.detach(), raw)
|
|
955
|
+
self.assertRaises(ValueError, buf.detach)
|
|
956
|
+
|
|
957
|
+
repr(buf) # Should still work
|
|
958
|
+
|
|
959
|
+
def test_fileno(self):
|
|
960
|
+
rawio = self.MockRawIO()
|
|
961
|
+
bufio = self.tp(rawio)
|
|
962
|
+
|
|
963
|
+
self.assertEqual(42, bufio.fileno())
|
|
964
|
+
|
|
965
|
+
def test_invalid_args(self):
|
|
966
|
+
rawio = self.MockRawIO()
|
|
967
|
+
bufio = self.tp(rawio)
|
|
968
|
+
# Invalid whence
|
|
969
|
+
self.assertRaises(ValueError, bufio.seek, 0, -1)
|
|
970
|
+
self.assertRaises(ValueError, bufio.seek, 0, 9)
|
|
971
|
+
|
|
972
|
+
def test_override_destructor(self):
|
|
973
|
+
tp = self.tp
|
|
974
|
+
record = []
|
|
975
|
+
class MyBufferedIO(tp):
|
|
976
|
+
def __del__(self):
|
|
977
|
+
record.append(1)
|
|
978
|
+
try:
|
|
979
|
+
f = super().__del__
|
|
980
|
+
except AttributeError:
|
|
981
|
+
pass
|
|
982
|
+
else:
|
|
983
|
+
f()
|
|
984
|
+
def close(self):
|
|
985
|
+
record.append(2)
|
|
986
|
+
super().close()
|
|
987
|
+
def flush(self):
|
|
988
|
+
record.append(3)
|
|
989
|
+
super().flush()
|
|
990
|
+
rawio = self.MockRawIO()
|
|
991
|
+
bufio = MyBufferedIO(rawio)
|
|
992
|
+
del bufio
|
|
993
|
+
support.gc_collect()
|
|
994
|
+
self.assertEqual(record, [1, 2, 3])
|
|
995
|
+
|
|
996
|
+
def test_context_manager(self):
|
|
997
|
+
# Test usability as a context manager
|
|
998
|
+
rawio = self.MockRawIO()
|
|
999
|
+
bufio = self.tp(rawio)
|
|
1000
|
+
def _with():
|
|
1001
|
+
with bufio:
|
|
1002
|
+
pass
|
|
1003
|
+
_with()
|
|
1004
|
+
# bufio should now be closed, and using it a second time should raise
|
|
1005
|
+
# a ValueError.
|
|
1006
|
+
self.assertRaises(ValueError, _with)
|
|
1007
|
+
|
|
1008
|
+
def test_error_through_destructor(self):
|
|
1009
|
+
# Test that the exception state is not modified by a destructor,
|
|
1010
|
+
# even if close() fails.
|
|
1011
|
+
rawio = self.CloseFailureIO()
|
|
1012
|
+
def f():
|
|
1013
|
+
self.tp(rawio).xyzzy
|
|
1014
|
+
with support.captured_output("stderr") as s:
|
|
1015
|
+
self.assertRaises(AttributeError, f)
|
|
1016
|
+
s = s.getvalue().strip()
|
|
1017
|
+
if s:
|
|
1018
|
+
# The destructor *may* have printed an unraisable error, check it
|
|
1019
|
+
self.assertEqual(len(s.splitlines()), 1)
|
|
1020
|
+
self.assertTrue(s.startswith("Exception OSError: "), s)
|
|
1021
|
+
self.assertTrue(s.endswith(" ignored"), s)
|
|
1022
|
+
|
|
1023
|
+
def test_repr(self):
|
|
1024
|
+
raw = self.MockRawIO()
|
|
1025
|
+
b = self.tp(raw)
|
|
1026
|
+
clsname = "%s.%s" % (self.tp.__module__, self.tp.__qualname__)
|
|
1027
|
+
self.assertEqual(repr(b), "<%s>" % clsname)
|
|
1028
|
+
raw.name = "dummy"
|
|
1029
|
+
self.assertEqual(repr(b), "<%s name='dummy'>" % clsname)
|
|
1030
|
+
raw.name = b"dummy"
|
|
1031
|
+
self.assertEqual(repr(b), "<%s name=b'dummy'>" % clsname)
|
|
1032
|
+
|
|
1033
|
+
def test_recursive_repr(self):
|
|
1034
|
+
# Issue #25455
|
|
1035
|
+
raw = self.MockRawIO()
|
|
1036
|
+
b = self.tp(raw)
|
|
1037
|
+
with support.swap_attr(raw, 'name', b):
|
|
1038
|
+
try:
|
|
1039
|
+
repr(b) # Should not crash
|
|
1040
|
+
except RuntimeError:
|
|
1041
|
+
pass
|
|
1042
|
+
|
|
1043
|
+
def test_flush_error_on_close(self):
|
|
1044
|
+
# Test that buffered file is closed despite failed flush
|
|
1045
|
+
# and that flush() is called before file closed.
|
|
1046
|
+
raw = self.MockRawIO()
|
|
1047
|
+
closed = []
|
|
1048
|
+
def bad_flush():
|
|
1049
|
+
closed[:] = [b.closed, raw.closed]
|
|
1050
|
+
raise OSError()
|
|
1051
|
+
raw.flush = bad_flush
|
|
1052
|
+
b = self.tp(raw)
|
|
1053
|
+
self.assertRaises(OSError, b.close) # exception not swallowed
|
|
1054
|
+
self.assertTrue(b.closed)
|
|
1055
|
+
self.assertTrue(raw.closed)
|
|
1056
|
+
self.assertTrue(closed) # flush() called
|
|
1057
|
+
self.assertFalse(closed[0]) # flush() called before file closed
|
|
1058
|
+
self.assertFalse(closed[1])
|
|
1059
|
+
raw.flush = lambda: None # break reference loop
|
|
1060
|
+
|
|
1061
|
+
def test_close_error_on_close(self):
|
|
1062
|
+
raw = self.MockRawIO()
|
|
1063
|
+
def bad_flush():
|
|
1064
|
+
raise OSError('flush')
|
|
1065
|
+
def bad_close():
|
|
1066
|
+
raise OSError('close')
|
|
1067
|
+
raw.close = bad_close
|
|
1068
|
+
b = self.tp(raw)
|
|
1069
|
+
b.flush = bad_flush
|
|
1070
|
+
with self.assertRaises(OSError) as err: # exception not swallowed
|
|
1071
|
+
b.close()
|
|
1072
|
+
self.assertEqual(err.exception.args, ('close',))
|
|
1073
|
+
self.assertIsInstance(err.exception.__context__, OSError)
|
|
1074
|
+
self.assertEqual(err.exception.__context__.args, ('flush',))
|
|
1075
|
+
self.assertFalse(b.closed)
|
|
1076
|
+
|
|
1077
|
+
def test_nonnormalized_close_error_on_close(self):
|
|
1078
|
+
# Issue #21677
|
|
1079
|
+
raw = self.MockRawIO()
|
|
1080
|
+
def bad_flush():
|
|
1081
|
+
raise non_existing_flush
|
|
1082
|
+
def bad_close():
|
|
1083
|
+
raise non_existing_close
|
|
1084
|
+
raw.close = bad_close
|
|
1085
|
+
b = self.tp(raw)
|
|
1086
|
+
b.flush = bad_flush
|
|
1087
|
+
with self.assertRaises(NameError) as err: # exception not swallowed
|
|
1088
|
+
b.close()
|
|
1089
|
+
self.assertIn('non_existing_close', str(err.exception))
|
|
1090
|
+
self.assertIsInstance(err.exception.__context__, NameError)
|
|
1091
|
+
self.assertIn('non_existing_flush', str(err.exception.__context__))
|
|
1092
|
+
self.assertFalse(b.closed)
|
|
1093
|
+
|
|
1094
|
+
def test_multi_close(self):
|
|
1095
|
+
raw = self.MockRawIO()
|
|
1096
|
+
b = self.tp(raw)
|
|
1097
|
+
b.close()
|
|
1098
|
+
b.close()
|
|
1099
|
+
b.close()
|
|
1100
|
+
self.assertRaises(ValueError, b.flush)
|
|
1101
|
+
|
|
1102
|
+
def test_unseekable(self):
|
|
1103
|
+
bufio = self.tp(self.MockUnseekableIO(b"A" * 10))
|
|
1104
|
+
self.assertRaises(self.UnsupportedOperation, bufio.tell)
|
|
1105
|
+
self.assertRaises(self.UnsupportedOperation, bufio.seek, 0)
|
|
1106
|
+
|
|
1107
|
+
def test_readonly_attributes(self):
|
|
1108
|
+
raw = self.MockRawIO()
|
|
1109
|
+
buf = self.tp(raw)
|
|
1110
|
+
x = self.MockRawIO()
|
|
1111
|
+
with self.assertRaises(AttributeError):
|
|
1112
|
+
buf.raw = x
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
class SizeofTest:
|
|
1116
|
+
|
|
1117
|
+
@support.cpython_only
|
|
1118
|
+
def test_sizeof(self):
|
|
1119
|
+
bufsize1 = 4096
|
|
1120
|
+
bufsize2 = 8192
|
|
1121
|
+
rawio = self.MockRawIO()
|
|
1122
|
+
bufio = self.tp(rawio, buffer_size=bufsize1)
|
|
1123
|
+
size = sys.getsizeof(bufio) - bufsize1
|
|
1124
|
+
rawio = self.MockRawIO()
|
|
1125
|
+
bufio = self.tp(rawio, buffer_size=bufsize2)
|
|
1126
|
+
self.assertEqual(sys.getsizeof(bufio), size + bufsize2)
|
|
1127
|
+
|
|
1128
|
+
@support.cpython_only
|
|
1129
|
+
def test_buffer_freeing(self) :
|
|
1130
|
+
bufsize = 4096
|
|
1131
|
+
rawio = self.MockRawIO()
|
|
1132
|
+
bufio = self.tp(rawio, buffer_size=bufsize)
|
|
1133
|
+
size = sys.getsizeof(bufio) - bufsize
|
|
1134
|
+
bufio.close()
|
|
1135
|
+
self.assertEqual(sys.getsizeof(bufio), size)
|
|
1136
|
+
|
|
1137
|
+
class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
|
|
1138
|
+
read_mode = "rb"
|
|
1139
|
+
|
|
1140
|
+
def test_constructor(self):
|
|
1141
|
+
rawio = self.MockRawIO([b"abc"])
|
|
1142
|
+
bufio = self.tp(rawio)
|
|
1143
|
+
bufio.__init__(rawio)
|
|
1144
|
+
bufio.__init__(rawio, buffer_size=1024)
|
|
1145
|
+
bufio.__init__(rawio, buffer_size=16)
|
|
1146
|
+
self.assertEqual(b"abc", bufio.read())
|
|
1147
|
+
self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0)
|
|
1148
|
+
self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16)
|
|
1149
|
+
self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1)
|
|
1150
|
+
rawio = self.MockRawIO([b"abc"])
|
|
1151
|
+
bufio.__init__(rawio)
|
|
1152
|
+
self.assertEqual(b"abc", bufio.read())
|
|
1153
|
+
|
|
1154
|
+
def test_uninitialized(self):
|
|
1155
|
+
bufio = self.tp.__new__(self.tp)
|
|
1156
|
+
del bufio
|
|
1157
|
+
bufio = self.tp.__new__(self.tp)
|
|
1158
|
+
self.assertRaisesRegex((ValueError, AttributeError),
|
|
1159
|
+
'uninitialized|has no attribute',
|
|
1160
|
+
bufio.read, 0)
|
|
1161
|
+
bufio.__init__(self.MockRawIO())
|
|
1162
|
+
self.assertEqual(bufio.read(0), b'')
|
|
1163
|
+
|
|
1164
|
+
def test_read(self):
|
|
1165
|
+
for arg in (None, 7):
|
|
1166
|
+
rawio = self.MockRawIO((b"abc", b"d", b"efg"))
|
|
1167
|
+
bufio = self.tp(rawio)
|
|
1168
|
+
self.assertEqual(b"abcdefg", bufio.read(arg))
|
|
1169
|
+
# Invalid args
|
|
1170
|
+
self.assertRaises(ValueError, bufio.read, -2)
|
|
1171
|
+
|
|
1172
|
+
def test_read1(self):
|
|
1173
|
+
rawio = self.MockRawIO((b"abc", b"d", b"efg"))
|
|
1174
|
+
bufio = self.tp(rawio)
|
|
1175
|
+
self.assertEqual(b"a", bufio.read(1))
|
|
1176
|
+
self.assertEqual(b"b", bufio.read1(1))
|
|
1177
|
+
self.assertEqual(rawio._reads, 1)
|
|
1178
|
+
self.assertEqual(b"c", bufio.read1(100))
|
|
1179
|
+
self.assertEqual(rawio._reads, 1)
|
|
1180
|
+
self.assertEqual(b"d", bufio.read1(100))
|
|
1181
|
+
self.assertEqual(rawio._reads, 2)
|
|
1182
|
+
self.assertEqual(b"efg", bufio.read1(100))
|
|
1183
|
+
self.assertEqual(rawio._reads, 3)
|
|
1184
|
+
self.assertEqual(b"", bufio.read1(100))
|
|
1185
|
+
self.assertEqual(rawio._reads, 4)
|
|
1186
|
+
# Invalid args
|
|
1187
|
+
self.assertRaises(ValueError, bufio.read1, -1)
|
|
1188
|
+
|
|
1189
|
+
def test_readinto(self):
|
|
1190
|
+
rawio = self.MockRawIO((b"abc", b"d", b"efg"))
|
|
1191
|
+
bufio = self.tp(rawio)
|
|
1192
|
+
b = bytearray(2)
|
|
1193
|
+
self.assertEqual(bufio.readinto(b), 2)
|
|
1194
|
+
self.assertEqual(b, b"ab")
|
|
1195
|
+
self.assertEqual(bufio.readinto(b), 2)
|
|
1196
|
+
self.assertEqual(b, b"cd")
|
|
1197
|
+
self.assertEqual(bufio.readinto(b), 2)
|
|
1198
|
+
self.assertEqual(b, b"ef")
|
|
1199
|
+
self.assertEqual(bufio.readinto(b), 1)
|
|
1200
|
+
self.assertEqual(b, b"gf")
|
|
1201
|
+
self.assertEqual(bufio.readinto(b), 0)
|
|
1202
|
+
self.assertEqual(b, b"gf")
|
|
1203
|
+
rawio = self.MockRawIO((b"abc", None))
|
|
1204
|
+
bufio = self.tp(rawio)
|
|
1205
|
+
self.assertEqual(bufio.readinto(b), 2)
|
|
1206
|
+
self.assertEqual(b, b"ab")
|
|
1207
|
+
self.assertEqual(bufio.readinto(b), 1)
|
|
1208
|
+
self.assertEqual(b, b"cb")
|
|
1209
|
+
|
|
1210
|
+
def test_readinto1(self):
|
|
1211
|
+
buffer_size = 10
|
|
1212
|
+
rawio = self.MockRawIO((b"abc", b"de", b"fgh", b"jkl"))
|
|
1213
|
+
bufio = self.tp(rawio, buffer_size=buffer_size)
|
|
1214
|
+
b = bytearray(2)
|
|
1215
|
+
self.assertEqual(bufio.peek(3), b'abc')
|
|
1216
|
+
self.assertEqual(rawio._reads, 1)
|
|
1217
|
+
self.assertEqual(bufio.readinto1(b), 2)
|
|
1218
|
+
self.assertEqual(b, b"ab")
|
|
1219
|
+
self.assertEqual(rawio._reads, 1)
|
|
1220
|
+
self.assertEqual(bufio.readinto1(b), 1)
|
|
1221
|
+
self.assertEqual(b[:1], b"c")
|
|
1222
|
+
self.assertEqual(rawio._reads, 1)
|
|
1223
|
+
self.assertEqual(bufio.readinto1(b), 2)
|
|
1224
|
+
self.assertEqual(b, b"de")
|
|
1225
|
+
self.assertEqual(rawio._reads, 2)
|
|
1226
|
+
b = bytearray(2*buffer_size)
|
|
1227
|
+
self.assertEqual(bufio.peek(3), b'fgh')
|
|
1228
|
+
self.assertEqual(rawio._reads, 3)
|
|
1229
|
+
self.assertEqual(bufio.readinto1(b), 6)
|
|
1230
|
+
self.assertEqual(b[:6], b"fghjkl")
|
|
1231
|
+
self.assertEqual(rawio._reads, 4)
|
|
1232
|
+
|
|
1233
|
+
def test_readinto_array(self):
|
|
1234
|
+
buffer_size = 60
|
|
1235
|
+
data = b"a" * 26
|
|
1236
|
+
rawio = self.MockRawIO((data,))
|
|
1237
|
+
bufio = self.tp(rawio, buffer_size=buffer_size)
|
|
1238
|
+
|
|
1239
|
+
# Create an array with element size > 1 byte
|
|
1240
|
+
b = array.array('i', b'x' * 32)
|
|
1241
|
+
assert len(b) != 16
|
|
1242
|
+
|
|
1243
|
+
# Read into it. We should get as many *bytes* as we can fit into b
|
|
1244
|
+
# (which is more than the number of elements)
|
|
1245
|
+
n = bufio.readinto(b)
|
|
1246
|
+
self.assertGreater(n, len(b))
|
|
1247
|
+
|
|
1248
|
+
# Check that old contents of b are preserved
|
|
1249
|
+
bm = memoryview(b).cast('B')
|
|
1250
|
+
self.assertLess(n, len(bm))
|
|
1251
|
+
self.assertEqual(bm[:n], data[:n])
|
|
1252
|
+
self.assertEqual(bm[n:], b'x' * (len(bm[n:])))
|
|
1253
|
+
|
|
1254
|
+
def test_readinto1_array(self):
|
|
1255
|
+
buffer_size = 60
|
|
1256
|
+
data = b"a" * 26
|
|
1257
|
+
rawio = self.MockRawIO((data,))
|
|
1258
|
+
bufio = self.tp(rawio, buffer_size=buffer_size)
|
|
1259
|
+
|
|
1260
|
+
# Create an array with element size > 1 byte
|
|
1261
|
+
b = array.array('i', b'x' * 32)
|
|
1262
|
+
assert len(b) != 16
|
|
1263
|
+
|
|
1264
|
+
# Read into it. We should get as many *bytes* as we can fit into b
|
|
1265
|
+
# (which is more than the number of elements)
|
|
1266
|
+
n = bufio.readinto1(b)
|
|
1267
|
+
self.assertGreater(n, len(b))
|
|
1268
|
+
|
|
1269
|
+
# Check that old contents of b are preserved
|
|
1270
|
+
bm = memoryview(b).cast('B')
|
|
1271
|
+
self.assertLess(n, len(bm))
|
|
1272
|
+
self.assertEqual(bm[:n], data[:n])
|
|
1273
|
+
self.assertEqual(bm[n:], b'x' * (len(bm[n:])))
|
|
1274
|
+
|
|
1275
|
+
def test_readlines(self):
|
|
1276
|
+
def bufio():
|
|
1277
|
+
rawio = self.MockRawIO((b"abc\n", b"d\n", b"ef"))
|
|
1278
|
+
return self.tp(rawio)
|
|
1279
|
+
self.assertEqual(bufio().readlines(), [b"abc\n", b"d\n", b"ef"])
|
|
1280
|
+
self.assertEqual(bufio().readlines(5), [b"abc\n", b"d\n"])
|
|
1281
|
+
self.assertEqual(bufio().readlines(None), [b"abc\n", b"d\n", b"ef"])
|
|
1282
|
+
|
|
1283
|
+
def test_buffering(self):
|
|
1284
|
+
data = b"abcdefghi"
|
|
1285
|
+
dlen = len(data)
|
|
1286
|
+
|
|
1287
|
+
tests = [
|
|
1288
|
+
[ 100, [ 3, 1, 4, 8 ], [ dlen, 0 ] ],
|
|
1289
|
+
[ 100, [ 3, 3, 3], [ dlen ] ],
|
|
1290
|
+
[ 4, [ 1, 2, 4, 2 ], [ 4, 4, 1 ] ],
|
|
1291
|
+
]
|
|
1292
|
+
|
|
1293
|
+
for bufsize, buf_read_sizes, raw_read_sizes in tests:
|
|
1294
|
+
rawio = self.MockFileIO(data)
|
|
1295
|
+
bufio = self.tp(rawio, buffer_size=bufsize)
|
|
1296
|
+
pos = 0
|
|
1297
|
+
for nbytes in buf_read_sizes:
|
|
1298
|
+
self.assertEqual(bufio.read(nbytes), data[pos:pos+nbytes])
|
|
1299
|
+
pos += nbytes
|
|
1300
|
+
# this is mildly implementation-dependent
|
|
1301
|
+
self.assertEqual(rawio.read_history, raw_read_sizes)
|
|
1302
|
+
|
|
1303
|
+
def test_read_non_blocking(self):
|
|
1304
|
+
# Inject some None's in there to simulate EWOULDBLOCK
|
|
1305
|
+
rawio = self.MockRawIO((b"abc", b"d", None, b"efg", None, None, None))
|
|
1306
|
+
bufio = self.tp(rawio)
|
|
1307
|
+
self.assertEqual(b"abcd", bufio.read(6))
|
|
1308
|
+
self.assertEqual(b"e", bufio.read(1))
|
|
1309
|
+
self.assertEqual(b"fg", bufio.read())
|
|
1310
|
+
self.assertEqual(b"", bufio.peek(1))
|
|
1311
|
+
self.assertIsNone(bufio.read())
|
|
1312
|
+
self.assertEqual(b"", bufio.read())
|
|
1313
|
+
|
|
1314
|
+
rawio = self.MockRawIO((b"a", None, None))
|
|
1315
|
+
self.assertEqual(b"a", rawio.readall())
|
|
1316
|
+
self.assertIsNone(rawio.readall())
|
|
1317
|
+
|
|
1318
|
+
def test_read_past_eof(self):
|
|
1319
|
+
rawio = self.MockRawIO((b"abc", b"d", b"efg"))
|
|
1320
|
+
bufio = self.tp(rawio)
|
|
1321
|
+
|
|
1322
|
+
self.assertEqual(b"abcdefg", bufio.read(9000))
|
|
1323
|
+
|
|
1324
|
+
def test_read_all(self):
|
|
1325
|
+
rawio = self.MockRawIO((b"abc", b"d", b"efg"))
|
|
1326
|
+
bufio = self.tp(rawio)
|
|
1327
|
+
|
|
1328
|
+
self.assertEqual(b"abcdefg", bufio.read())
|
|
1329
|
+
|
|
1330
|
+
@unittest.skipUnless(threading, 'Threading required for this test.')
|
|
1331
|
+
@support.requires_resource('cpu')
|
|
1332
|
+
def test_threads(self):
|
|
1333
|
+
try:
|
|
1334
|
+
# Write out many bytes with exactly the same number of 0's,
|
|
1335
|
+
# 1's... 255's. This will help us check that concurrent reading
|
|
1336
|
+
# doesn't duplicate or forget contents.
|
|
1337
|
+
N = 1000
|
|
1338
|
+
l = list(range(256)) * N
|
|
1339
|
+
random.shuffle(l)
|
|
1340
|
+
s = bytes(bytearray(l))
|
|
1341
|
+
with self.open(support.TESTFN, "wb") as f:
|
|
1342
|
+
f.write(s)
|
|
1343
|
+
with self.open(support.TESTFN, self.read_mode, buffering=0) as raw:
|
|
1344
|
+
bufio = self.tp(raw, 8)
|
|
1345
|
+
errors = []
|
|
1346
|
+
results = []
|
|
1347
|
+
def f():
|
|
1348
|
+
try:
|
|
1349
|
+
# Intra-buffer read then buffer-flushing read
|
|
1350
|
+
for n in cycle([1, 19]):
|
|
1351
|
+
s = bufio.read(n)
|
|
1352
|
+
if not s:
|
|
1353
|
+
break
|
|
1354
|
+
# list.append() is atomic
|
|
1355
|
+
results.append(s)
|
|
1356
|
+
except Exception as e:
|
|
1357
|
+
errors.append(e)
|
|
1358
|
+
raise
|
|
1359
|
+
threads = [threading.Thread(target=f) for x in range(20)]
|
|
1360
|
+
with support.start_threads(threads):
|
|
1361
|
+
time.sleep(0.02) # yield
|
|
1362
|
+
self.assertFalse(errors,
|
|
1363
|
+
"the following exceptions were caught: %r" % errors)
|
|
1364
|
+
s = b''.join(results)
|
|
1365
|
+
for i in range(256):
|
|
1366
|
+
c = bytes(bytearray([i]))
|
|
1367
|
+
self.assertEqual(s.count(c), N)
|
|
1368
|
+
finally:
|
|
1369
|
+
support.unlink(support.TESTFN)
|
|
1370
|
+
|
|
1371
|
+
def test_unseekable(self):
|
|
1372
|
+
bufio = self.tp(self.MockUnseekableIO(b"A" * 10))
|
|
1373
|
+
self.assertRaises(self.UnsupportedOperation, bufio.tell)
|
|
1374
|
+
self.assertRaises(self.UnsupportedOperation, bufio.seek, 0)
|
|
1375
|
+
bufio.read(1)
|
|
1376
|
+
self.assertRaises(self.UnsupportedOperation, bufio.seek, 0)
|
|
1377
|
+
self.assertRaises(self.UnsupportedOperation, bufio.tell)
|
|
1378
|
+
|
|
1379
|
+
def test_misbehaved_io(self):
|
|
1380
|
+
rawio = self.MisbehavedRawIO((b"abc", b"d", b"efg"))
|
|
1381
|
+
bufio = self.tp(rawio)
|
|
1382
|
+
self.assertRaises(OSError, bufio.seek, 0)
|
|
1383
|
+
self.assertRaises(OSError, bufio.tell)
|
|
1384
|
+
|
|
1385
|
+
def test_no_extraneous_read(self):
|
|
1386
|
+
# Issue #9550; when the raw IO object has satisfied the read request,
|
|
1387
|
+
# we should not issue any additional reads, otherwise it may block
|
|
1388
|
+
# (e.g. socket).
|
|
1389
|
+
bufsize = 16
|
|
1390
|
+
for n in (2, bufsize - 1, bufsize, bufsize + 1, bufsize * 2):
|
|
1391
|
+
rawio = self.MockRawIO([b"x" * n])
|
|
1392
|
+
bufio = self.tp(rawio, bufsize)
|
|
1393
|
+
self.assertEqual(bufio.read(n), b"x" * n)
|
|
1394
|
+
# Simple case: one raw read is enough to satisfy the request.
|
|
1395
|
+
self.assertEqual(rawio._extraneous_reads, 0,
|
|
1396
|
+
"failed for {}: {} != 0".format(n, rawio._extraneous_reads))
|
|
1397
|
+
# A more complex case where two raw reads are needed to satisfy
|
|
1398
|
+
# the request.
|
|
1399
|
+
rawio = self.MockRawIO([b"x" * (n - 1), b"x"])
|
|
1400
|
+
bufio = self.tp(rawio, bufsize)
|
|
1401
|
+
self.assertEqual(bufio.read(n), b"x" * n)
|
|
1402
|
+
self.assertEqual(rawio._extraneous_reads, 0,
|
|
1403
|
+
"failed for {}: {} != 0".format(n, rawio._extraneous_reads))
|
|
1404
|
+
|
|
1405
|
+
def test_read_on_closed(self):
|
|
1406
|
+
# Issue #23796
|
|
1407
|
+
b = io.BufferedReader(io.BytesIO(b"12"))
|
|
1408
|
+
b.read(1)
|
|
1409
|
+
b.close()
|
|
1410
|
+
self.assertRaises(ValueError, b.peek)
|
|
1411
|
+
self.assertRaises(ValueError, b.read1, 1)
|
|
1412
|
+
|
|
1413
|
+
|
|
1414
|
+
class CBufferedReaderTest(BufferedReaderTest, SizeofTest):
|
|
1415
|
+
tp = io.BufferedReader
|
|
1416
|
+
|
|
1417
|
+
def test_constructor(self):
|
|
1418
|
+
BufferedReaderTest.test_constructor(self)
|
|
1419
|
+
# The allocation can succeed on 32-bit builds, e.g. with more
|
|
1420
|
+
# than 2GB RAM and a 64-bit kernel.
|
|
1421
|
+
if sys.maxsize > 0x7FFFFFFF:
|
|
1422
|
+
rawio = self.MockRawIO()
|
|
1423
|
+
bufio = self.tp(rawio)
|
|
1424
|
+
self.assertRaises((OverflowError, MemoryError, ValueError),
|
|
1425
|
+
bufio.__init__, rawio, sys.maxsize)
|
|
1426
|
+
|
|
1427
|
+
def test_initialization(self):
|
|
1428
|
+
rawio = self.MockRawIO([b"abc"])
|
|
1429
|
+
bufio = self.tp(rawio)
|
|
1430
|
+
self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0)
|
|
1431
|
+
self.assertRaises(ValueError, bufio.read)
|
|
1432
|
+
self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16)
|
|
1433
|
+
self.assertRaises(ValueError, bufio.read)
|
|
1434
|
+
self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1)
|
|
1435
|
+
self.assertRaises(ValueError, bufio.read)
|
|
1436
|
+
|
|
1437
|
+
def test_misbehaved_io_read(self):
|
|
1438
|
+
rawio = self.MisbehavedRawIO((b"abc", b"d", b"efg"))
|
|
1439
|
+
bufio = self.tp(rawio)
|
|
1440
|
+
# _pyio.BufferedReader seems to implement reading different, so that
|
|
1441
|
+
# checking this is not so easy.
|
|
1442
|
+
self.assertRaises(OSError, bufio.read, 10)
|
|
1443
|
+
|
|
1444
|
+
def test_garbage_collection(self):
|
|
1445
|
+
# C BufferedReader objects are collected.
|
|
1446
|
+
# The Python version has __del__, so it ends into gc.garbage instead
|
|
1447
|
+
with support.check_warnings(('', ResourceWarning)):
|
|
1448
|
+
rawio = self.FileIO(support.TESTFN, "w+b")
|
|
1449
|
+
f = self.tp(rawio)
|
|
1450
|
+
f.f = f
|
|
1451
|
+
wr = weakref.ref(f)
|
|
1452
|
+
del f
|
|
1453
|
+
support.gc_collect()
|
|
1454
|
+
self.assertIsNone(wr(), wr)
|
|
1455
|
+
|
|
1456
|
+
def test_args_error(self):
|
|
1457
|
+
# Issue #17275
|
|
1458
|
+
with self.assertRaisesRegex(TypeError, "BufferedReader"):
|
|
1459
|
+
self.tp(io.BytesIO(), 1024, 1024, 1024)
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
class PyBufferedReaderTest(BufferedReaderTest):
|
|
1463
|
+
tp = pyio.BufferedReader
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
|
|
1467
|
+
write_mode = "wb"
|
|
1468
|
+
|
|
1469
|
+
def test_constructor(self):
|
|
1470
|
+
rawio = self.MockRawIO()
|
|
1471
|
+
bufio = self.tp(rawio)
|
|
1472
|
+
bufio.__init__(rawio)
|
|
1473
|
+
bufio.__init__(rawio, buffer_size=1024)
|
|
1474
|
+
bufio.__init__(rawio, buffer_size=16)
|
|
1475
|
+
self.assertEqual(3, bufio.write(b"abc"))
|
|
1476
|
+
bufio.flush()
|
|
1477
|
+
self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0)
|
|
1478
|
+
self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16)
|
|
1479
|
+
self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1)
|
|
1480
|
+
bufio.__init__(rawio)
|
|
1481
|
+
self.assertEqual(3, bufio.write(b"ghi"))
|
|
1482
|
+
bufio.flush()
|
|
1483
|
+
self.assertEqual(b"".join(rawio._write_stack), b"abcghi")
|
|
1484
|
+
|
|
1485
|
+
def test_uninitialized(self):
|
|
1486
|
+
bufio = self.tp.__new__(self.tp)
|
|
1487
|
+
del bufio
|
|
1488
|
+
bufio = self.tp.__new__(self.tp)
|
|
1489
|
+
self.assertRaisesRegex((ValueError, AttributeError),
|
|
1490
|
+
'uninitialized|has no attribute',
|
|
1491
|
+
bufio.write, b'')
|
|
1492
|
+
bufio.__init__(self.MockRawIO())
|
|
1493
|
+
self.assertEqual(bufio.write(b''), 0)
|
|
1494
|
+
|
|
1495
|
+
def test_detach_flush(self):
|
|
1496
|
+
raw = self.MockRawIO()
|
|
1497
|
+
buf = self.tp(raw)
|
|
1498
|
+
buf.write(b"howdy!")
|
|
1499
|
+
self.assertFalse(raw._write_stack)
|
|
1500
|
+
buf.detach()
|
|
1501
|
+
self.assertEqual(raw._write_stack, [b"howdy!"])
|
|
1502
|
+
|
|
1503
|
+
def test_write(self):
|
|
1504
|
+
# Write to the buffered IO but don't overflow the buffer.
|
|
1505
|
+
writer = self.MockRawIO()
|
|
1506
|
+
bufio = self.tp(writer, 8)
|
|
1507
|
+
bufio.write(b"abc")
|
|
1508
|
+
self.assertFalse(writer._write_stack)
|
|
1509
|
+
buffer = bytearray(b"def")
|
|
1510
|
+
bufio.write(buffer)
|
|
1511
|
+
buffer[:] = b"***" # Overwrite our copy of the data
|
|
1512
|
+
bufio.flush()
|
|
1513
|
+
self.assertEqual(b"".join(writer._write_stack), b"abcdef")
|
|
1514
|
+
|
|
1515
|
+
def test_write_overflow(self):
|
|
1516
|
+
writer = self.MockRawIO()
|
|
1517
|
+
bufio = self.tp(writer, 8)
|
|
1518
|
+
contents = b"abcdefghijklmnop"
|
|
1519
|
+
for n in range(0, len(contents), 3):
|
|
1520
|
+
bufio.write(contents[n:n+3])
|
|
1521
|
+
flushed = b"".join(writer._write_stack)
|
|
1522
|
+
# At least (total - 8) bytes were implicitly flushed, perhaps more
|
|
1523
|
+
# depending on the implementation.
|
|
1524
|
+
self.assertTrue(flushed.startswith(contents[:-8]), flushed)
|
|
1525
|
+
|
|
1526
|
+
def check_writes(self, intermediate_func):
|
|
1527
|
+
# Lots of writes, test the flushed output is as expected.
|
|
1528
|
+
contents = bytes(range(256)) * 1000
|
|
1529
|
+
n = 0
|
|
1530
|
+
writer = self.MockRawIO()
|
|
1531
|
+
bufio = self.tp(writer, 13)
|
|
1532
|
+
# Generator of write sizes: repeat each N 15 times then proceed to N+1
|
|
1533
|
+
def gen_sizes():
|
|
1534
|
+
for size in count(1):
|
|
1535
|
+
for i in range(15):
|
|
1536
|
+
yield size
|
|
1537
|
+
sizes = gen_sizes()
|
|
1538
|
+
while n < len(contents):
|
|
1539
|
+
size = min(next(sizes), len(contents) - n)
|
|
1540
|
+
self.assertEqual(bufio.write(contents[n:n+size]), size)
|
|
1541
|
+
intermediate_func(bufio)
|
|
1542
|
+
n += size
|
|
1543
|
+
bufio.flush()
|
|
1544
|
+
self.assertEqual(contents, b"".join(writer._write_stack))
|
|
1545
|
+
|
|
1546
|
+
def test_writes(self):
|
|
1547
|
+
self.check_writes(lambda bufio: None)
|
|
1548
|
+
|
|
1549
|
+
def test_writes_and_flushes(self):
|
|
1550
|
+
self.check_writes(lambda bufio: bufio.flush())
|
|
1551
|
+
|
|
1552
|
+
def test_writes_and_seeks(self):
|
|
1553
|
+
def _seekabs(bufio):
|
|
1554
|
+
pos = bufio.tell()
|
|
1555
|
+
bufio.seek(pos + 1, 0)
|
|
1556
|
+
bufio.seek(pos - 1, 0)
|
|
1557
|
+
bufio.seek(pos, 0)
|
|
1558
|
+
self.check_writes(_seekabs)
|
|
1559
|
+
def _seekrel(bufio):
|
|
1560
|
+
pos = bufio.seek(0, 1)
|
|
1561
|
+
bufio.seek(+1, 1)
|
|
1562
|
+
bufio.seek(-1, 1)
|
|
1563
|
+
bufio.seek(pos, 0)
|
|
1564
|
+
self.check_writes(_seekrel)
|
|
1565
|
+
|
|
1566
|
+
def test_writes_and_truncates(self):
|
|
1567
|
+
self.check_writes(lambda bufio: bufio.truncate(bufio.tell()))
|
|
1568
|
+
|
|
1569
|
+
def test_write_non_blocking(self):
|
|
1570
|
+
raw = self.MockNonBlockWriterIO()
|
|
1571
|
+
bufio = self.tp(raw, 8)
|
|
1572
|
+
|
|
1573
|
+
self.assertEqual(bufio.write(b"abcd"), 4)
|
|
1574
|
+
self.assertEqual(bufio.write(b"efghi"), 5)
|
|
1575
|
+
# 1 byte will be written, the rest will be buffered
|
|
1576
|
+
raw.block_on(b"k")
|
|
1577
|
+
self.assertEqual(bufio.write(b"jklmn"), 5)
|
|
1578
|
+
|
|
1579
|
+
# 8 bytes will be written, 8 will be buffered and the rest will be lost
|
|
1580
|
+
raw.block_on(b"0")
|
|
1581
|
+
try:
|
|
1582
|
+
bufio.write(b"opqrwxyz0123456789")
|
|
1583
|
+
except self.BlockingIOError as e:
|
|
1584
|
+
written = e.characters_written
|
|
1585
|
+
else:
|
|
1586
|
+
self.fail("BlockingIOError should have been raised")
|
|
1587
|
+
self.assertEqual(written, 16)
|
|
1588
|
+
self.assertEqual(raw.pop_written(),
|
|
1589
|
+
b"abcdefghijklmnopqrwxyz")
|
|
1590
|
+
|
|
1591
|
+
self.assertEqual(bufio.write(b"ABCDEFGHI"), 9)
|
|
1592
|
+
s = raw.pop_written()
|
|
1593
|
+
# Previously buffered bytes were flushed
|
|
1594
|
+
self.assertTrue(s.startswith(b"01234567A"), s)
|
|
1595
|
+
|
|
1596
|
+
def test_write_and_rewind(self):
|
|
1597
|
+
raw = io.BytesIO()
|
|
1598
|
+
bufio = self.tp(raw, 4)
|
|
1599
|
+
self.assertEqual(bufio.write(b"abcdef"), 6)
|
|
1600
|
+
self.assertEqual(bufio.tell(), 6)
|
|
1601
|
+
bufio.seek(0, 0)
|
|
1602
|
+
self.assertEqual(bufio.write(b"XY"), 2)
|
|
1603
|
+
bufio.seek(6, 0)
|
|
1604
|
+
self.assertEqual(raw.getvalue(), b"XYcdef")
|
|
1605
|
+
self.assertEqual(bufio.write(b"123456"), 6)
|
|
1606
|
+
bufio.flush()
|
|
1607
|
+
self.assertEqual(raw.getvalue(), b"XYcdef123456")
|
|
1608
|
+
|
|
1609
|
+
def test_flush(self):
|
|
1610
|
+
writer = self.MockRawIO()
|
|
1611
|
+
bufio = self.tp(writer, 8)
|
|
1612
|
+
bufio.write(b"abc")
|
|
1613
|
+
bufio.flush()
|
|
1614
|
+
self.assertEqual(b"abc", writer._write_stack[0])
|
|
1615
|
+
|
|
1616
|
+
def test_writelines(self):
|
|
1617
|
+
l = [b'ab', b'cd', b'ef']
|
|
1618
|
+
writer = self.MockRawIO()
|
|
1619
|
+
bufio = self.tp(writer, 8)
|
|
1620
|
+
bufio.writelines(l)
|
|
1621
|
+
bufio.flush()
|
|
1622
|
+
self.assertEqual(b''.join(writer._write_stack), b'abcdef')
|
|
1623
|
+
|
|
1624
|
+
def test_writelines_userlist(self):
|
|
1625
|
+
l = UserList([b'ab', b'cd', b'ef'])
|
|
1626
|
+
writer = self.MockRawIO()
|
|
1627
|
+
bufio = self.tp(writer, 8)
|
|
1628
|
+
bufio.writelines(l)
|
|
1629
|
+
bufio.flush()
|
|
1630
|
+
self.assertEqual(b''.join(writer._write_stack), b'abcdef')
|
|
1631
|
+
|
|
1632
|
+
def test_writelines_error(self):
|
|
1633
|
+
writer = self.MockRawIO()
|
|
1634
|
+
bufio = self.tp(writer, 8)
|
|
1635
|
+
self.assertRaises(TypeError, bufio.writelines, [1, 2, 3])
|
|
1636
|
+
self.assertRaises(TypeError, bufio.writelines, None)
|
|
1637
|
+
self.assertRaises(TypeError, bufio.writelines, 'abc')
|
|
1638
|
+
|
|
1639
|
+
def test_destructor(self):
|
|
1640
|
+
writer = self.MockRawIO()
|
|
1641
|
+
bufio = self.tp(writer, 8)
|
|
1642
|
+
bufio.write(b"abc")
|
|
1643
|
+
del bufio
|
|
1644
|
+
support.gc_collect()
|
|
1645
|
+
self.assertEqual(b"abc", writer._write_stack[0])
|
|
1646
|
+
|
|
1647
|
+
def test_truncate(self):
|
|
1648
|
+
# Truncate implicitly flushes the buffer.
|
|
1649
|
+
with self.open(support.TESTFN, self.write_mode, buffering=0) as raw:
|
|
1650
|
+
bufio = self.tp(raw, 8)
|
|
1651
|
+
bufio.write(b"abcdef")
|
|
1652
|
+
self.assertEqual(bufio.truncate(3), 3)
|
|
1653
|
+
self.assertEqual(bufio.tell(), 6)
|
|
1654
|
+
with self.open(support.TESTFN, "rb", buffering=0) as f:
|
|
1655
|
+
self.assertEqual(f.read(), b"abc")
|
|
1656
|
+
|
|
1657
|
+
@unittest.skipUnless(threading, 'Threading required for this test.')
|
|
1658
|
+
@support.requires_resource('cpu')
|
|
1659
|
+
def test_threads(self):
|
|
1660
|
+
try:
|
|
1661
|
+
# Write out many bytes from many threads and test they were
|
|
1662
|
+
# all flushed.
|
|
1663
|
+
N = 1000
|
|
1664
|
+
contents = bytes(range(256)) * N
|
|
1665
|
+
sizes = cycle([1, 19])
|
|
1666
|
+
n = 0
|
|
1667
|
+
queue = deque()
|
|
1668
|
+
while n < len(contents):
|
|
1669
|
+
size = next(sizes)
|
|
1670
|
+
queue.append(contents[n:n+size])
|
|
1671
|
+
n += size
|
|
1672
|
+
del contents
|
|
1673
|
+
# We use a real file object because it allows us to
|
|
1674
|
+
# exercise situations where the GIL is released before
|
|
1675
|
+
# writing the buffer to the raw streams. This is in addition
|
|
1676
|
+
# to concurrency issues due to switching threads in the middle
|
|
1677
|
+
# of Python code.
|
|
1678
|
+
with self.open(support.TESTFN, self.write_mode, buffering=0) as raw:
|
|
1679
|
+
bufio = self.tp(raw, 8)
|
|
1680
|
+
errors = []
|
|
1681
|
+
def f():
|
|
1682
|
+
try:
|
|
1683
|
+
while True:
|
|
1684
|
+
try:
|
|
1685
|
+
s = queue.popleft()
|
|
1686
|
+
except IndexError:
|
|
1687
|
+
return
|
|
1688
|
+
bufio.write(s)
|
|
1689
|
+
except Exception as e:
|
|
1690
|
+
errors.append(e)
|
|
1691
|
+
raise
|
|
1692
|
+
threads = [threading.Thread(target=f) for x in range(20)]
|
|
1693
|
+
with support.start_threads(threads):
|
|
1694
|
+
time.sleep(0.02) # yield
|
|
1695
|
+
self.assertFalse(errors,
|
|
1696
|
+
"the following exceptions were caught: %r" % errors)
|
|
1697
|
+
bufio.close()
|
|
1698
|
+
with self.open(support.TESTFN, "rb") as f:
|
|
1699
|
+
s = f.read()
|
|
1700
|
+
for i in range(256):
|
|
1701
|
+
self.assertEqual(s.count(bytes([i])), N)
|
|
1702
|
+
finally:
|
|
1703
|
+
support.unlink(support.TESTFN)
|
|
1704
|
+
|
|
1705
|
+
def test_misbehaved_io(self):
|
|
1706
|
+
rawio = self.MisbehavedRawIO()
|
|
1707
|
+
bufio = self.tp(rawio, 5)
|
|
1708
|
+
self.assertRaises(OSError, bufio.seek, 0)
|
|
1709
|
+
self.assertRaises(OSError, bufio.tell)
|
|
1710
|
+
self.assertRaises(OSError, bufio.write, b"abcdef")
|
|
1711
|
+
|
|
1712
|
+
def test_max_buffer_size_removal(self):
|
|
1713
|
+
with self.assertRaises(TypeError):
|
|
1714
|
+
self.tp(self.MockRawIO(), 8, 12)
|
|
1715
|
+
|
|
1716
|
+
def test_write_error_on_close(self):
|
|
1717
|
+
raw = self.MockRawIO()
|
|
1718
|
+
def bad_write(b):
|
|
1719
|
+
raise OSError()
|
|
1720
|
+
raw.write = bad_write
|
|
1721
|
+
b = self.tp(raw)
|
|
1722
|
+
b.write(b'spam')
|
|
1723
|
+
self.assertRaises(OSError, b.close) # exception not swallowed
|
|
1724
|
+
self.assertTrue(b.closed)
|
|
1725
|
+
|
|
1726
|
+
|
|
1727
|
+
class CBufferedWriterTest(BufferedWriterTest, SizeofTest):
|
|
1728
|
+
tp = io.BufferedWriter
|
|
1729
|
+
|
|
1730
|
+
def test_constructor(self):
|
|
1731
|
+
BufferedWriterTest.test_constructor(self)
|
|
1732
|
+
# The allocation can succeed on 32-bit builds, e.g. with more
|
|
1733
|
+
# than 2GB RAM and a 64-bit kernel.
|
|
1734
|
+
if sys.maxsize > 0x7FFFFFFF:
|
|
1735
|
+
rawio = self.MockRawIO()
|
|
1736
|
+
bufio = self.tp(rawio)
|
|
1737
|
+
self.assertRaises((OverflowError, MemoryError, ValueError),
|
|
1738
|
+
bufio.__init__, rawio, sys.maxsize)
|
|
1739
|
+
|
|
1740
|
+
def test_initialization(self):
|
|
1741
|
+
rawio = self.MockRawIO()
|
|
1742
|
+
bufio = self.tp(rawio)
|
|
1743
|
+
self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0)
|
|
1744
|
+
self.assertRaises(ValueError, bufio.write, b"def")
|
|
1745
|
+
self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16)
|
|
1746
|
+
self.assertRaises(ValueError, bufio.write, b"def")
|
|
1747
|
+
self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1)
|
|
1748
|
+
self.assertRaises(ValueError, bufio.write, b"def")
|
|
1749
|
+
|
|
1750
|
+
def test_garbage_collection(self):
|
|
1751
|
+
# C BufferedWriter objects are collected, and collecting them flushes
|
|
1752
|
+
# all data to disk.
|
|
1753
|
+
# The Python version has __del__, so it ends into gc.garbage instead
|
|
1754
|
+
with support.check_warnings(('', ResourceWarning)):
|
|
1755
|
+
rawio = self.FileIO(support.TESTFN, "w+b")
|
|
1756
|
+
f = self.tp(rawio)
|
|
1757
|
+
f.write(b"123xxx")
|
|
1758
|
+
f.x = f
|
|
1759
|
+
wr = weakref.ref(f)
|
|
1760
|
+
del f
|
|
1761
|
+
support.gc_collect()
|
|
1762
|
+
self.assertIsNone(wr(), wr)
|
|
1763
|
+
with self.open(support.TESTFN, "rb") as f:
|
|
1764
|
+
self.assertEqual(f.read(), b"123xxx")
|
|
1765
|
+
|
|
1766
|
+
def test_args_error(self):
|
|
1767
|
+
# Issue #17275
|
|
1768
|
+
with self.assertRaisesRegex(TypeError, "BufferedWriter"):
|
|
1769
|
+
self.tp(io.BytesIO(), 1024, 1024, 1024)
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
class PyBufferedWriterTest(BufferedWriterTest):
|
|
1773
|
+
tp = pyio.BufferedWriter
|
|
1774
|
+
|
|
1775
|
+
class BufferedRWPairTest(unittest.TestCase):
|
|
1776
|
+
|
|
1777
|
+
def test_constructor(self):
|
|
1778
|
+
pair = self.tp(self.MockRawIO(), self.MockRawIO())
|
|
1779
|
+
self.assertFalse(pair.closed)
|
|
1780
|
+
|
|
1781
|
+
def test_uninitialized(self):
|
|
1782
|
+
pair = self.tp.__new__(self.tp)
|
|
1783
|
+
del pair
|
|
1784
|
+
pair = self.tp.__new__(self.tp)
|
|
1785
|
+
self.assertRaisesRegex((ValueError, AttributeError),
|
|
1786
|
+
'uninitialized|has no attribute',
|
|
1787
|
+
pair.read, 0)
|
|
1788
|
+
self.assertRaisesRegex((ValueError, AttributeError),
|
|
1789
|
+
'uninitialized|has no attribute',
|
|
1790
|
+
pair.write, b'')
|
|
1791
|
+
pair.__init__(self.MockRawIO(), self.MockRawIO())
|
|
1792
|
+
self.assertEqual(pair.read(0), b'')
|
|
1793
|
+
self.assertEqual(pair.write(b''), 0)
|
|
1794
|
+
|
|
1795
|
+
def test_detach(self):
|
|
1796
|
+
pair = self.tp(self.MockRawIO(), self.MockRawIO())
|
|
1797
|
+
self.assertRaises(self.UnsupportedOperation, pair.detach)
|
|
1798
|
+
|
|
1799
|
+
def test_constructor_max_buffer_size_removal(self):
|
|
1800
|
+
with self.assertRaises(TypeError):
|
|
1801
|
+
self.tp(self.MockRawIO(), self.MockRawIO(), 8, 12)
|
|
1802
|
+
|
|
1803
|
+
def test_constructor_with_not_readable(self):
|
|
1804
|
+
class NotReadable(MockRawIO):
|
|
1805
|
+
def readable(self):
|
|
1806
|
+
return False
|
|
1807
|
+
|
|
1808
|
+
self.assertRaises(OSError, self.tp, NotReadable(), self.MockRawIO())
|
|
1809
|
+
|
|
1810
|
+
def test_constructor_with_not_writeable(self):
|
|
1811
|
+
class NotWriteable(MockRawIO):
|
|
1812
|
+
def writable(self):
|
|
1813
|
+
return False
|
|
1814
|
+
|
|
1815
|
+
self.assertRaises(OSError, self.tp, self.MockRawIO(), NotWriteable())
|
|
1816
|
+
|
|
1817
|
+
def test_read(self):
|
|
1818
|
+
pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO())
|
|
1819
|
+
|
|
1820
|
+
self.assertEqual(pair.read(3), b"abc")
|
|
1821
|
+
self.assertEqual(pair.read(1), b"d")
|
|
1822
|
+
self.assertEqual(pair.read(), b"ef")
|
|
1823
|
+
pair = self.tp(self.BytesIO(b"abc"), self.MockRawIO())
|
|
1824
|
+
self.assertEqual(pair.read(None), b"abc")
|
|
1825
|
+
|
|
1826
|
+
def test_readlines(self):
|
|
1827
|
+
pair = lambda: self.tp(self.BytesIO(b"abc\ndef\nh"), self.MockRawIO())
|
|
1828
|
+
self.assertEqual(pair().readlines(), [b"abc\n", b"def\n", b"h"])
|
|
1829
|
+
self.assertEqual(pair().readlines(), [b"abc\n", b"def\n", b"h"])
|
|
1830
|
+
self.assertEqual(pair().readlines(5), [b"abc\n", b"def\n"])
|
|
1831
|
+
|
|
1832
|
+
def test_read1(self):
|
|
1833
|
+
# .read1() is delegated to the underlying reader object, so this test
|
|
1834
|
+
# can be shallow.
|
|
1835
|
+
pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO())
|
|
1836
|
+
|
|
1837
|
+
self.assertEqual(pair.read1(3), b"abc")
|
|
1838
|
+
|
|
1839
|
+
def test_readinto(self):
|
|
1840
|
+
for method in ("readinto", "readinto1"):
|
|
1841
|
+
with self.subTest(method):
|
|
1842
|
+
pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO())
|
|
1843
|
+
|
|
1844
|
+
data = byteslike(b'\0' * 5)
|
|
1845
|
+
self.assertEqual(getattr(pair, method)(data), 5)
|
|
1846
|
+
self.assertEqual(bytes(data), b"abcde")
|
|
1847
|
+
|
|
1848
|
+
def test_write(self):
|
|
1849
|
+
w = self.MockRawIO()
|
|
1850
|
+
pair = self.tp(self.MockRawIO(), w)
|
|
1851
|
+
|
|
1852
|
+
pair.write(b"abc")
|
|
1853
|
+
pair.flush()
|
|
1854
|
+
buffer = bytearray(b"def")
|
|
1855
|
+
pair.write(buffer)
|
|
1856
|
+
buffer[:] = b"***" # Overwrite our copy of the data
|
|
1857
|
+
pair.flush()
|
|
1858
|
+
self.assertEqual(w._write_stack, [b"abc", b"def"])
|
|
1859
|
+
|
|
1860
|
+
def test_peek(self):
|
|
1861
|
+
pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO())
|
|
1862
|
+
|
|
1863
|
+
self.assertTrue(pair.peek(3).startswith(b"abc"))
|
|
1864
|
+
self.assertEqual(pair.read(3), b"abc")
|
|
1865
|
+
|
|
1866
|
+
def test_readable(self):
|
|
1867
|
+
pair = self.tp(self.MockRawIO(), self.MockRawIO())
|
|
1868
|
+
self.assertTrue(pair.readable())
|
|
1869
|
+
|
|
1870
|
+
def test_writeable(self):
|
|
1871
|
+
pair = self.tp(self.MockRawIO(), self.MockRawIO())
|
|
1872
|
+
self.assertTrue(pair.writable())
|
|
1873
|
+
|
|
1874
|
+
def test_seekable(self):
|
|
1875
|
+
# BufferedRWPairs are never seekable, even if their readers and writers
|
|
1876
|
+
# are.
|
|
1877
|
+
pair = self.tp(self.MockRawIO(), self.MockRawIO())
|
|
1878
|
+
self.assertFalse(pair.seekable())
|
|
1879
|
+
|
|
1880
|
+
# .flush() is delegated to the underlying writer object and has been
|
|
1881
|
+
# tested in the test_write method.
|
|
1882
|
+
|
|
1883
|
+
def test_close_and_closed(self):
|
|
1884
|
+
pair = self.tp(self.MockRawIO(), self.MockRawIO())
|
|
1885
|
+
self.assertFalse(pair.closed)
|
|
1886
|
+
pair.close()
|
|
1887
|
+
self.assertTrue(pair.closed)
|
|
1888
|
+
|
|
1889
|
+
def test_reader_close_error_on_close(self):
|
|
1890
|
+
def reader_close():
|
|
1891
|
+
reader_non_existing
|
|
1892
|
+
reader = self.MockRawIO()
|
|
1893
|
+
reader.close = reader_close
|
|
1894
|
+
writer = self.MockRawIO()
|
|
1895
|
+
pair = self.tp(reader, writer)
|
|
1896
|
+
with self.assertRaises(NameError) as err:
|
|
1897
|
+
pair.close()
|
|
1898
|
+
self.assertIn('reader_non_existing', str(err.exception))
|
|
1899
|
+
self.assertTrue(pair.closed)
|
|
1900
|
+
self.assertFalse(reader.closed)
|
|
1901
|
+
self.assertTrue(writer.closed)
|
|
1902
|
+
|
|
1903
|
+
def test_writer_close_error_on_close(self):
|
|
1904
|
+
def writer_close():
|
|
1905
|
+
writer_non_existing
|
|
1906
|
+
reader = self.MockRawIO()
|
|
1907
|
+
writer = self.MockRawIO()
|
|
1908
|
+
writer.close = writer_close
|
|
1909
|
+
pair = self.tp(reader, writer)
|
|
1910
|
+
with self.assertRaises(NameError) as err:
|
|
1911
|
+
pair.close()
|
|
1912
|
+
self.assertIn('writer_non_existing', str(err.exception))
|
|
1913
|
+
self.assertFalse(pair.closed)
|
|
1914
|
+
self.assertTrue(reader.closed)
|
|
1915
|
+
self.assertFalse(writer.closed)
|
|
1916
|
+
|
|
1917
|
+
def test_reader_writer_close_error_on_close(self):
|
|
1918
|
+
def reader_close():
|
|
1919
|
+
reader_non_existing
|
|
1920
|
+
def writer_close():
|
|
1921
|
+
writer_non_existing
|
|
1922
|
+
reader = self.MockRawIO()
|
|
1923
|
+
reader.close = reader_close
|
|
1924
|
+
writer = self.MockRawIO()
|
|
1925
|
+
writer.close = writer_close
|
|
1926
|
+
pair = self.tp(reader, writer)
|
|
1927
|
+
with self.assertRaises(NameError) as err:
|
|
1928
|
+
pair.close()
|
|
1929
|
+
self.assertIn('reader_non_existing', str(err.exception))
|
|
1930
|
+
self.assertIsInstance(err.exception.__context__, NameError)
|
|
1931
|
+
self.assertIn('writer_non_existing', str(err.exception.__context__))
|
|
1932
|
+
self.assertFalse(pair.closed)
|
|
1933
|
+
self.assertFalse(reader.closed)
|
|
1934
|
+
self.assertFalse(writer.closed)
|
|
1935
|
+
|
|
1936
|
+
def test_isatty(self):
|
|
1937
|
+
class SelectableIsAtty(MockRawIO):
|
|
1938
|
+
def __init__(self, isatty):
|
|
1939
|
+
MockRawIO.__init__(self)
|
|
1940
|
+
self._isatty = isatty
|
|
1941
|
+
|
|
1942
|
+
def isatty(self):
|
|
1943
|
+
return self._isatty
|
|
1944
|
+
|
|
1945
|
+
pair = self.tp(SelectableIsAtty(False), SelectableIsAtty(False))
|
|
1946
|
+
self.assertFalse(pair.isatty())
|
|
1947
|
+
|
|
1948
|
+
pair = self.tp(SelectableIsAtty(True), SelectableIsAtty(False))
|
|
1949
|
+
self.assertTrue(pair.isatty())
|
|
1950
|
+
|
|
1951
|
+
pair = self.tp(SelectableIsAtty(False), SelectableIsAtty(True))
|
|
1952
|
+
self.assertTrue(pair.isatty())
|
|
1953
|
+
|
|
1954
|
+
pair = self.tp(SelectableIsAtty(True), SelectableIsAtty(True))
|
|
1955
|
+
self.assertTrue(pair.isatty())
|
|
1956
|
+
|
|
1957
|
+
def test_weakref_clearing(self):
|
|
1958
|
+
brw = self.tp(self.MockRawIO(), self.MockRawIO())
|
|
1959
|
+
ref = weakref.ref(brw)
|
|
1960
|
+
brw = None
|
|
1961
|
+
ref = None # Shouldn't segfault.
|
|
1962
|
+
|
|
1963
|
+
class CBufferedRWPairTest(BufferedRWPairTest):
|
|
1964
|
+
tp = io.BufferedRWPair
|
|
1965
|
+
|
|
1966
|
+
class PyBufferedRWPairTest(BufferedRWPairTest):
|
|
1967
|
+
tp = pyio.BufferedRWPair
|
|
1968
|
+
|
|
1969
|
+
|
|
1970
|
+
class BufferedRandomTest(BufferedReaderTest, BufferedWriterTest):
|
|
1971
|
+
read_mode = "rb+"
|
|
1972
|
+
write_mode = "wb+"
|
|
1973
|
+
|
|
1974
|
+
def test_constructor(self):
|
|
1975
|
+
BufferedReaderTest.test_constructor(self)
|
|
1976
|
+
BufferedWriterTest.test_constructor(self)
|
|
1977
|
+
|
|
1978
|
+
def test_uninitialized(self):
|
|
1979
|
+
BufferedReaderTest.test_uninitialized(self)
|
|
1980
|
+
BufferedWriterTest.test_uninitialized(self)
|
|
1981
|
+
|
|
1982
|
+
def test_read_and_write(self):
|
|
1983
|
+
raw = self.MockRawIO((b"asdf", b"ghjk"))
|
|
1984
|
+
rw = self.tp(raw, 8)
|
|
1985
|
+
|
|
1986
|
+
self.assertEqual(b"as", rw.read(2))
|
|
1987
|
+
rw.write(b"ddd")
|
|
1988
|
+
rw.write(b"eee")
|
|
1989
|
+
self.assertFalse(raw._write_stack) # Buffer writes
|
|
1990
|
+
self.assertEqual(b"ghjk", rw.read())
|
|
1991
|
+
self.assertEqual(b"dddeee", raw._write_stack[0])
|
|
1992
|
+
|
|
1993
|
+
def test_seek_and_tell(self):
|
|
1994
|
+
raw = self.BytesIO(b"asdfghjkl")
|
|
1995
|
+
rw = self.tp(raw)
|
|
1996
|
+
|
|
1997
|
+
self.assertEqual(b"as", rw.read(2))
|
|
1998
|
+
self.assertEqual(2, rw.tell())
|
|
1999
|
+
rw.seek(0, 0)
|
|
2000
|
+
self.assertEqual(b"asdf", rw.read(4))
|
|
2001
|
+
|
|
2002
|
+
rw.write(b"123f")
|
|
2003
|
+
rw.seek(0, 0)
|
|
2004
|
+
self.assertEqual(b"asdf123fl", rw.read())
|
|
2005
|
+
self.assertEqual(9, rw.tell())
|
|
2006
|
+
rw.seek(-4, 2)
|
|
2007
|
+
self.assertEqual(5, rw.tell())
|
|
2008
|
+
rw.seek(2, 1)
|
|
2009
|
+
self.assertEqual(7, rw.tell())
|
|
2010
|
+
self.assertEqual(b"fl", rw.read(11))
|
|
2011
|
+
rw.flush()
|
|
2012
|
+
self.assertEqual(b"asdf123fl", raw.getvalue())
|
|
2013
|
+
|
|
2014
|
+
self.assertRaises(TypeError, rw.seek, 0.0)
|
|
2015
|
+
|
|
2016
|
+
def check_flush_and_read(self, read_func):
|
|
2017
|
+
raw = self.BytesIO(b"abcdefghi")
|
|
2018
|
+
bufio = self.tp(raw)
|
|
2019
|
+
|
|
2020
|
+
self.assertEqual(b"ab", read_func(bufio, 2))
|
|
2021
|
+
bufio.write(b"12")
|
|
2022
|
+
self.assertEqual(b"ef", read_func(bufio, 2))
|
|
2023
|
+
self.assertEqual(6, bufio.tell())
|
|
2024
|
+
bufio.flush()
|
|
2025
|
+
self.assertEqual(6, bufio.tell())
|
|
2026
|
+
self.assertEqual(b"ghi", read_func(bufio))
|
|
2027
|
+
raw.seek(0, 0)
|
|
2028
|
+
raw.write(b"XYZ")
|
|
2029
|
+
# flush() resets the read buffer
|
|
2030
|
+
bufio.flush()
|
|
2031
|
+
bufio.seek(0, 0)
|
|
2032
|
+
self.assertEqual(b"XYZ", read_func(bufio, 3))
|
|
2033
|
+
|
|
2034
|
+
def test_flush_and_read(self):
|
|
2035
|
+
self.check_flush_and_read(lambda bufio, *args: bufio.read(*args))
|
|
2036
|
+
|
|
2037
|
+
def test_flush_and_readinto(self):
|
|
2038
|
+
def _readinto(bufio, n=-1):
|
|
2039
|
+
b = bytearray(n if n >= 0 else 9999)
|
|
2040
|
+
n = bufio.readinto(b)
|
|
2041
|
+
return bytes(b[:n])
|
|
2042
|
+
self.check_flush_and_read(_readinto)
|
|
2043
|
+
|
|
2044
|
+
def test_flush_and_peek(self):
|
|
2045
|
+
def _peek(bufio, n=-1):
|
|
2046
|
+
# This relies on the fact that the buffer can contain the whole
|
|
2047
|
+
# raw stream, otherwise peek() can return less.
|
|
2048
|
+
b = bufio.peek(n)
|
|
2049
|
+
if n != -1:
|
|
2050
|
+
b = b[:n]
|
|
2051
|
+
bufio.seek(len(b), 1)
|
|
2052
|
+
return b
|
|
2053
|
+
self.check_flush_and_read(_peek)
|
|
2054
|
+
|
|
2055
|
+
def test_flush_and_write(self):
|
|
2056
|
+
raw = self.BytesIO(b"abcdefghi")
|
|
2057
|
+
bufio = self.tp(raw)
|
|
2058
|
+
|
|
2059
|
+
bufio.write(b"123")
|
|
2060
|
+
bufio.flush()
|
|
2061
|
+
bufio.write(b"45")
|
|
2062
|
+
bufio.flush()
|
|
2063
|
+
bufio.seek(0, 0)
|
|
2064
|
+
self.assertEqual(b"12345fghi", raw.getvalue())
|
|
2065
|
+
self.assertEqual(b"12345fghi", bufio.read())
|
|
2066
|
+
|
|
2067
|
+
def test_threads(self):
|
|
2068
|
+
BufferedReaderTest.test_threads(self)
|
|
2069
|
+
BufferedWriterTest.test_threads(self)
|
|
2070
|
+
|
|
2071
|
+
def test_writes_and_peek(self):
|
|
2072
|
+
def _peek(bufio):
|
|
2073
|
+
bufio.peek(1)
|
|
2074
|
+
self.check_writes(_peek)
|
|
2075
|
+
def _peek(bufio):
|
|
2076
|
+
pos = bufio.tell()
|
|
2077
|
+
bufio.seek(-1, 1)
|
|
2078
|
+
bufio.peek(1)
|
|
2079
|
+
bufio.seek(pos, 0)
|
|
2080
|
+
self.check_writes(_peek)
|
|
2081
|
+
|
|
2082
|
+
def test_writes_and_reads(self):
|
|
2083
|
+
def _read(bufio):
|
|
2084
|
+
bufio.seek(-1, 1)
|
|
2085
|
+
bufio.read(1)
|
|
2086
|
+
self.check_writes(_read)
|
|
2087
|
+
|
|
2088
|
+
def test_writes_and_read1s(self):
|
|
2089
|
+
def _read1(bufio):
|
|
2090
|
+
bufio.seek(-1, 1)
|
|
2091
|
+
bufio.read1(1)
|
|
2092
|
+
self.check_writes(_read1)
|
|
2093
|
+
|
|
2094
|
+
def test_writes_and_readintos(self):
|
|
2095
|
+
def _read(bufio):
|
|
2096
|
+
bufio.seek(-1, 1)
|
|
2097
|
+
bufio.readinto(bytearray(1))
|
|
2098
|
+
self.check_writes(_read)
|
|
2099
|
+
|
|
2100
|
+
def test_write_after_readahead(self):
|
|
2101
|
+
# Issue #6629: writing after the buffer was filled by readahead should
|
|
2102
|
+
# first rewind the raw stream.
|
|
2103
|
+
for overwrite_size in [1, 5]:
|
|
2104
|
+
raw = self.BytesIO(b"A" * 10)
|
|
2105
|
+
bufio = self.tp(raw, 4)
|
|
2106
|
+
# Trigger readahead
|
|
2107
|
+
self.assertEqual(bufio.read(1), b"A")
|
|
2108
|
+
self.assertEqual(bufio.tell(), 1)
|
|
2109
|
+
# Overwriting should rewind the raw stream if it needs so
|
|
2110
|
+
bufio.write(b"B" * overwrite_size)
|
|
2111
|
+
self.assertEqual(bufio.tell(), overwrite_size + 1)
|
|
2112
|
+
# If the write size was smaller than the buffer size, flush() and
|
|
2113
|
+
# check that rewind happens.
|
|
2114
|
+
bufio.flush()
|
|
2115
|
+
self.assertEqual(bufio.tell(), overwrite_size + 1)
|
|
2116
|
+
s = raw.getvalue()
|
|
2117
|
+
self.assertEqual(s,
|
|
2118
|
+
b"A" + b"B" * overwrite_size + b"A" * (9 - overwrite_size))
|
|
2119
|
+
|
|
2120
|
+
def test_write_rewind_write(self):
|
|
2121
|
+
# Various combinations of reading / writing / seeking backwards / writing again
|
|
2122
|
+
def mutate(bufio, pos1, pos2):
|
|
2123
|
+
assert pos2 >= pos1
|
|
2124
|
+
# Fill the buffer
|
|
2125
|
+
bufio.seek(pos1)
|
|
2126
|
+
bufio.read(pos2 - pos1)
|
|
2127
|
+
bufio.write(b'\x02')
|
|
2128
|
+
# This writes earlier than the previous write, but still inside
|
|
2129
|
+
# the buffer.
|
|
2130
|
+
bufio.seek(pos1)
|
|
2131
|
+
bufio.write(b'\x01')
|
|
2132
|
+
|
|
2133
|
+
b = b"\x80\x81\x82\x83\x84"
|
|
2134
|
+
for i in range(0, len(b)):
|
|
2135
|
+
for j in range(i, len(b)):
|
|
2136
|
+
raw = self.BytesIO(b)
|
|
2137
|
+
bufio = self.tp(raw, 100)
|
|
2138
|
+
mutate(bufio, i, j)
|
|
2139
|
+
bufio.flush()
|
|
2140
|
+
expected = bytearray(b)
|
|
2141
|
+
expected[j] = 2
|
|
2142
|
+
expected[i] = 1
|
|
2143
|
+
self.assertEqual(raw.getvalue(), expected,
|
|
2144
|
+
"failed result for i=%d, j=%d" % (i, j))
|
|
2145
|
+
|
|
2146
|
+
def test_truncate_after_read_or_write(self):
|
|
2147
|
+
raw = self.BytesIO(b"A" * 10)
|
|
2148
|
+
bufio = self.tp(raw, 100)
|
|
2149
|
+
self.assertEqual(bufio.read(2), b"AA") # the read buffer gets filled
|
|
2150
|
+
self.assertEqual(bufio.truncate(), 2)
|
|
2151
|
+
self.assertEqual(bufio.write(b"BB"), 2) # the write buffer increases
|
|
2152
|
+
self.assertEqual(bufio.truncate(), 4)
|
|
2153
|
+
|
|
2154
|
+
def test_misbehaved_io(self):
|
|
2155
|
+
BufferedReaderTest.test_misbehaved_io(self)
|
|
2156
|
+
BufferedWriterTest.test_misbehaved_io(self)
|
|
2157
|
+
|
|
2158
|
+
def test_interleaved_read_write(self):
|
|
2159
|
+
# Test for issue #12213
|
|
2160
|
+
with self.BytesIO(b'abcdefgh') as raw:
|
|
2161
|
+
with self.tp(raw, 100) as f:
|
|
2162
|
+
f.write(b"1")
|
|
2163
|
+
self.assertEqual(f.read(1), b'b')
|
|
2164
|
+
f.write(b'2')
|
|
2165
|
+
self.assertEqual(f.read1(1), b'd')
|
|
2166
|
+
f.write(b'3')
|
|
2167
|
+
buf = bytearray(1)
|
|
2168
|
+
f.readinto(buf)
|
|
2169
|
+
self.assertEqual(buf, b'f')
|
|
2170
|
+
f.write(b'4')
|
|
2171
|
+
self.assertEqual(f.peek(1), b'h')
|
|
2172
|
+
f.flush()
|
|
2173
|
+
self.assertEqual(raw.getvalue(), b'1b2d3f4h')
|
|
2174
|
+
|
|
2175
|
+
with self.BytesIO(b'abc') as raw:
|
|
2176
|
+
with self.tp(raw, 100) as f:
|
|
2177
|
+
self.assertEqual(f.read(1), b'a')
|
|
2178
|
+
f.write(b"2")
|
|
2179
|
+
self.assertEqual(f.read(1), b'c')
|
|
2180
|
+
f.flush()
|
|
2181
|
+
self.assertEqual(raw.getvalue(), b'a2c')
|
|
2182
|
+
|
|
2183
|
+
def test_interleaved_readline_write(self):
|
|
2184
|
+
with self.BytesIO(b'ab\ncdef\ng\n') as raw:
|
|
2185
|
+
with self.tp(raw) as f:
|
|
2186
|
+
f.write(b'1')
|
|
2187
|
+
self.assertEqual(f.readline(), b'b\n')
|
|
2188
|
+
f.write(b'2')
|
|
2189
|
+
self.assertEqual(f.readline(), b'def\n')
|
|
2190
|
+
f.write(b'3')
|
|
2191
|
+
self.assertEqual(f.readline(), b'\n')
|
|
2192
|
+
f.flush()
|
|
2193
|
+
self.assertEqual(raw.getvalue(), b'1b\n2def\n3\n')
|
|
2194
|
+
|
|
2195
|
+
# You can't construct a BufferedRandom over a non-seekable stream.
|
|
2196
|
+
test_unseekable = None
|
|
2197
|
+
|
|
2198
|
+
|
|
2199
|
+
class CBufferedRandomTest(BufferedRandomTest, SizeofTest):
|
|
2200
|
+
tp = io.BufferedRandom
|
|
2201
|
+
|
|
2202
|
+
def test_constructor(self):
|
|
2203
|
+
BufferedRandomTest.test_constructor(self)
|
|
2204
|
+
# The allocation can succeed on 32-bit builds, e.g. with more
|
|
2205
|
+
# than 2GB RAM and a 64-bit kernel.
|
|
2206
|
+
if sys.maxsize > 0x7FFFFFFF:
|
|
2207
|
+
rawio = self.MockRawIO()
|
|
2208
|
+
bufio = self.tp(rawio)
|
|
2209
|
+
self.assertRaises((OverflowError, MemoryError, ValueError),
|
|
2210
|
+
bufio.__init__, rawio, sys.maxsize)
|
|
2211
|
+
|
|
2212
|
+
def test_garbage_collection(self):
|
|
2213
|
+
CBufferedReaderTest.test_garbage_collection(self)
|
|
2214
|
+
CBufferedWriterTest.test_garbage_collection(self)
|
|
2215
|
+
|
|
2216
|
+
def test_args_error(self):
|
|
2217
|
+
# Issue #17275
|
|
2218
|
+
with self.assertRaisesRegex(TypeError, "BufferedRandom"):
|
|
2219
|
+
self.tp(io.BytesIO(), 1024, 1024, 1024)
|
|
2220
|
+
|
|
2221
|
+
|
|
2222
|
+
class PyBufferedRandomTest(BufferedRandomTest):
|
|
2223
|
+
tp = pyio.BufferedRandom
|
|
2224
|
+
|
|
2225
|
+
|
|
2226
|
+
# To fully exercise seek/tell, the StatefulIncrementalDecoder has these
|
|
2227
|
+
# properties:
|
|
2228
|
+
# - A single output character can correspond to many bytes of input.
|
|
2229
|
+
# - The number of input bytes to complete the character can be
|
|
2230
|
+
# undetermined until the last input byte is received.
|
|
2231
|
+
# - The number of input bytes can vary depending on previous input.
|
|
2232
|
+
# - A single input byte can correspond to many characters of output.
|
|
2233
|
+
# - The number of output characters can be undetermined until the
|
|
2234
|
+
# last input byte is received.
|
|
2235
|
+
# - The number of output characters can vary depending on previous input.
|
|
2236
|
+
|
|
2237
|
+
class StatefulIncrementalDecoder(codecs.IncrementalDecoder):
|
|
2238
|
+
"""
|
|
2239
|
+
For testing seek/tell behavior with a stateful, buffering decoder.
|
|
2240
|
+
|
|
2241
|
+
Input is a sequence of words. Words may be fixed-length (length set
|
|
2242
|
+
by input) or variable-length (period-terminated). In variable-length
|
|
2243
|
+
mode, extra periods are ignored. Possible words are:
|
|
2244
|
+
- 'i' followed by a number sets the input length, I (maximum 99).
|
|
2245
|
+
When I is set to 0, words are space-terminated.
|
|
2246
|
+
- 'o' followed by a number sets the output length, O (maximum 99).
|
|
2247
|
+
- Any other word is converted into a word followed by a period on
|
|
2248
|
+
the output. The output word consists of the input word truncated
|
|
2249
|
+
or padded out with hyphens to make its length equal to O. If O
|
|
2250
|
+
is 0, the word is output verbatim without truncating or padding.
|
|
2251
|
+
I and O are initially set to 1. When I changes, any buffered input is
|
|
2252
|
+
re-scanned according to the new I. EOF also terminates the last word.
|
|
2253
|
+
"""
|
|
2254
|
+
|
|
2255
|
+
def __init__(self, errors='strict'):
|
|
2256
|
+
codecs.IncrementalDecoder.__init__(self, errors)
|
|
2257
|
+
self.reset()
|
|
2258
|
+
|
|
2259
|
+
def __repr__(self):
|
|
2260
|
+
return '<SID %x>' % id(self)
|
|
2261
|
+
|
|
2262
|
+
def reset(self):
|
|
2263
|
+
self.i = 1
|
|
2264
|
+
self.o = 1
|
|
2265
|
+
self.buffer = bytearray()
|
|
2266
|
+
|
|
2267
|
+
def getstate(self):
|
|
2268
|
+
i, o = self.i ^ 1, self.o ^ 1 # so that flags = 0 after reset()
|
|
2269
|
+
return bytes(self.buffer), i*100 + o
|
|
2270
|
+
|
|
2271
|
+
def setstate(self, state):
|
|
2272
|
+
buffer, io = state
|
|
2273
|
+
self.buffer = bytearray(buffer)
|
|
2274
|
+
i, o = divmod(io, 100)
|
|
2275
|
+
self.i, self.o = i ^ 1, o ^ 1
|
|
2276
|
+
|
|
2277
|
+
def decode(self, input, final=False):
|
|
2278
|
+
output = ''
|
|
2279
|
+
for b in input:
|
|
2280
|
+
if self.i == 0: # variable-length, terminated with period
|
|
2281
|
+
if b == ord('.'):
|
|
2282
|
+
if self.buffer:
|
|
2283
|
+
output += self.process_word()
|
|
2284
|
+
else:
|
|
2285
|
+
self.buffer.append(b)
|
|
2286
|
+
else: # fixed-length, terminate after self.i bytes
|
|
2287
|
+
self.buffer.append(b)
|
|
2288
|
+
if len(self.buffer) == self.i:
|
|
2289
|
+
output += self.process_word()
|
|
2290
|
+
if final and self.buffer: # EOF terminates the last word
|
|
2291
|
+
output += self.process_word()
|
|
2292
|
+
return output
|
|
2293
|
+
|
|
2294
|
+
def process_word(self):
|
|
2295
|
+
output = ''
|
|
2296
|
+
if self.buffer[0] == ord('i'):
|
|
2297
|
+
self.i = min(99, int(self.buffer[1:] or 0)) # set input length
|
|
2298
|
+
elif self.buffer[0] == ord('o'):
|
|
2299
|
+
self.o = min(99, int(self.buffer[1:] or 0)) # set output length
|
|
2300
|
+
else:
|
|
2301
|
+
output = self.buffer.decode('ascii')
|
|
2302
|
+
if len(output) < self.o:
|
|
2303
|
+
output += '-'*self.o # pad out with hyphens
|
|
2304
|
+
if self.o:
|
|
2305
|
+
output = output[:self.o] # truncate to output length
|
|
2306
|
+
output += '.'
|
|
2307
|
+
self.buffer = bytearray()
|
|
2308
|
+
return output
|
|
2309
|
+
|
|
2310
|
+
codecEnabled = False
|
|
2311
|
+
|
|
2312
|
+
@classmethod
|
|
2313
|
+
def lookupTestDecoder(cls, name):
|
|
2314
|
+
if cls.codecEnabled and name == 'test_decoder':
|
|
2315
|
+
latin1 = codecs.lookup('latin-1')
|
|
2316
|
+
return codecs.CodecInfo(
|
|
2317
|
+
name='test_decoder', encode=latin1.encode, decode=None,
|
|
2318
|
+
incrementalencoder=None,
|
|
2319
|
+
streamreader=None, streamwriter=None,
|
|
2320
|
+
incrementaldecoder=cls)
|
|
2321
|
+
|
|
2322
|
+
# Register the previous decoder for testing.
|
|
2323
|
+
# Disabled by default, tests will enable it.
|
|
2324
|
+
codecs.register(StatefulIncrementalDecoder.lookupTestDecoder)
|
|
2325
|
+
|
|
2326
|
+
|
|
2327
|
+
class StatefulIncrementalDecoderTest(unittest.TestCase):
|
|
2328
|
+
"""
|
|
2329
|
+
Make sure the StatefulIncrementalDecoder actually works.
|
|
2330
|
+
"""
|
|
2331
|
+
|
|
2332
|
+
test_cases = [
|
|
2333
|
+
# I=1, O=1 (fixed-length input == fixed-length output)
|
|
2334
|
+
(b'abcd', False, 'a.b.c.d.'),
|
|
2335
|
+
# I=0, O=0 (variable-length input, variable-length output)
|
|
2336
|
+
(b'oiabcd', True, 'abcd.'),
|
|
2337
|
+
# I=0, O=0 (should ignore extra periods)
|
|
2338
|
+
(b'oi...abcd...', True, 'abcd.'),
|
|
2339
|
+
# I=0, O=6 (variable-length input, fixed-length output)
|
|
2340
|
+
(b'i.o6.x.xyz.toolongtofit.', False, 'x-----.xyz---.toolon.'),
|
|
2341
|
+
# I=2, O=6 (fixed-length input < fixed-length output)
|
|
2342
|
+
(b'i.i2.o6xyz', True, 'xy----.z-----.'),
|
|
2343
|
+
# I=6, O=3 (fixed-length input > fixed-length output)
|
|
2344
|
+
(b'i.o3.i6.abcdefghijklmnop', True, 'abc.ghi.mno.'),
|
|
2345
|
+
# I=0, then 3; O=29, then 15 (with longer output)
|
|
2346
|
+
(b'i.o29.a.b.cde.o15.abcdefghijabcdefghij.i3.a.b.c.d.ei00k.l.m', True,
|
|
2347
|
+
'a----------------------------.' +
|
|
2348
|
+
'b----------------------------.' +
|
|
2349
|
+
'cde--------------------------.' +
|
|
2350
|
+
'abcdefghijabcde.' +
|
|
2351
|
+
'a.b------------.' +
|
|
2352
|
+
'.c.------------.' +
|
|
2353
|
+
'd.e------------.' +
|
|
2354
|
+
'k--------------.' +
|
|
2355
|
+
'l--------------.' +
|
|
2356
|
+
'm--------------.')
|
|
2357
|
+
]
|
|
2358
|
+
|
|
2359
|
+
def test_decoder(self):
|
|
2360
|
+
# Try a few one-shot test cases.
|
|
2361
|
+
for input, eof, output in self.test_cases:
|
|
2362
|
+
d = StatefulIncrementalDecoder()
|
|
2363
|
+
self.assertEqual(d.decode(input, eof), output)
|
|
2364
|
+
|
|
2365
|
+
# Also test an unfinished decode, followed by forcing EOF.
|
|
2366
|
+
d = StatefulIncrementalDecoder()
|
|
2367
|
+
self.assertEqual(d.decode(b'oiabcd'), '')
|
|
2368
|
+
self.assertEqual(d.decode(b'', 1), 'abcd.')
|
|
2369
|
+
|
|
2370
|
+
class TextIOWrapperTest(unittest.TestCase):
|
|
2371
|
+
|
|
2372
|
+
def setUp(self):
|
|
2373
|
+
self.testdata = b"AAA\r\nBBB\rCCC\r\nDDD\nEEE\r\n"
|
|
2374
|
+
self.normalized = b"AAA\nBBB\nCCC\nDDD\nEEE\n".decode("ascii")
|
|
2375
|
+
support.unlink(support.TESTFN)
|
|
2376
|
+
|
|
2377
|
+
def tearDown(self):
|
|
2378
|
+
support.unlink(support.TESTFN)
|
|
2379
|
+
|
|
2380
|
+
def test_constructor(self):
|
|
2381
|
+
r = self.BytesIO(b"\xc3\xa9\n\n")
|
|
2382
|
+
b = self.BufferedReader(r, 1000)
|
|
2383
|
+
t = self.TextIOWrapper(b)
|
|
2384
|
+
t.__init__(b, encoding="latin-1", newline="\r\n")
|
|
2385
|
+
self.assertEqual(t.encoding, "latin-1")
|
|
2386
|
+
self.assertEqual(t.line_buffering, False)
|
|
2387
|
+
t.__init__(b, encoding="utf-8", line_buffering=True)
|
|
2388
|
+
self.assertEqual(t.encoding, "utf-8")
|
|
2389
|
+
self.assertEqual(t.line_buffering, True)
|
|
2390
|
+
self.assertEqual("\xe9\n", t.readline())
|
|
2391
|
+
self.assertRaises(TypeError, t.__init__, b, newline=42)
|
|
2392
|
+
self.assertRaises(ValueError, t.__init__, b, newline='xyzzy')
|
|
2393
|
+
|
|
2394
|
+
def test_uninitialized(self):
|
|
2395
|
+
t = self.TextIOWrapper.__new__(self.TextIOWrapper)
|
|
2396
|
+
del t
|
|
2397
|
+
t = self.TextIOWrapper.__new__(self.TextIOWrapper)
|
|
2398
|
+
self.assertRaises(Exception, repr, t)
|
|
2399
|
+
self.assertRaisesRegex((ValueError, AttributeError),
|
|
2400
|
+
'uninitialized|has no attribute',
|
|
2401
|
+
t.read, 0)
|
|
2402
|
+
t.__init__(self.MockRawIO())
|
|
2403
|
+
self.assertEqual(t.read(0), '')
|
|
2404
|
+
|
|
2405
|
+
def test_non_text_encoding_codecs_are_rejected(self):
|
|
2406
|
+
# Ensure the constructor complains if passed a codec that isn't
|
|
2407
|
+
# marked as a text encoding
|
|
2408
|
+
# http://bugs.python.org/issue20404
|
|
2409
|
+
r = self.BytesIO()
|
|
2410
|
+
b = self.BufferedWriter(r)
|
|
2411
|
+
with self.assertRaisesRegex(LookupError, "is not a text encoding"):
|
|
2412
|
+
self.TextIOWrapper(b, encoding="hex")
|
|
2413
|
+
|
|
2414
|
+
def test_detach(self):
|
|
2415
|
+
r = self.BytesIO()
|
|
2416
|
+
b = self.BufferedWriter(r)
|
|
2417
|
+
t = self.TextIOWrapper(b)
|
|
2418
|
+
self.assertIs(t.detach(), b)
|
|
2419
|
+
|
|
2420
|
+
t = self.TextIOWrapper(b, encoding="ascii")
|
|
2421
|
+
t.write("howdy")
|
|
2422
|
+
self.assertFalse(r.getvalue())
|
|
2423
|
+
t.detach()
|
|
2424
|
+
self.assertEqual(r.getvalue(), b"howdy")
|
|
2425
|
+
self.assertRaises(ValueError, t.detach)
|
|
2426
|
+
|
|
2427
|
+
# Operations independent of the detached stream should still work
|
|
2428
|
+
repr(t)
|
|
2429
|
+
self.assertEqual(t.encoding, "ascii")
|
|
2430
|
+
self.assertEqual(t.errors, "strict")
|
|
2431
|
+
self.assertFalse(t.line_buffering)
|
|
2432
|
+
|
|
2433
|
+
def test_repr(self):
|
|
2434
|
+
raw = self.BytesIO("hello".encode("utf-8"))
|
|
2435
|
+
b = self.BufferedReader(raw)
|
|
2436
|
+
t = self.TextIOWrapper(b, encoding="utf-8")
|
|
2437
|
+
modname = self.TextIOWrapper.__module__
|
|
2438
|
+
self.assertEqual(repr(t),
|
|
2439
|
+
"<%s.TextIOWrapper encoding='utf-8'>" % modname)
|
|
2440
|
+
raw.name = "dummy"
|
|
2441
|
+
self.assertEqual(repr(t),
|
|
2442
|
+
"<%s.TextIOWrapper name='dummy' encoding='utf-8'>" % modname)
|
|
2443
|
+
t.mode = "r"
|
|
2444
|
+
self.assertEqual(repr(t),
|
|
2445
|
+
"<%s.TextIOWrapper name='dummy' mode='r' encoding='utf-8'>" % modname)
|
|
2446
|
+
raw.name = b"dummy"
|
|
2447
|
+
self.assertEqual(repr(t),
|
|
2448
|
+
"<%s.TextIOWrapper name=b'dummy' mode='r' encoding='utf-8'>" % modname)
|
|
2449
|
+
|
|
2450
|
+
t.buffer.detach()
|
|
2451
|
+
repr(t) # Should not raise an exception
|
|
2452
|
+
|
|
2453
|
+
def test_recursive_repr(self):
|
|
2454
|
+
# Issue #25455
|
|
2455
|
+
raw = self.BytesIO()
|
|
2456
|
+
t = self.TextIOWrapper(raw)
|
|
2457
|
+
with support.swap_attr(raw, 'name', t):
|
|
2458
|
+
try:
|
|
2459
|
+
repr(t) # Should not crash
|
|
2460
|
+
except RuntimeError:
|
|
2461
|
+
pass
|
|
2462
|
+
|
|
2463
|
+
def test_line_buffering(self):
|
|
2464
|
+
r = self.BytesIO()
|
|
2465
|
+
b = self.BufferedWriter(r, 1000)
|
|
2466
|
+
t = self.TextIOWrapper(b, newline="\n", line_buffering=True)
|
|
2467
|
+
t.write("X")
|
|
2468
|
+
self.assertEqual(r.getvalue(), b"") # No flush happened
|
|
2469
|
+
t.write("Y\nZ")
|
|
2470
|
+
self.assertEqual(r.getvalue(), b"XY\nZ") # All got flushed
|
|
2471
|
+
t.write("A\rB")
|
|
2472
|
+
self.assertEqual(r.getvalue(), b"XY\nZA\rB")
|
|
2473
|
+
|
|
2474
|
+
def test_default_encoding(self):
|
|
2475
|
+
old_environ = dict(os.environ)
|
|
2476
|
+
try:
|
|
2477
|
+
# try to get a user preferred encoding different than the current
|
|
2478
|
+
# locale encoding to check that TextIOWrapper() uses the current
|
|
2479
|
+
# locale encoding and not the user preferred encoding
|
|
2480
|
+
for key in ('LC_ALL', 'LANG', 'LC_CTYPE'):
|
|
2481
|
+
if key in os.environ:
|
|
2482
|
+
del os.environ[key]
|
|
2483
|
+
|
|
2484
|
+
current_locale_encoding = locale.getpreferredencoding(False)
|
|
2485
|
+
b = self.BytesIO()
|
|
2486
|
+
t = self.TextIOWrapper(b)
|
|
2487
|
+
self.assertEqual(t.encoding, current_locale_encoding)
|
|
2488
|
+
finally:
|
|
2489
|
+
os.environ.clear()
|
|
2490
|
+
os.environ.update(old_environ)
|
|
2491
|
+
|
|
2492
|
+
@support.cpython_only
|
|
2493
|
+
def test_device_encoding(self):
|
|
2494
|
+
# Issue 15989
|
|
2495
|
+
import _testcapi
|
|
2496
|
+
b = self.BytesIO()
|
|
2497
|
+
b.fileno = lambda: _testcapi.INT_MAX + 1
|
|
2498
|
+
self.assertRaises(OverflowError, self.TextIOWrapper, b)
|
|
2499
|
+
b.fileno = lambda: _testcapi.UINT_MAX + 1
|
|
2500
|
+
self.assertRaises(OverflowError, self.TextIOWrapper, b)
|
|
2501
|
+
|
|
2502
|
+
def test_encoding(self):
|
|
2503
|
+
# Check the encoding attribute is always set, and valid
|
|
2504
|
+
b = self.BytesIO()
|
|
2505
|
+
t = self.TextIOWrapper(b, encoding="utf-8")
|
|
2506
|
+
self.assertEqual(t.encoding, "utf-8")
|
|
2507
|
+
t = self.TextIOWrapper(b)
|
|
2508
|
+
self.assertIsNotNone(t.encoding)
|
|
2509
|
+
codecs.lookup(t.encoding)
|
|
2510
|
+
|
|
2511
|
+
def test_encoding_errors_reading(self):
|
|
2512
|
+
# (1) default
|
|
2513
|
+
b = self.BytesIO(b"abc\n\xff\n")
|
|
2514
|
+
t = self.TextIOWrapper(b, encoding="ascii")
|
|
2515
|
+
self.assertRaises(UnicodeError, t.read)
|
|
2516
|
+
# (2) explicit strict
|
|
2517
|
+
b = self.BytesIO(b"abc\n\xff\n")
|
|
2518
|
+
t = self.TextIOWrapper(b, encoding="ascii", errors="strict")
|
|
2519
|
+
self.assertRaises(UnicodeError, t.read)
|
|
2520
|
+
# (3) ignore
|
|
2521
|
+
b = self.BytesIO(b"abc\n\xff\n")
|
|
2522
|
+
t = self.TextIOWrapper(b, encoding="ascii", errors="ignore")
|
|
2523
|
+
self.assertEqual(t.read(), "abc\n\n")
|
|
2524
|
+
# (4) replace
|
|
2525
|
+
b = self.BytesIO(b"abc\n\xff\n")
|
|
2526
|
+
t = self.TextIOWrapper(b, encoding="ascii", errors="replace")
|
|
2527
|
+
self.assertEqual(t.read(), "abc\n\ufffd\n")
|
|
2528
|
+
|
|
2529
|
+
def test_encoding_errors_writing(self):
|
|
2530
|
+
# (1) default
|
|
2531
|
+
b = self.BytesIO()
|
|
2532
|
+
t = self.TextIOWrapper(b, encoding="ascii")
|
|
2533
|
+
self.assertRaises(UnicodeError, t.write, "\xff")
|
|
2534
|
+
# (2) explicit strict
|
|
2535
|
+
b = self.BytesIO()
|
|
2536
|
+
t = self.TextIOWrapper(b, encoding="ascii", errors="strict")
|
|
2537
|
+
self.assertRaises(UnicodeError, t.write, "\xff")
|
|
2538
|
+
# (3) ignore
|
|
2539
|
+
b = self.BytesIO()
|
|
2540
|
+
t = self.TextIOWrapper(b, encoding="ascii", errors="ignore",
|
|
2541
|
+
newline="\n")
|
|
2542
|
+
t.write("abc\xffdef\n")
|
|
2543
|
+
t.flush()
|
|
2544
|
+
self.assertEqual(b.getvalue(), b"abcdef\n")
|
|
2545
|
+
# (4) replace
|
|
2546
|
+
b = self.BytesIO()
|
|
2547
|
+
t = self.TextIOWrapper(b, encoding="ascii", errors="replace",
|
|
2548
|
+
newline="\n")
|
|
2549
|
+
t.write("abc\xffdef\n")
|
|
2550
|
+
t.flush()
|
|
2551
|
+
self.assertEqual(b.getvalue(), b"abc?def\n")
|
|
2552
|
+
|
|
2553
|
+
def test_newlines(self):
|
|
2554
|
+
input_lines = [ "unix\n", "windows\r\n", "os9\r", "last\n", "nonl" ]
|
|
2555
|
+
|
|
2556
|
+
tests = [
|
|
2557
|
+
[ None, [ 'unix\n', 'windows\n', 'os9\n', 'last\n', 'nonl' ] ],
|
|
2558
|
+
[ '', input_lines ],
|
|
2559
|
+
[ '\n', [ "unix\n", "windows\r\n", "os9\rlast\n", "nonl" ] ],
|
|
2560
|
+
[ '\r\n', [ "unix\nwindows\r\n", "os9\rlast\nnonl" ] ],
|
|
2561
|
+
[ '\r', [ "unix\nwindows\r", "\nos9\r", "last\nnonl" ] ],
|
|
2562
|
+
]
|
|
2563
|
+
encodings = (
|
|
2564
|
+
'utf-8', 'latin-1',
|
|
2565
|
+
'utf-16', 'utf-16-le', 'utf-16-be',
|
|
2566
|
+
'utf-32', 'utf-32-le', 'utf-32-be',
|
|
2567
|
+
)
|
|
2568
|
+
|
|
2569
|
+
# Try a range of buffer sizes to test the case where \r is the last
|
|
2570
|
+
# character in TextIOWrapper._pending_line.
|
|
2571
|
+
for encoding in encodings:
|
|
2572
|
+
# XXX: str.encode() should return bytes
|
|
2573
|
+
data = bytes(''.join(input_lines).encode(encoding))
|
|
2574
|
+
for do_reads in (False, True):
|
|
2575
|
+
for bufsize in range(1, 10):
|
|
2576
|
+
for newline, exp_lines in tests:
|
|
2577
|
+
bufio = self.BufferedReader(self.BytesIO(data), bufsize)
|
|
2578
|
+
textio = self.TextIOWrapper(bufio, newline=newline,
|
|
2579
|
+
encoding=encoding)
|
|
2580
|
+
if do_reads:
|
|
2581
|
+
got_lines = []
|
|
2582
|
+
while True:
|
|
2583
|
+
c2 = textio.read(2)
|
|
2584
|
+
if c2 == '':
|
|
2585
|
+
break
|
|
2586
|
+
self.assertEqual(len(c2), 2)
|
|
2587
|
+
got_lines.append(c2 + textio.readline())
|
|
2588
|
+
else:
|
|
2589
|
+
got_lines = list(textio)
|
|
2590
|
+
|
|
2591
|
+
for got_line, exp_line in zip(got_lines, exp_lines):
|
|
2592
|
+
self.assertEqual(got_line, exp_line)
|
|
2593
|
+
self.assertEqual(len(got_lines), len(exp_lines))
|
|
2594
|
+
|
|
2595
|
+
def test_newlines_input(self):
|
|
2596
|
+
testdata = b"AAA\nBB\x00B\nCCC\rDDD\rEEE\r\nFFF\r\nGGG"
|
|
2597
|
+
normalized = testdata.replace(b"\r\n", b"\n").replace(b"\r", b"\n")
|
|
2598
|
+
for newline, expected in [
|
|
2599
|
+
(None, normalized.decode("ascii").splitlines(keepends=True)),
|
|
2600
|
+
("", testdata.decode("ascii").splitlines(keepends=True)),
|
|
2601
|
+
("\n", ["AAA\n", "BB\x00B\n", "CCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]),
|
|
2602
|
+
("\r\n", ["AAA\nBB\x00B\nCCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]),
|
|
2603
|
+
("\r", ["AAA\nBB\x00B\nCCC\r", "DDD\r", "EEE\r", "\nFFF\r", "\nGGG"]),
|
|
2604
|
+
]:
|
|
2605
|
+
buf = self.BytesIO(testdata)
|
|
2606
|
+
txt = self.TextIOWrapper(buf, encoding="ascii", newline=newline)
|
|
2607
|
+
self.assertEqual(txt.readlines(), expected)
|
|
2608
|
+
txt.seek(0)
|
|
2609
|
+
self.assertEqual(txt.read(), "".join(expected))
|
|
2610
|
+
|
|
2611
|
+
def test_newlines_output(self):
|
|
2612
|
+
testdict = {
|
|
2613
|
+
"": b"AAA\nBBB\nCCC\nX\rY\r\nZ",
|
|
2614
|
+
"\n": b"AAA\nBBB\nCCC\nX\rY\r\nZ",
|
|
2615
|
+
"\r": b"AAA\rBBB\rCCC\rX\rY\r\rZ",
|
|
2616
|
+
"\r\n": b"AAA\r\nBBB\r\nCCC\r\nX\rY\r\r\nZ",
|
|
2617
|
+
}
|
|
2618
|
+
tests = [(None, testdict[os.linesep])] + sorted(testdict.items())
|
|
2619
|
+
for newline, expected in tests:
|
|
2620
|
+
buf = self.BytesIO()
|
|
2621
|
+
txt = self.TextIOWrapper(buf, encoding="ascii", newline=newline)
|
|
2622
|
+
txt.write("AAA\nB")
|
|
2623
|
+
txt.write("BB\nCCC\n")
|
|
2624
|
+
txt.write("X\rY\r\nZ")
|
|
2625
|
+
txt.flush()
|
|
2626
|
+
self.assertEqual(buf.closed, False)
|
|
2627
|
+
self.assertEqual(buf.getvalue(), expected)
|
|
2628
|
+
|
|
2629
|
+
def test_destructor(self):
|
|
2630
|
+
l = []
|
|
2631
|
+
base = self.BytesIO
|
|
2632
|
+
class MyBytesIO(base):
|
|
2633
|
+
def close(self):
|
|
2634
|
+
l.append(self.getvalue())
|
|
2635
|
+
base.close(self)
|
|
2636
|
+
b = MyBytesIO()
|
|
2637
|
+
t = self.TextIOWrapper(b, encoding="ascii")
|
|
2638
|
+
t.write("abc")
|
|
2639
|
+
del t
|
|
2640
|
+
support.gc_collect()
|
|
2641
|
+
self.assertEqual([b"abc"], l)
|
|
2642
|
+
|
|
2643
|
+
def test_override_destructor(self):
|
|
2644
|
+
record = []
|
|
2645
|
+
class MyTextIO(self.TextIOWrapper):
|
|
2646
|
+
def __del__(self):
|
|
2647
|
+
record.append(1)
|
|
2648
|
+
try:
|
|
2649
|
+
f = super().__del__
|
|
2650
|
+
except AttributeError:
|
|
2651
|
+
pass
|
|
2652
|
+
else:
|
|
2653
|
+
f()
|
|
2654
|
+
def close(self):
|
|
2655
|
+
record.append(2)
|
|
2656
|
+
super().close()
|
|
2657
|
+
def flush(self):
|
|
2658
|
+
record.append(3)
|
|
2659
|
+
super().flush()
|
|
2660
|
+
b = self.BytesIO()
|
|
2661
|
+
t = MyTextIO(b, encoding="ascii")
|
|
2662
|
+
del t
|
|
2663
|
+
support.gc_collect()
|
|
2664
|
+
self.assertEqual(record, [1, 2, 3])
|
|
2665
|
+
|
|
2666
|
+
def test_error_through_destructor(self):
|
|
2667
|
+
# Test that the exception state is not modified by a destructor,
|
|
2668
|
+
# even if close() fails.
|
|
2669
|
+
rawio = self.CloseFailureIO()
|
|
2670
|
+
def f():
|
|
2671
|
+
self.TextIOWrapper(rawio).xyzzy
|
|
2672
|
+
with support.captured_output("stderr") as s:
|
|
2673
|
+
self.assertRaises(AttributeError, f)
|
|
2674
|
+
s = s.getvalue().strip()
|
|
2675
|
+
if s:
|
|
2676
|
+
# The destructor *may* have printed an unraisable error, check it
|
|
2677
|
+
self.assertEqual(len(s.splitlines()), 1)
|
|
2678
|
+
self.assertTrue(s.startswith("Exception OSError: "), s)
|
|
2679
|
+
self.assertTrue(s.endswith(" ignored"), s)
|
|
2680
|
+
|
|
2681
|
+
# Systematic tests of the text I/O API
|
|
2682
|
+
|
|
2683
|
+
def test_basic_io(self):
|
|
2684
|
+
for chunksize in (1, 2, 3, 4, 5, 15, 16, 17, 31, 32, 33, 63, 64, 65):
|
|
2685
|
+
for enc in "ascii", "latin-1", "utf-8" :# , "utf-16-be", "utf-16-le":
|
|
2686
|
+
f = self.open(support.TESTFN, "w+", encoding=enc)
|
|
2687
|
+
f._CHUNK_SIZE = chunksize
|
|
2688
|
+
self.assertEqual(f.write("abc"), 3)
|
|
2689
|
+
f.close()
|
|
2690
|
+
f = self.open(support.TESTFN, "r+", encoding=enc)
|
|
2691
|
+
f._CHUNK_SIZE = chunksize
|
|
2692
|
+
self.assertEqual(f.tell(), 0)
|
|
2693
|
+
self.assertEqual(f.read(), "abc")
|
|
2694
|
+
cookie = f.tell()
|
|
2695
|
+
self.assertEqual(f.seek(0), 0)
|
|
2696
|
+
self.assertEqual(f.read(None), "abc")
|
|
2697
|
+
f.seek(0)
|
|
2698
|
+
self.assertEqual(f.read(2), "ab")
|
|
2699
|
+
self.assertEqual(f.read(1), "c")
|
|
2700
|
+
self.assertEqual(f.read(1), "")
|
|
2701
|
+
self.assertEqual(f.read(), "")
|
|
2702
|
+
self.assertEqual(f.tell(), cookie)
|
|
2703
|
+
self.assertEqual(f.seek(0), 0)
|
|
2704
|
+
self.assertEqual(f.seek(0, 2), cookie)
|
|
2705
|
+
self.assertEqual(f.write("def"), 3)
|
|
2706
|
+
self.assertEqual(f.seek(cookie), cookie)
|
|
2707
|
+
self.assertEqual(f.read(), "def")
|
|
2708
|
+
if enc.startswith("utf"):
|
|
2709
|
+
self.multi_line_test(f, enc)
|
|
2710
|
+
f.close()
|
|
2711
|
+
|
|
2712
|
+
def multi_line_test(self, f, enc):
|
|
2713
|
+
f.seek(0)
|
|
2714
|
+
f.truncate()
|
|
2715
|
+
sample = "s\xff\u0fff\uffff"
|
|
2716
|
+
wlines = []
|
|
2717
|
+
for size in (0, 1, 2, 3, 4, 5, 30, 31, 32, 33, 62, 63, 64, 65, 1000):
|
|
2718
|
+
chars = []
|
|
2719
|
+
for i in range(size):
|
|
2720
|
+
chars.append(sample[i % len(sample)])
|
|
2721
|
+
line = "".join(chars) + "\n"
|
|
2722
|
+
wlines.append((f.tell(), line))
|
|
2723
|
+
f.write(line)
|
|
2724
|
+
f.seek(0)
|
|
2725
|
+
rlines = []
|
|
2726
|
+
while True:
|
|
2727
|
+
pos = f.tell()
|
|
2728
|
+
line = f.readline()
|
|
2729
|
+
if not line:
|
|
2730
|
+
break
|
|
2731
|
+
rlines.append((pos, line))
|
|
2732
|
+
self.assertEqual(rlines, wlines)
|
|
2733
|
+
|
|
2734
|
+
def test_telling(self):
|
|
2735
|
+
f = self.open(support.TESTFN, "w+", encoding="utf-8")
|
|
2736
|
+
p0 = f.tell()
|
|
2737
|
+
f.write("\xff\n")
|
|
2738
|
+
p1 = f.tell()
|
|
2739
|
+
f.write("\xff\n")
|
|
2740
|
+
p2 = f.tell()
|
|
2741
|
+
f.seek(0)
|
|
2742
|
+
self.assertEqual(f.tell(), p0)
|
|
2743
|
+
self.assertEqual(f.readline(), "\xff\n")
|
|
2744
|
+
self.assertEqual(f.tell(), p1)
|
|
2745
|
+
self.assertEqual(f.readline(), "\xff\n")
|
|
2746
|
+
self.assertEqual(f.tell(), p2)
|
|
2747
|
+
f.seek(0)
|
|
2748
|
+
for line in f:
|
|
2749
|
+
self.assertEqual(line, "\xff\n")
|
|
2750
|
+
self.assertRaises(OSError, f.tell)
|
|
2751
|
+
self.assertEqual(f.tell(), p2)
|
|
2752
|
+
f.close()
|
|
2753
|
+
|
|
2754
|
+
def test_seeking(self):
|
|
2755
|
+
chunk_size = _default_chunk_size()
|
|
2756
|
+
prefix_size = chunk_size - 2
|
|
2757
|
+
u_prefix = "a" * prefix_size
|
|
2758
|
+
prefix = bytes(u_prefix.encode("utf-8"))
|
|
2759
|
+
self.assertEqual(len(u_prefix), len(prefix))
|
|
2760
|
+
u_suffix = "\u8888\n"
|
|
2761
|
+
suffix = bytes(u_suffix.encode("utf-8"))
|
|
2762
|
+
line = prefix + suffix
|
|
2763
|
+
with self.open(support.TESTFN, "wb") as f:
|
|
2764
|
+
f.write(line*2)
|
|
2765
|
+
with self.open(support.TESTFN, "r", encoding="utf-8") as f:
|
|
2766
|
+
s = f.read(prefix_size)
|
|
2767
|
+
self.assertEqual(s, str(prefix, "ascii"))
|
|
2768
|
+
self.assertEqual(f.tell(), prefix_size)
|
|
2769
|
+
self.assertEqual(f.readline(), u_suffix)
|
|
2770
|
+
|
|
2771
|
+
def test_seeking_too(self):
|
|
2772
|
+
# Regression test for a specific bug
|
|
2773
|
+
data = b'\xe0\xbf\xbf\n'
|
|
2774
|
+
with self.open(support.TESTFN, "wb") as f:
|
|
2775
|
+
f.write(data)
|
|
2776
|
+
with self.open(support.TESTFN, "r", encoding="utf-8") as f:
|
|
2777
|
+
f._CHUNK_SIZE # Just test that it exists
|
|
2778
|
+
f._CHUNK_SIZE = 2
|
|
2779
|
+
f.readline()
|
|
2780
|
+
f.tell()
|
|
2781
|
+
|
|
2782
|
+
def test_seek_and_tell(self):
|
|
2783
|
+
#Test seek/tell using the StatefulIncrementalDecoder.
|
|
2784
|
+
# Make test faster by doing smaller seeks
|
|
2785
|
+
CHUNK_SIZE = 128
|
|
2786
|
+
|
|
2787
|
+
def test_seek_and_tell_with_data(data, min_pos=0):
|
|
2788
|
+
"""Tell/seek to various points within a data stream and ensure
|
|
2789
|
+
that the decoded data returned by read() is consistent."""
|
|
2790
|
+
f = self.open(support.TESTFN, 'wb')
|
|
2791
|
+
f.write(data)
|
|
2792
|
+
f.close()
|
|
2793
|
+
f = self.open(support.TESTFN, encoding='test_decoder')
|
|
2794
|
+
f._CHUNK_SIZE = CHUNK_SIZE
|
|
2795
|
+
decoded = f.read()
|
|
2796
|
+
f.close()
|
|
2797
|
+
|
|
2798
|
+
for i in range(min_pos, len(decoded) + 1): # seek positions
|
|
2799
|
+
for j in [1, 5, len(decoded) - i]: # read lengths
|
|
2800
|
+
f = self.open(support.TESTFN, encoding='test_decoder')
|
|
2801
|
+
self.assertEqual(f.read(i), decoded[:i])
|
|
2802
|
+
cookie = f.tell()
|
|
2803
|
+
self.assertEqual(f.read(j), decoded[i:i + j])
|
|
2804
|
+
f.seek(cookie)
|
|
2805
|
+
self.assertEqual(f.read(), decoded[i:])
|
|
2806
|
+
f.close()
|
|
2807
|
+
|
|
2808
|
+
# Enable the test decoder.
|
|
2809
|
+
StatefulIncrementalDecoder.codecEnabled = 1
|
|
2810
|
+
|
|
2811
|
+
# Run the tests.
|
|
2812
|
+
try:
|
|
2813
|
+
# Try each test case.
|
|
2814
|
+
for input, _, _ in StatefulIncrementalDecoderTest.test_cases:
|
|
2815
|
+
test_seek_and_tell_with_data(input)
|
|
2816
|
+
|
|
2817
|
+
# Position each test case so that it crosses a chunk boundary.
|
|
2818
|
+
for input, _, _ in StatefulIncrementalDecoderTest.test_cases:
|
|
2819
|
+
offset = CHUNK_SIZE - len(input)//2
|
|
2820
|
+
prefix = b'.'*offset
|
|
2821
|
+
# Don't bother seeking into the prefix (takes too long).
|
|
2822
|
+
min_pos = offset*2
|
|
2823
|
+
test_seek_and_tell_with_data(prefix + input, min_pos)
|
|
2824
|
+
|
|
2825
|
+
# Ensure our test decoder won't interfere with subsequent tests.
|
|
2826
|
+
finally:
|
|
2827
|
+
StatefulIncrementalDecoder.codecEnabled = 0
|
|
2828
|
+
|
|
2829
|
+
def test_encoded_writes(self):
|
|
2830
|
+
data = "1234567890"
|
|
2831
|
+
tests = ("utf-16",
|
|
2832
|
+
"utf-16-le",
|
|
2833
|
+
"utf-16-be",
|
|
2834
|
+
"utf-32",
|
|
2835
|
+
"utf-32-le",
|
|
2836
|
+
"utf-32-be")
|
|
2837
|
+
for encoding in tests:
|
|
2838
|
+
buf = self.BytesIO()
|
|
2839
|
+
f = self.TextIOWrapper(buf, encoding=encoding)
|
|
2840
|
+
# Check if the BOM is written only once (see issue1753).
|
|
2841
|
+
f.write(data)
|
|
2842
|
+
f.write(data)
|
|
2843
|
+
f.seek(0)
|
|
2844
|
+
self.assertEqual(f.read(), data * 2)
|
|
2845
|
+
f.seek(0)
|
|
2846
|
+
self.assertEqual(f.read(), data * 2)
|
|
2847
|
+
self.assertEqual(buf.getvalue(), (data * 2).encode(encoding))
|
|
2848
|
+
|
|
2849
|
+
def test_unreadable(self):
|
|
2850
|
+
class UnReadable(self.BytesIO):
|
|
2851
|
+
def readable(self):
|
|
2852
|
+
return False
|
|
2853
|
+
txt = self.TextIOWrapper(UnReadable())
|
|
2854
|
+
self.assertRaises(OSError, txt.read)
|
|
2855
|
+
|
|
2856
|
+
def test_read_one_by_one(self):
|
|
2857
|
+
txt = self.TextIOWrapper(self.BytesIO(b"AA\r\nBB"))
|
|
2858
|
+
reads = ""
|
|
2859
|
+
while True:
|
|
2860
|
+
c = txt.read(1)
|
|
2861
|
+
if not c:
|
|
2862
|
+
break
|
|
2863
|
+
reads += c
|
|
2864
|
+
self.assertEqual(reads, "AA\nBB")
|
|
2865
|
+
|
|
2866
|
+
def test_readlines(self):
|
|
2867
|
+
txt = self.TextIOWrapper(self.BytesIO(b"AA\nBB\nCC"))
|
|
2868
|
+
self.assertEqual(txt.readlines(), ["AA\n", "BB\n", "CC"])
|
|
2869
|
+
txt.seek(0)
|
|
2870
|
+
self.assertEqual(txt.readlines(None), ["AA\n", "BB\n", "CC"])
|
|
2871
|
+
txt.seek(0)
|
|
2872
|
+
self.assertEqual(txt.readlines(5), ["AA\n", "BB\n"])
|
|
2873
|
+
|
|
2874
|
+
# read in amounts equal to TextIOWrapper._CHUNK_SIZE which is 128.
|
|
2875
|
+
def test_read_by_chunk(self):
|
|
2876
|
+
# make sure "\r\n" straddles 128 char boundary.
|
|
2877
|
+
txt = self.TextIOWrapper(self.BytesIO(b"A" * 127 + b"\r\nB"))
|
|
2878
|
+
reads = ""
|
|
2879
|
+
while True:
|
|
2880
|
+
c = txt.read(128)
|
|
2881
|
+
if not c:
|
|
2882
|
+
break
|
|
2883
|
+
reads += c
|
|
2884
|
+
self.assertEqual(reads, "A"*127+"\nB")
|
|
2885
|
+
|
|
2886
|
+
def test_writelines(self):
|
|
2887
|
+
l = ['ab', 'cd', 'ef']
|
|
2888
|
+
buf = self.BytesIO()
|
|
2889
|
+
txt = self.TextIOWrapper(buf)
|
|
2890
|
+
txt.writelines(l)
|
|
2891
|
+
txt.flush()
|
|
2892
|
+
self.assertEqual(buf.getvalue(), b'abcdef')
|
|
2893
|
+
|
|
2894
|
+
def test_writelines_userlist(self):
|
|
2895
|
+
l = UserList(['ab', 'cd', 'ef'])
|
|
2896
|
+
buf = self.BytesIO()
|
|
2897
|
+
txt = self.TextIOWrapper(buf)
|
|
2898
|
+
txt.writelines(l)
|
|
2899
|
+
txt.flush()
|
|
2900
|
+
self.assertEqual(buf.getvalue(), b'abcdef')
|
|
2901
|
+
|
|
2902
|
+
def test_writelines_error(self):
|
|
2903
|
+
txt = self.TextIOWrapper(self.BytesIO())
|
|
2904
|
+
self.assertRaises(TypeError, txt.writelines, [1, 2, 3])
|
|
2905
|
+
self.assertRaises(TypeError, txt.writelines, None)
|
|
2906
|
+
self.assertRaises(TypeError, txt.writelines, b'abc')
|
|
2907
|
+
|
|
2908
|
+
def test_issue1395_1(self):
|
|
2909
|
+
txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
|
|
2910
|
+
|
|
2911
|
+
# read one char at a time
|
|
2912
|
+
reads = ""
|
|
2913
|
+
while True:
|
|
2914
|
+
c = txt.read(1)
|
|
2915
|
+
if not c:
|
|
2916
|
+
break
|
|
2917
|
+
reads += c
|
|
2918
|
+
self.assertEqual(reads, self.normalized)
|
|
2919
|
+
|
|
2920
|
+
def test_issue1395_2(self):
|
|
2921
|
+
txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
|
|
2922
|
+
txt._CHUNK_SIZE = 4
|
|
2923
|
+
|
|
2924
|
+
reads = ""
|
|
2925
|
+
while True:
|
|
2926
|
+
c = txt.read(4)
|
|
2927
|
+
if not c:
|
|
2928
|
+
break
|
|
2929
|
+
reads += c
|
|
2930
|
+
self.assertEqual(reads, self.normalized)
|
|
2931
|
+
|
|
2932
|
+
def test_issue1395_3(self):
|
|
2933
|
+
txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
|
|
2934
|
+
txt._CHUNK_SIZE = 4
|
|
2935
|
+
|
|
2936
|
+
reads = txt.read(4)
|
|
2937
|
+
reads += txt.read(4)
|
|
2938
|
+
reads += txt.readline()
|
|
2939
|
+
reads += txt.readline()
|
|
2940
|
+
reads += txt.readline()
|
|
2941
|
+
self.assertEqual(reads, self.normalized)
|
|
2942
|
+
|
|
2943
|
+
def test_issue1395_4(self):
|
|
2944
|
+
txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
|
|
2945
|
+
txt._CHUNK_SIZE = 4
|
|
2946
|
+
|
|
2947
|
+
reads = txt.read(4)
|
|
2948
|
+
reads += txt.read()
|
|
2949
|
+
self.assertEqual(reads, self.normalized)
|
|
2950
|
+
|
|
2951
|
+
def test_issue1395_5(self):
|
|
2952
|
+
txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
|
|
2953
|
+
txt._CHUNK_SIZE = 4
|
|
2954
|
+
|
|
2955
|
+
reads = txt.read(4)
|
|
2956
|
+
pos = txt.tell()
|
|
2957
|
+
txt.seek(0)
|
|
2958
|
+
txt.seek(pos)
|
|
2959
|
+
self.assertEqual(txt.read(4), "BBB\n")
|
|
2960
|
+
|
|
2961
|
+
def test_issue2282(self):
|
|
2962
|
+
buffer = self.BytesIO(self.testdata)
|
|
2963
|
+
txt = self.TextIOWrapper(buffer, encoding="ascii")
|
|
2964
|
+
|
|
2965
|
+
self.assertEqual(buffer.seekable(), txt.seekable())
|
|
2966
|
+
|
|
2967
|
+
def test_append_bom(self):
|
|
2968
|
+
# The BOM is not written again when appending to a non-empty file
|
|
2969
|
+
filename = support.TESTFN
|
|
2970
|
+
for charset in ('utf-8-sig', 'utf-16', 'utf-32'):
|
|
2971
|
+
with self.open(filename, 'w', encoding=charset) as f:
|
|
2972
|
+
f.write('aaa')
|
|
2973
|
+
pos = f.tell()
|
|
2974
|
+
with self.open(filename, 'rb') as f:
|
|
2975
|
+
self.assertEqual(f.read(), 'aaa'.encode(charset))
|
|
2976
|
+
|
|
2977
|
+
with self.open(filename, 'a', encoding=charset) as f:
|
|
2978
|
+
f.write('xxx')
|
|
2979
|
+
with self.open(filename, 'rb') as f:
|
|
2980
|
+
self.assertEqual(f.read(), 'aaaxxx'.encode(charset))
|
|
2981
|
+
|
|
2982
|
+
def test_seek_bom(self):
|
|
2983
|
+
# Same test, but when seeking manually
|
|
2984
|
+
filename = support.TESTFN
|
|
2985
|
+
for charset in ('utf-8-sig', 'utf-16', 'utf-32'):
|
|
2986
|
+
with self.open(filename, 'w', encoding=charset) as f:
|
|
2987
|
+
f.write('aaa')
|
|
2988
|
+
pos = f.tell()
|
|
2989
|
+
with self.open(filename, 'r+', encoding=charset) as f:
|
|
2990
|
+
f.seek(pos)
|
|
2991
|
+
f.write('zzz')
|
|
2992
|
+
f.seek(0)
|
|
2993
|
+
f.write('bbb')
|
|
2994
|
+
with self.open(filename, 'rb') as f:
|
|
2995
|
+
self.assertEqual(f.read(), 'bbbzzz'.encode(charset))
|
|
2996
|
+
|
|
2997
|
+
def test_seek_append_bom(self):
|
|
2998
|
+
# Same test, but first seek to the start and then to the end
|
|
2999
|
+
filename = support.TESTFN
|
|
3000
|
+
for charset in ('utf-8-sig', 'utf-16', 'utf-32'):
|
|
3001
|
+
with self.open(filename, 'w', encoding=charset) as f:
|
|
3002
|
+
f.write('aaa')
|
|
3003
|
+
with self.open(filename, 'a', encoding=charset) as f:
|
|
3004
|
+
f.seek(0)
|
|
3005
|
+
f.seek(0, self.SEEK_END)
|
|
3006
|
+
f.write('xxx')
|
|
3007
|
+
with self.open(filename, 'rb') as f:
|
|
3008
|
+
self.assertEqual(f.read(), 'aaaxxx'.encode(charset))
|
|
3009
|
+
|
|
3010
|
+
def test_errors_property(self):
|
|
3011
|
+
with self.open(support.TESTFN, "w") as f:
|
|
3012
|
+
self.assertEqual(f.errors, "strict")
|
|
3013
|
+
with self.open(support.TESTFN, "w", errors="replace") as f:
|
|
3014
|
+
self.assertEqual(f.errors, "replace")
|
|
3015
|
+
|
|
3016
|
+
@support.no_tracing
|
|
3017
|
+
@unittest.skipUnless(threading, 'Threading required for this test.')
|
|
3018
|
+
def test_threads_write(self):
|
|
3019
|
+
# Issue6750: concurrent writes could duplicate data
|
|
3020
|
+
event = threading.Event()
|
|
3021
|
+
with self.open(support.TESTFN, "w", buffering=1) as f:
|
|
3022
|
+
def run(n):
|
|
3023
|
+
text = "Thread%03d\n" % n
|
|
3024
|
+
event.wait()
|
|
3025
|
+
f.write(text)
|
|
3026
|
+
threads = [threading.Thread(target=run, args=(x,))
|
|
3027
|
+
for x in range(20)]
|
|
3028
|
+
with support.start_threads(threads, event.set):
|
|
3029
|
+
time.sleep(0.02)
|
|
3030
|
+
with self.open(support.TESTFN) as f:
|
|
3031
|
+
content = f.read()
|
|
3032
|
+
for n in range(20):
|
|
3033
|
+
self.assertEqual(content.count("Thread%03d\n" % n), 1)
|
|
3034
|
+
|
|
3035
|
+
def test_flush_error_on_close(self):
|
|
3036
|
+
# Test that text file is closed despite failed flush
|
|
3037
|
+
# and that flush() is called before file closed.
|
|
3038
|
+
txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
|
|
3039
|
+
closed = []
|
|
3040
|
+
def bad_flush():
|
|
3041
|
+
closed[:] = [txt.closed, txt.buffer.closed]
|
|
3042
|
+
raise OSError()
|
|
3043
|
+
txt.flush = bad_flush
|
|
3044
|
+
self.assertRaises(OSError, txt.close) # exception not swallowed
|
|
3045
|
+
self.assertTrue(txt.closed)
|
|
3046
|
+
self.assertTrue(txt.buffer.closed)
|
|
3047
|
+
self.assertTrue(closed) # flush() called
|
|
3048
|
+
self.assertFalse(closed[0]) # flush() called before file closed
|
|
3049
|
+
self.assertFalse(closed[1])
|
|
3050
|
+
txt.flush = lambda: None # break reference loop
|
|
3051
|
+
|
|
3052
|
+
def test_close_error_on_close(self):
|
|
3053
|
+
buffer = self.BytesIO(self.testdata)
|
|
3054
|
+
def bad_flush():
|
|
3055
|
+
raise OSError('flush')
|
|
3056
|
+
def bad_close():
|
|
3057
|
+
raise OSError('close')
|
|
3058
|
+
buffer.close = bad_close
|
|
3059
|
+
txt = self.TextIOWrapper(buffer, encoding="ascii")
|
|
3060
|
+
txt.flush = bad_flush
|
|
3061
|
+
with self.assertRaises(OSError) as err: # exception not swallowed
|
|
3062
|
+
txt.close()
|
|
3063
|
+
self.assertEqual(err.exception.args, ('close',))
|
|
3064
|
+
self.assertIsInstance(err.exception.__context__, OSError)
|
|
3065
|
+
self.assertEqual(err.exception.__context__.args, ('flush',))
|
|
3066
|
+
self.assertFalse(txt.closed)
|
|
3067
|
+
|
|
3068
|
+
def test_nonnormalized_close_error_on_close(self):
|
|
3069
|
+
# Issue #21677
|
|
3070
|
+
buffer = self.BytesIO(self.testdata)
|
|
3071
|
+
def bad_flush():
|
|
3072
|
+
raise non_existing_flush
|
|
3073
|
+
def bad_close():
|
|
3074
|
+
raise non_existing_close
|
|
3075
|
+
buffer.close = bad_close
|
|
3076
|
+
txt = self.TextIOWrapper(buffer, encoding="ascii")
|
|
3077
|
+
txt.flush = bad_flush
|
|
3078
|
+
with self.assertRaises(NameError) as err: # exception not swallowed
|
|
3079
|
+
txt.close()
|
|
3080
|
+
self.assertIn('non_existing_close', str(err.exception))
|
|
3081
|
+
self.assertIsInstance(err.exception.__context__, NameError)
|
|
3082
|
+
self.assertIn('non_existing_flush', str(err.exception.__context__))
|
|
3083
|
+
self.assertFalse(txt.closed)
|
|
3084
|
+
|
|
3085
|
+
def test_multi_close(self):
|
|
3086
|
+
txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
|
|
3087
|
+
txt.close()
|
|
3088
|
+
txt.close()
|
|
3089
|
+
txt.close()
|
|
3090
|
+
self.assertRaises(ValueError, txt.flush)
|
|
3091
|
+
|
|
3092
|
+
def test_unseekable(self):
|
|
3093
|
+
txt = self.TextIOWrapper(self.MockUnseekableIO(self.testdata))
|
|
3094
|
+
self.assertRaises(self.UnsupportedOperation, txt.tell)
|
|
3095
|
+
self.assertRaises(self.UnsupportedOperation, txt.seek, 0)
|
|
3096
|
+
|
|
3097
|
+
def test_readonly_attributes(self):
|
|
3098
|
+
txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
|
|
3099
|
+
buf = self.BytesIO(self.testdata)
|
|
3100
|
+
with self.assertRaises(AttributeError):
|
|
3101
|
+
txt.buffer = buf
|
|
3102
|
+
|
|
3103
|
+
def test_rawio(self):
|
|
3104
|
+
# Issue #12591: TextIOWrapper must work with raw I/O objects, so
|
|
3105
|
+
# that subprocess.Popen() can have the required unbuffered
|
|
3106
|
+
# semantics with universal_newlines=True.
|
|
3107
|
+
raw = self.MockRawIO([b'abc', b'def', b'ghi\njkl\nopq\n'])
|
|
3108
|
+
txt = self.TextIOWrapper(raw, encoding='ascii', newline='\n')
|
|
3109
|
+
# Reads
|
|
3110
|
+
self.assertEqual(txt.read(4), 'abcd')
|
|
3111
|
+
self.assertEqual(txt.readline(), 'efghi\n')
|
|
3112
|
+
self.assertEqual(list(txt), ['jkl\n', 'opq\n'])
|
|
3113
|
+
|
|
3114
|
+
def test_rawio_write_through(self):
|
|
3115
|
+
# Issue #12591: with write_through=True, writes don't need a flush
|
|
3116
|
+
raw = self.MockRawIO([b'abc', b'def', b'ghi\njkl\nopq\n'])
|
|
3117
|
+
txt = self.TextIOWrapper(raw, encoding='ascii', newline='\n',
|
|
3118
|
+
write_through=True)
|
|
3119
|
+
txt.write('1')
|
|
3120
|
+
txt.write('23\n4')
|
|
3121
|
+
txt.write('5')
|
|
3122
|
+
self.assertEqual(b''.join(raw._write_stack), b'123\n45')
|
|
3123
|
+
|
|
3124
|
+
def test_bufio_write_through(self):
|
|
3125
|
+
# Issue #21396: write_through=True doesn't force a flush()
|
|
3126
|
+
# on the underlying binary buffered object.
|
|
3127
|
+
flush_called, write_called = [], []
|
|
3128
|
+
class BufferedWriter(self.BufferedWriter):
|
|
3129
|
+
def flush(self, *args, **kwargs):
|
|
3130
|
+
flush_called.append(True)
|
|
3131
|
+
return super().flush(*args, **kwargs)
|
|
3132
|
+
def write(self, *args, **kwargs):
|
|
3133
|
+
write_called.append(True)
|
|
3134
|
+
return super().write(*args, **kwargs)
|
|
3135
|
+
|
|
3136
|
+
rawio = self.BytesIO()
|
|
3137
|
+
data = b"a"
|
|
3138
|
+
bufio = BufferedWriter(rawio, len(data)*2)
|
|
3139
|
+
textio = self.TextIOWrapper(bufio, encoding='ascii',
|
|
3140
|
+
write_through=True)
|
|
3141
|
+
# write to the buffered io but don't overflow the buffer
|
|
3142
|
+
text = data.decode('ascii')
|
|
3143
|
+
textio.write(text)
|
|
3144
|
+
|
|
3145
|
+
# buffer.flush is not called with write_through=True
|
|
3146
|
+
self.assertFalse(flush_called)
|
|
3147
|
+
# buffer.write *is* called with write_through=True
|
|
3148
|
+
self.assertTrue(write_called)
|
|
3149
|
+
self.assertEqual(rawio.getvalue(), b"") # no flush
|
|
3150
|
+
|
|
3151
|
+
write_called = [] # reset
|
|
3152
|
+
textio.write(text * 10) # total content is larger than bufio buffer
|
|
3153
|
+
self.assertTrue(write_called)
|
|
3154
|
+
self.assertEqual(rawio.getvalue(), data * 11) # all flushed
|
|
3155
|
+
|
|
3156
|
+
def test_read_nonbytes(self):
|
|
3157
|
+
# Issue #17106
|
|
3158
|
+
# Crash when underlying read() returns non-bytes
|
|
3159
|
+
t = self.TextIOWrapper(self.StringIO('a'))
|
|
3160
|
+
self.assertRaises(TypeError, t.read, 1)
|
|
3161
|
+
t = self.TextIOWrapper(self.StringIO('a'))
|
|
3162
|
+
self.assertRaises(TypeError, t.readline)
|
|
3163
|
+
t = self.TextIOWrapper(self.StringIO('a'))
|
|
3164
|
+
self.assertRaises(TypeError, t.read)
|
|
3165
|
+
|
|
3166
|
+
def test_illegal_encoder(self):
|
|
3167
|
+
# Issue 31271: Calling write() while the return value of encoder's
|
|
3168
|
+
# encode() is invalid shouldn't cause an assertion failure.
|
|
3169
|
+
rot13 = codecs.lookup("rot13")
|
|
3170
|
+
with support.swap_attr(rot13, '_is_text_encoding', True):
|
|
3171
|
+
t = io.TextIOWrapper(io.BytesIO(b'foo'), encoding="rot13")
|
|
3172
|
+
self.assertRaises(TypeError, t.write, 'bar')
|
|
3173
|
+
|
|
3174
|
+
def test_illegal_decoder(self):
|
|
3175
|
+
# Issue #17106
|
|
3176
|
+
# Bypass the early encoding check added in issue 20404
|
|
3177
|
+
def _make_illegal_wrapper():
|
|
3178
|
+
quopri = codecs.lookup("quopri")
|
|
3179
|
+
quopri._is_text_encoding = True
|
|
3180
|
+
try:
|
|
3181
|
+
t = self.TextIOWrapper(self.BytesIO(b'aaaaaa'),
|
|
3182
|
+
newline='\n', encoding="quopri")
|
|
3183
|
+
finally:
|
|
3184
|
+
quopri._is_text_encoding = False
|
|
3185
|
+
return t
|
|
3186
|
+
# Crash when decoder returns non-string
|
|
3187
|
+
t = _make_illegal_wrapper()
|
|
3188
|
+
self.assertRaises(TypeError, t.read, 1)
|
|
3189
|
+
t = _make_illegal_wrapper()
|
|
3190
|
+
self.assertRaises(TypeError, t.readline)
|
|
3191
|
+
t = _make_illegal_wrapper()
|
|
3192
|
+
self.assertRaises(TypeError, t.read)
|
|
3193
|
+
|
|
3194
|
+
# Issue 31243: calling read() while the return value of decoder's
|
|
3195
|
+
# getstate() is invalid should neither crash the interpreter nor
|
|
3196
|
+
# raise a SystemError.
|
|
3197
|
+
def _make_very_illegal_wrapper(getstate_ret_val):
|
|
3198
|
+
class BadDecoder:
|
|
3199
|
+
def getstate(self):
|
|
3200
|
+
return getstate_ret_val
|
|
3201
|
+
def _get_bad_decoder(dummy):
|
|
3202
|
+
return BadDecoder()
|
|
3203
|
+
quopri = codecs.lookup("quopri")
|
|
3204
|
+
with support.swap_attr(quopri, 'incrementaldecoder',
|
|
3205
|
+
_get_bad_decoder):
|
|
3206
|
+
return _make_illegal_wrapper()
|
|
3207
|
+
t = _make_very_illegal_wrapper(42)
|
|
3208
|
+
self.assertRaises(TypeError, t.read, 42)
|
|
3209
|
+
t = _make_very_illegal_wrapper(())
|
|
3210
|
+
self.assertRaises(TypeError, t.read, 42)
|
|
3211
|
+
t = _make_very_illegal_wrapper((1, 2))
|
|
3212
|
+
self.assertRaises(TypeError, t.read, 42)
|
|
3213
|
+
|
|
3214
|
+
def _check_create_at_shutdown(self, **kwargs):
|
|
3215
|
+
# Issue #20037: creating a TextIOWrapper at shutdown
|
|
3216
|
+
# shouldn't crash the interpreter.
|
|
3217
|
+
iomod = self.io.__name__
|
|
3218
|
+
code = """if 1:
|
|
3219
|
+
import codecs
|
|
3220
|
+
import {iomod} as io
|
|
3221
|
+
|
|
3222
|
+
# Avoid looking up codecs at shutdown
|
|
3223
|
+
codecs.lookup('utf-8')
|
|
3224
|
+
|
|
3225
|
+
class C:
|
|
3226
|
+
def __init__(self):
|
|
3227
|
+
self.buf = io.BytesIO()
|
|
3228
|
+
def __del__(self):
|
|
3229
|
+
io.TextIOWrapper(self.buf, **{kwargs})
|
|
3230
|
+
print("ok")
|
|
3231
|
+
c = C()
|
|
3232
|
+
""".format(iomod=iomod, kwargs=kwargs)
|
|
3233
|
+
return assert_python_ok("-c", code)
|
|
3234
|
+
|
|
3235
|
+
@support.requires_type_collecting
|
|
3236
|
+
def test_create_at_shutdown_without_encoding(self):
|
|
3237
|
+
rc, out, err = self._check_create_at_shutdown()
|
|
3238
|
+
if err:
|
|
3239
|
+
# Can error out with a RuntimeError if the module state
|
|
3240
|
+
# isn't found.
|
|
3241
|
+
self.assertIn(self.shutdown_error, err.decode())
|
|
3242
|
+
else:
|
|
3243
|
+
self.assertEqual("ok", out.decode().strip())
|
|
3244
|
+
|
|
3245
|
+
@support.requires_type_collecting
|
|
3246
|
+
def test_create_at_shutdown_with_encoding(self):
|
|
3247
|
+
rc, out, err = self._check_create_at_shutdown(encoding='utf-8',
|
|
3248
|
+
errors='strict')
|
|
3249
|
+
self.assertFalse(err)
|
|
3250
|
+
self.assertEqual("ok", out.decode().strip())
|
|
3251
|
+
|
|
3252
|
+
def test_read_byteslike(self):
|
|
3253
|
+
r = MemviewBytesIO(b'Just some random string\n')
|
|
3254
|
+
t = self.TextIOWrapper(r, 'utf-8')
|
|
3255
|
+
|
|
3256
|
+
# TextIOwrapper will not read the full string, because
|
|
3257
|
+
# we truncate it to a multiple of the native int size
|
|
3258
|
+
# so that we can construct a more complex memoryview.
|
|
3259
|
+
bytes_val = _to_memoryview(r.getvalue()).tobytes()
|
|
3260
|
+
|
|
3261
|
+
self.assertEqual(t.read(200), bytes_val.decode('utf-8'))
|
|
3262
|
+
|
|
3263
|
+
def test_issue22849(self):
|
|
3264
|
+
class F(object):
|
|
3265
|
+
def readable(self): return True
|
|
3266
|
+
def writable(self): return True
|
|
3267
|
+
def seekable(self): return True
|
|
3268
|
+
|
|
3269
|
+
for i in range(10):
|
|
3270
|
+
try:
|
|
3271
|
+
self.TextIOWrapper(F(), encoding='utf-8')
|
|
3272
|
+
except Exception:
|
|
3273
|
+
pass
|
|
3274
|
+
|
|
3275
|
+
F.tell = lambda x: 0
|
|
3276
|
+
t = self.TextIOWrapper(F(), encoding='utf-8')
|
|
3277
|
+
|
|
3278
|
+
|
|
3279
|
+
class MemviewBytesIO(io.BytesIO):
|
|
3280
|
+
'''A BytesIO object whose read method returns memoryviews
|
|
3281
|
+
rather than bytes'''
|
|
3282
|
+
|
|
3283
|
+
def read1(self, len_):
|
|
3284
|
+
return _to_memoryview(super().read1(len_))
|
|
3285
|
+
|
|
3286
|
+
def read(self, len_):
|
|
3287
|
+
return _to_memoryview(super().read(len_))
|
|
3288
|
+
|
|
3289
|
+
def _to_memoryview(buf):
|
|
3290
|
+
'''Convert bytes-object *buf* to a non-trivial memoryview'''
|
|
3291
|
+
|
|
3292
|
+
arr = array.array('i')
|
|
3293
|
+
idx = len(buf) - len(buf) % arr.itemsize
|
|
3294
|
+
arr.frombytes(buf[:idx])
|
|
3295
|
+
return memoryview(arr)
|
|
3296
|
+
|
|
3297
|
+
|
|
3298
|
+
class CTextIOWrapperTest(TextIOWrapperTest):
|
|
3299
|
+
io = io
|
|
3300
|
+
shutdown_error = "RuntimeError: could not find io module state"
|
|
3301
|
+
|
|
3302
|
+
def test_initialization(self):
|
|
3303
|
+
r = self.BytesIO(b"\xc3\xa9\n\n")
|
|
3304
|
+
b = self.BufferedReader(r, 1000)
|
|
3305
|
+
t = self.TextIOWrapper(b)
|
|
3306
|
+
self.assertRaises(ValueError, t.__init__, b, newline='xyzzy')
|
|
3307
|
+
self.assertRaises(ValueError, t.read)
|
|
3308
|
+
|
|
3309
|
+
t = self.TextIOWrapper.__new__(self.TextIOWrapper)
|
|
3310
|
+
self.assertRaises(Exception, repr, t)
|
|
3311
|
+
|
|
3312
|
+
def test_garbage_collection(self):
|
|
3313
|
+
# C TextIOWrapper objects are collected, and collecting them flushes
|
|
3314
|
+
# all data to disk.
|
|
3315
|
+
# The Python version has __del__, so it ends in gc.garbage instead.
|
|
3316
|
+
with support.check_warnings(('', ResourceWarning)):
|
|
3317
|
+
rawio = io.FileIO(support.TESTFN, "wb")
|
|
3318
|
+
b = self.BufferedWriter(rawio)
|
|
3319
|
+
t = self.TextIOWrapper(b, encoding="ascii")
|
|
3320
|
+
t.write("456def")
|
|
3321
|
+
t.x = t
|
|
3322
|
+
wr = weakref.ref(t)
|
|
3323
|
+
del t
|
|
3324
|
+
support.gc_collect()
|
|
3325
|
+
self.assertIsNone(wr(), wr)
|
|
3326
|
+
with self.open(support.TESTFN, "rb") as f:
|
|
3327
|
+
self.assertEqual(f.read(), b"456def")
|
|
3328
|
+
|
|
3329
|
+
def test_rwpair_cleared_before_textio(self):
|
|
3330
|
+
# Issue 13070: TextIOWrapper's finalization would crash when called
|
|
3331
|
+
# after the reference to the underlying BufferedRWPair's writer got
|
|
3332
|
+
# cleared by the GC.
|
|
3333
|
+
for i in range(1000):
|
|
3334
|
+
b1 = self.BufferedRWPair(self.MockRawIO(), self.MockRawIO())
|
|
3335
|
+
t1 = self.TextIOWrapper(b1, encoding="ascii")
|
|
3336
|
+
b2 = self.BufferedRWPair(self.MockRawIO(), self.MockRawIO())
|
|
3337
|
+
t2 = self.TextIOWrapper(b2, encoding="ascii")
|
|
3338
|
+
# circular references
|
|
3339
|
+
t1.buddy = t2
|
|
3340
|
+
t2.buddy = t1
|
|
3341
|
+
support.gc_collect()
|
|
3342
|
+
|
|
3343
|
+
|
|
3344
|
+
class PyTextIOWrapperTest(TextIOWrapperTest):
|
|
3345
|
+
io = pyio
|
|
3346
|
+
shutdown_error = "LookupError: unknown encoding: ascii"
|
|
3347
|
+
|
|
3348
|
+
|
|
3349
|
+
class IncrementalNewlineDecoderTest(unittest.TestCase):
|
|
3350
|
+
|
|
3351
|
+
def check_newline_decoding_utf8(self, decoder):
|
|
3352
|
+
# UTF-8 specific tests for a newline decoder
|
|
3353
|
+
def _check_decode(b, s, **kwargs):
|
|
3354
|
+
# We exercise getstate() / setstate() as well as decode()
|
|
3355
|
+
state = decoder.getstate()
|
|
3356
|
+
self.assertEqual(decoder.decode(b, **kwargs), s)
|
|
3357
|
+
decoder.setstate(state)
|
|
3358
|
+
self.assertEqual(decoder.decode(b, **kwargs), s)
|
|
3359
|
+
|
|
3360
|
+
_check_decode(b'\xe8\xa2\x88', "\u8888")
|
|
3361
|
+
|
|
3362
|
+
_check_decode(b'\xe8', "")
|
|
3363
|
+
_check_decode(b'\xa2', "")
|
|
3364
|
+
_check_decode(b'\x88', "\u8888")
|
|
3365
|
+
|
|
3366
|
+
_check_decode(b'\xe8', "")
|
|
3367
|
+
_check_decode(b'\xa2', "")
|
|
3368
|
+
_check_decode(b'\x88', "\u8888")
|
|
3369
|
+
|
|
3370
|
+
_check_decode(b'\xe8', "")
|
|
3371
|
+
self.assertRaises(UnicodeDecodeError, decoder.decode, b'', final=True)
|
|
3372
|
+
|
|
3373
|
+
decoder.reset()
|
|
3374
|
+
_check_decode(b'\n', "\n")
|
|
3375
|
+
_check_decode(b'\r', "")
|
|
3376
|
+
_check_decode(b'', "\n", final=True)
|
|
3377
|
+
_check_decode(b'\r', "\n", final=True)
|
|
3378
|
+
|
|
3379
|
+
_check_decode(b'\r', "")
|
|
3380
|
+
_check_decode(b'a', "\na")
|
|
3381
|
+
|
|
3382
|
+
_check_decode(b'\r\r\n', "\n\n")
|
|
3383
|
+
_check_decode(b'\r', "")
|
|
3384
|
+
_check_decode(b'\r', "\n")
|
|
3385
|
+
_check_decode(b'\na', "\na")
|
|
3386
|
+
|
|
3387
|
+
_check_decode(b'\xe8\xa2\x88\r\n', "\u8888\n")
|
|
3388
|
+
_check_decode(b'\xe8\xa2\x88', "\u8888")
|
|
3389
|
+
_check_decode(b'\n', "\n")
|
|
3390
|
+
_check_decode(b'\xe8\xa2\x88\r', "\u8888")
|
|
3391
|
+
_check_decode(b'\n', "\n")
|
|
3392
|
+
|
|
3393
|
+
def check_newline_decoding(self, decoder, encoding):
|
|
3394
|
+
result = []
|
|
3395
|
+
if encoding is not None:
|
|
3396
|
+
encoder = codecs.getincrementalencoder(encoding)()
|
|
3397
|
+
def _decode_bytewise(s):
|
|
3398
|
+
# Decode one byte at a time
|
|
3399
|
+
for b in encoder.encode(s):
|
|
3400
|
+
result.append(decoder.decode(bytes([b])))
|
|
3401
|
+
else:
|
|
3402
|
+
encoder = None
|
|
3403
|
+
def _decode_bytewise(s):
|
|
3404
|
+
# Decode one char at a time
|
|
3405
|
+
for c in s:
|
|
3406
|
+
result.append(decoder.decode(c))
|
|
3407
|
+
self.assertEqual(decoder.newlines, None)
|
|
3408
|
+
_decode_bytewise("abc\n\r")
|
|
3409
|
+
self.assertEqual(decoder.newlines, '\n')
|
|
3410
|
+
_decode_bytewise("\nabc")
|
|
3411
|
+
self.assertEqual(decoder.newlines, ('\n', '\r\n'))
|
|
3412
|
+
_decode_bytewise("abc\r")
|
|
3413
|
+
self.assertEqual(decoder.newlines, ('\n', '\r\n'))
|
|
3414
|
+
_decode_bytewise("abc")
|
|
3415
|
+
self.assertEqual(decoder.newlines, ('\r', '\n', '\r\n'))
|
|
3416
|
+
_decode_bytewise("abc\r")
|
|
3417
|
+
self.assertEqual("".join(result), "abc\n\nabcabc\nabcabc")
|
|
3418
|
+
decoder.reset()
|
|
3419
|
+
input = "abc"
|
|
3420
|
+
if encoder is not None:
|
|
3421
|
+
encoder.reset()
|
|
3422
|
+
input = encoder.encode(input)
|
|
3423
|
+
self.assertEqual(decoder.decode(input), "abc")
|
|
3424
|
+
self.assertEqual(decoder.newlines, None)
|
|
3425
|
+
|
|
3426
|
+
def test_newline_decoder(self):
|
|
3427
|
+
encodings = (
|
|
3428
|
+
# None meaning the IncrementalNewlineDecoder takes unicode input
|
|
3429
|
+
# rather than bytes input
|
|
3430
|
+
None, 'utf-8', 'latin-1',
|
|
3431
|
+
'utf-16', 'utf-16-le', 'utf-16-be',
|
|
3432
|
+
'utf-32', 'utf-32-le', 'utf-32-be',
|
|
3433
|
+
)
|
|
3434
|
+
for enc in encodings:
|
|
3435
|
+
decoder = enc and codecs.getincrementaldecoder(enc)()
|
|
3436
|
+
decoder = self.IncrementalNewlineDecoder(decoder, translate=True)
|
|
3437
|
+
self.check_newline_decoding(decoder, enc)
|
|
3438
|
+
decoder = codecs.getincrementaldecoder("utf-8")()
|
|
3439
|
+
decoder = self.IncrementalNewlineDecoder(decoder, translate=True)
|
|
3440
|
+
self.check_newline_decoding_utf8(decoder)
|
|
3441
|
+
self.assertRaises(TypeError, decoder.setstate, 42)
|
|
3442
|
+
|
|
3443
|
+
def test_newline_bytes(self):
|
|
3444
|
+
# Issue 5433: Excessive optimization in IncrementalNewlineDecoder
|
|
3445
|
+
def _check(dec):
|
|
3446
|
+
self.assertEqual(dec.newlines, None)
|
|
3447
|
+
self.assertEqual(dec.decode("\u0D00"), "\u0D00")
|
|
3448
|
+
self.assertEqual(dec.newlines, None)
|
|
3449
|
+
self.assertEqual(dec.decode("\u0A00"), "\u0A00")
|
|
3450
|
+
self.assertEqual(dec.newlines, None)
|
|
3451
|
+
dec = self.IncrementalNewlineDecoder(None, translate=False)
|
|
3452
|
+
_check(dec)
|
|
3453
|
+
dec = self.IncrementalNewlineDecoder(None, translate=True)
|
|
3454
|
+
_check(dec)
|
|
3455
|
+
|
|
3456
|
+
class CIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest):
|
|
3457
|
+
pass
|
|
3458
|
+
|
|
3459
|
+
class PyIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest):
|
|
3460
|
+
pass
|
|
3461
|
+
|
|
3462
|
+
|
|
3463
|
+
# XXX Tests for open()
|
|
3464
|
+
|
|
3465
|
+
class MiscIOTest(unittest.TestCase):
|
|
3466
|
+
|
|
3467
|
+
def tearDown(self):
|
|
3468
|
+
support.unlink(support.TESTFN)
|
|
3469
|
+
|
|
3470
|
+
def test___all__(self):
|
|
3471
|
+
for name in self.io.__all__:
|
|
3472
|
+
obj = getattr(self.io, name, None)
|
|
3473
|
+
self.assertIsNotNone(obj, name)
|
|
3474
|
+
if name == "open":
|
|
3475
|
+
continue
|
|
3476
|
+
elif "error" in name.lower() or name == "UnsupportedOperation":
|
|
3477
|
+
self.assertTrue(issubclass(obj, Exception), name)
|
|
3478
|
+
elif not name.startswith("SEEK_"):
|
|
3479
|
+
self.assertTrue(issubclass(obj, self.IOBase))
|
|
3480
|
+
|
|
3481
|
+
def test_attributes(self):
|
|
3482
|
+
f = self.open(support.TESTFN, "wb", buffering=0)
|
|
3483
|
+
self.assertEqual(f.mode, "wb")
|
|
3484
|
+
f.close()
|
|
3485
|
+
|
|
3486
|
+
with support.check_warnings(('', DeprecationWarning)):
|
|
3487
|
+
f = self.open(support.TESTFN, "U")
|
|
3488
|
+
self.assertEqual(f.name, support.TESTFN)
|
|
3489
|
+
self.assertEqual(f.buffer.name, support.TESTFN)
|
|
3490
|
+
self.assertEqual(f.buffer.raw.name, support.TESTFN)
|
|
3491
|
+
self.assertEqual(f.mode, "U")
|
|
3492
|
+
self.assertEqual(f.buffer.mode, "rb")
|
|
3493
|
+
self.assertEqual(f.buffer.raw.mode, "rb")
|
|
3494
|
+
f.close()
|
|
3495
|
+
|
|
3496
|
+
f = self.open(support.TESTFN, "w+")
|
|
3497
|
+
self.assertEqual(f.mode, "w+")
|
|
3498
|
+
self.assertEqual(f.buffer.mode, "rb+") # Does it really matter?
|
|
3499
|
+
self.assertEqual(f.buffer.raw.mode, "rb+")
|
|
3500
|
+
|
|
3501
|
+
g = self.open(f.fileno(), "wb", closefd=False)
|
|
3502
|
+
self.assertEqual(g.mode, "wb")
|
|
3503
|
+
self.assertEqual(g.raw.mode, "wb")
|
|
3504
|
+
self.assertEqual(g.name, f.fileno())
|
|
3505
|
+
self.assertEqual(g.raw.name, f.fileno())
|
|
3506
|
+
f.close()
|
|
3507
|
+
g.close()
|
|
3508
|
+
|
|
3509
|
+
def test_io_after_close(self):
|
|
3510
|
+
for kwargs in [
|
|
3511
|
+
{"mode": "w"},
|
|
3512
|
+
{"mode": "wb"},
|
|
3513
|
+
{"mode": "w", "buffering": 1},
|
|
3514
|
+
{"mode": "w", "buffering": 2},
|
|
3515
|
+
{"mode": "wb", "buffering": 0},
|
|
3516
|
+
{"mode": "r"},
|
|
3517
|
+
{"mode": "rb"},
|
|
3518
|
+
{"mode": "r", "buffering": 1},
|
|
3519
|
+
{"mode": "r", "buffering": 2},
|
|
3520
|
+
{"mode": "rb", "buffering": 0},
|
|
3521
|
+
{"mode": "w+"},
|
|
3522
|
+
{"mode": "w+b"},
|
|
3523
|
+
{"mode": "w+", "buffering": 1},
|
|
3524
|
+
{"mode": "w+", "buffering": 2},
|
|
3525
|
+
{"mode": "w+b", "buffering": 0},
|
|
3526
|
+
]:
|
|
3527
|
+
f = self.open(support.TESTFN, **kwargs)
|
|
3528
|
+
f.close()
|
|
3529
|
+
self.assertRaises(ValueError, f.flush)
|
|
3530
|
+
self.assertRaises(ValueError, f.fileno)
|
|
3531
|
+
self.assertRaises(ValueError, f.isatty)
|
|
3532
|
+
self.assertRaises(ValueError, f.__iter__)
|
|
3533
|
+
if hasattr(f, "peek"):
|
|
3534
|
+
self.assertRaises(ValueError, f.peek, 1)
|
|
3535
|
+
self.assertRaises(ValueError, f.read)
|
|
3536
|
+
if hasattr(f, "read1"):
|
|
3537
|
+
self.assertRaises(ValueError, f.read1, 1024)
|
|
3538
|
+
if hasattr(f, "readall"):
|
|
3539
|
+
self.assertRaises(ValueError, f.readall)
|
|
3540
|
+
if hasattr(f, "readinto"):
|
|
3541
|
+
self.assertRaises(ValueError, f.readinto, bytearray(1024))
|
|
3542
|
+
if hasattr(f, "readinto1"):
|
|
3543
|
+
self.assertRaises(ValueError, f.readinto1, bytearray(1024))
|
|
3544
|
+
self.assertRaises(ValueError, f.readline)
|
|
3545
|
+
self.assertRaises(ValueError, f.readlines)
|
|
3546
|
+
self.assertRaises(ValueError, f.readlines, 1)
|
|
3547
|
+
self.assertRaises(ValueError, f.seek, 0)
|
|
3548
|
+
self.assertRaises(ValueError, f.tell)
|
|
3549
|
+
self.assertRaises(ValueError, f.truncate)
|
|
3550
|
+
self.assertRaises(ValueError, f.write,
|
|
3551
|
+
b"" if "b" in kwargs['mode'] else "")
|
|
3552
|
+
self.assertRaises(ValueError, f.writelines, [])
|
|
3553
|
+
self.assertRaises(ValueError, next, f)
|
|
3554
|
+
|
|
3555
|
+
def test_blockingioerror(self):
|
|
3556
|
+
# Various BlockingIOError issues
|
|
3557
|
+
class C(str):
|
|
3558
|
+
pass
|
|
3559
|
+
c = C("")
|
|
3560
|
+
b = self.BlockingIOError(1, c)
|
|
3561
|
+
c.b = b
|
|
3562
|
+
b.c = c
|
|
3563
|
+
wr = weakref.ref(c)
|
|
3564
|
+
del c, b
|
|
3565
|
+
support.gc_collect()
|
|
3566
|
+
self.assertIsNone(wr(), wr)
|
|
3567
|
+
|
|
3568
|
+
def test_abcs(self):
|
|
3569
|
+
# Test the visible base classes are ABCs.
|
|
3570
|
+
self.assertIsInstance(self.IOBase, abc.ABCMeta)
|
|
3571
|
+
self.assertIsInstance(self.RawIOBase, abc.ABCMeta)
|
|
3572
|
+
self.assertIsInstance(self.BufferedIOBase, abc.ABCMeta)
|
|
3573
|
+
self.assertIsInstance(self.TextIOBase, abc.ABCMeta)
|
|
3574
|
+
|
|
3575
|
+
def _check_abc_inheritance(self, abcmodule):
|
|
3576
|
+
with self.open(support.TESTFN, "wb", buffering=0) as f:
|
|
3577
|
+
self.assertIsInstance(f, abcmodule.IOBase)
|
|
3578
|
+
self.assertIsInstance(f, abcmodule.RawIOBase)
|
|
3579
|
+
self.assertNotIsInstance(f, abcmodule.BufferedIOBase)
|
|
3580
|
+
self.assertNotIsInstance(f, abcmodule.TextIOBase)
|
|
3581
|
+
with self.open(support.TESTFN, "wb") as f:
|
|
3582
|
+
self.assertIsInstance(f, abcmodule.IOBase)
|
|
3583
|
+
self.assertNotIsInstance(f, abcmodule.RawIOBase)
|
|
3584
|
+
self.assertIsInstance(f, abcmodule.BufferedIOBase)
|
|
3585
|
+
self.assertNotIsInstance(f, abcmodule.TextIOBase)
|
|
3586
|
+
with self.open(support.TESTFN, "w") as f:
|
|
3587
|
+
self.assertIsInstance(f, abcmodule.IOBase)
|
|
3588
|
+
self.assertNotIsInstance(f, abcmodule.RawIOBase)
|
|
3589
|
+
self.assertNotIsInstance(f, abcmodule.BufferedIOBase)
|
|
3590
|
+
self.assertIsInstance(f, abcmodule.TextIOBase)
|
|
3591
|
+
|
|
3592
|
+
def test_abc_inheritance(self):
|
|
3593
|
+
# Test implementations inherit from their respective ABCs
|
|
3594
|
+
self._check_abc_inheritance(self)
|
|
3595
|
+
|
|
3596
|
+
def test_abc_inheritance_official(self):
|
|
3597
|
+
# Test implementations inherit from the official ABCs of the
|
|
3598
|
+
# baseline "io" module.
|
|
3599
|
+
self._check_abc_inheritance(io)
|
|
3600
|
+
|
|
3601
|
+
def _check_warn_on_dealloc(self, *args, **kwargs):
|
|
3602
|
+
f = open(*args, **kwargs)
|
|
3603
|
+
r = repr(f)
|
|
3604
|
+
with self.assertWarns(ResourceWarning) as cm:
|
|
3605
|
+
f = None
|
|
3606
|
+
support.gc_collect()
|
|
3607
|
+
self.assertIn(r, str(cm.warning.args[0]))
|
|
3608
|
+
|
|
3609
|
+
def test_warn_on_dealloc(self):
|
|
3610
|
+
self._check_warn_on_dealloc(support.TESTFN, "wb", buffering=0)
|
|
3611
|
+
self._check_warn_on_dealloc(support.TESTFN, "wb")
|
|
3612
|
+
self._check_warn_on_dealloc(support.TESTFN, "w")
|
|
3613
|
+
|
|
3614
|
+
def _check_warn_on_dealloc_fd(self, *args, **kwargs):
|
|
3615
|
+
fds = []
|
|
3616
|
+
def cleanup_fds():
|
|
3617
|
+
for fd in fds:
|
|
3618
|
+
try:
|
|
3619
|
+
os.close(fd)
|
|
3620
|
+
except OSError as e:
|
|
3621
|
+
if e.errno != errno.EBADF:
|
|
3622
|
+
raise
|
|
3623
|
+
self.addCleanup(cleanup_fds)
|
|
3624
|
+
r, w = os.pipe()
|
|
3625
|
+
fds += r, w
|
|
3626
|
+
self._check_warn_on_dealloc(r, *args, **kwargs)
|
|
3627
|
+
# When using closefd=False, there's no warning
|
|
3628
|
+
r, w = os.pipe()
|
|
3629
|
+
fds += r, w
|
|
3630
|
+
with support.check_no_resource_warning(self):
|
|
3631
|
+
open(r, *args, closefd=False, **kwargs)
|
|
3632
|
+
|
|
3633
|
+
def test_warn_on_dealloc_fd(self):
|
|
3634
|
+
self._check_warn_on_dealloc_fd("rb", buffering=0)
|
|
3635
|
+
self._check_warn_on_dealloc_fd("rb")
|
|
3636
|
+
self._check_warn_on_dealloc_fd("r")
|
|
3637
|
+
|
|
3638
|
+
|
|
3639
|
+
def test_pickling(self):
|
|
3640
|
+
# Pickling file objects is forbidden
|
|
3641
|
+
for kwargs in [
|
|
3642
|
+
{"mode": "w"},
|
|
3643
|
+
{"mode": "wb"},
|
|
3644
|
+
{"mode": "wb", "buffering": 0},
|
|
3645
|
+
{"mode": "r"},
|
|
3646
|
+
{"mode": "rb"},
|
|
3647
|
+
{"mode": "rb", "buffering": 0},
|
|
3648
|
+
{"mode": "w+"},
|
|
3649
|
+
{"mode": "w+b"},
|
|
3650
|
+
{"mode": "w+b", "buffering": 0},
|
|
3651
|
+
]:
|
|
3652
|
+
for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
|
|
3653
|
+
with self.open(support.TESTFN, **kwargs) as f:
|
|
3654
|
+
self.assertRaises(TypeError, pickle.dumps, f, protocol)
|
|
3655
|
+
|
|
3656
|
+
def test_nonblock_pipe_write_bigbuf(self):
|
|
3657
|
+
self._test_nonblock_pipe_write(16*1024)
|
|
3658
|
+
|
|
3659
|
+
def test_nonblock_pipe_write_smallbuf(self):
|
|
3660
|
+
self._test_nonblock_pipe_write(1024)
|
|
3661
|
+
|
|
3662
|
+
@unittest.skipUnless(hasattr(os, 'set_blocking'),
|
|
3663
|
+
'os.set_blocking() required for this test')
|
|
3664
|
+
def _test_nonblock_pipe_write(self, bufsize):
|
|
3665
|
+
sent = []
|
|
3666
|
+
received = []
|
|
3667
|
+
r, w = os.pipe()
|
|
3668
|
+
os.set_blocking(r, False)
|
|
3669
|
+
os.set_blocking(w, False)
|
|
3670
|
+
|
|
3671
|
+
# To exercise all code paths in the C implementation we need
|
|
3672
|
+
# to play with buffer sizes. For instance, if we choose a
|
|
3673
|
+
# buffer size less than or equal to _PIPE_BUF (4096 on Linux)
|
|
3674
|
+
# then we will never get a partial write of the buffer.
|
|
3675
|
+
rf = self.open(r, mode='rb', closefd=True, buffering=bufsize)
|
|
3676
|
+
wf = self.open(w, mode='wb', closefd=True, buffering=bufsize)
|
|
3677
|
+
|
|
3678
|
+
with rf, wf:
|
|
3679
|
+
for N in 9999, 73, 7574:
|
|
3680
|
+
try:
|
|
3681
|
+
i = 0
|
|
3682
|
+
while True:
|
|
3683
|
+
msg = bytes([i % 26 + 97]) * N
|
|
3684
|
+
sent.append(msg)
|
|
3685
|
+
wf.write(msg)
|
|
3686
|
+
i += 1
|
|
3687
|
+
|
|
3688
|
+
except self.BlockingIOError as e:
|
|
3689
|
+
self.assertEqual(e.args[0], errno.EAGAIN)
|
|
3690
|
+
self.assertEqual(e.args[2], e.characters_written)
|
|
3691
|
+
sent[-1] = sent[-1][:e.characters_written]
|
|
3692
|
+
received.append(rf.read())
|
|
3693
|
+
msg = b'BLOCKED'
|
|
3694
|
+
wf.write(msg)
|
|
3695
|
+
sent.append(msg)
|
|
3696
|
+
|
|
3697
|
+
while True:
|
|
3698
|
+
try:
|
|
3699
|
+
wf.flush()
|
|
3700
|
+
break
|
|
3701
|
+
except self.BlockingIOError as e:
|
|
3702
|
+
self.assertEqual(e.args[0], errno.EAGAIN)
|
|
3703
|
+
self.assertEqual(e.args[2], e.characters_written)
|
|
3704
|
+
self.assertEqual(e.characters_written, 0)
|
|
3705
|
+
received.append(rf.read())
|
|
3706
|
+
|
|
3707
|
+
received += iter(rf.read, None)
|
|
3708
|
+
|
|
3709
|
+
sent, received = b''.join(sent), b''.join(received)
|
|
3710
|
+
self.assertEqual(sent, received)
|
|
3711
|
+
self.assertTrue(wf.closed)
|
|
3712
|
+
self.assertTrue(rf.closed)
|
|
3713
|
+
|
|
3714
|
+
def test_create_fail(self):
|
|
3715
|
+
# 'x' mode fails if file is existing
|
|
3716
|
+
with self.open(support.TESTFN, 'w'):
|
|
3717
|
+
pass
|
|
3718
|
+
self.assertRaises(FileExistsError, self.open, support.TESTFN, 'x')
|
|
3719
|
+
|
|
3720
|
+
def test_create_writes(self):
|
|
3721
|
+
# 'x' mode opens for writing
|
|
3722
|
+
with self.open(support.TESTFN, 'xb') as f:
|
|
3723
|
+
f.write(b"spam")
|
|
3724
|
+
with self.open(support.TESTFN, 'rb') as f:
|
|
3725
|
+
self.assertEqual(b"spam", f.read())
|
|
3726
|
+
|
|
3727
|
+
def test_open_allargs(self):
|
|
3728
|
+
# there used to be a buffer overflow in the parser for rawmode
|
|
3729
|
+
self.assertRaises(ValueError, self.open, support.TESTFN, 'rwax+')
|
|
3730
|
+
|
|
3731
|
+
|
|
3732
|
+
class CMiscIOTest(MiscIOTest):
|
|
3733
|
+
io = io
|
|
3734
|
+
|
|
3735
|
+
def test_readinto_buffer_overflow(self):
|
|
3736
|
+
# Issue #18025
|
|
3737
|
+
class BadReader(self.io.BufferedIOBase):
|
|
3738
|
+
def read(self, n=-1):
|
|
3739
|
+
return b'x' * 10**6
|
|
3740
|
+
bufio = BadReader()
|
|
3741
|
+
b = bytearray(2)
|
|
3742
|
+
self.assertRaises(ValueError, bufio.readinto, b)
|
|
3743
|
+
|
|
3744
|
+
@unittest.skipUnless(threading, 'Threading required for this test.')
|
|
3745
|
+
def check_daemon_threads_shutdown_deadlock(self, stream_name):
|
|
3746
|
+
# Issue #23309: deadlocks at shutdown should be avoided when a
|
|
3747
|
+
# daemon thread and the main thread both write to a file.
|
|
3748
|
+
code = """if 1:
|
|
3749
|
+
import sys
|
|
3750
|
+
import time
|
|
3751
|
+
import threading
|
|
3752
|
+
from test.support import SuppressCrashReport
|
|
3753
|
+
|
|
3754
|
+
file = sys.{stream_name}
|
|
3755
|
+
|
|
3756
|
+
def run():
|
|
3757
|
+
while True:
|
|
3758
|
+
file.write('.')
|
|
3759
|
+
file.flush()
|
|
3760
|
+
|
|
3761
|
+
crash = SuppressCrashReport()
|
|
3762
|
+
crash.__enter__()
|
|
3763
|
+
# don't call __exit__(): the crash occurs at Python shutdown
|
|
3764
|
+
|
|
3765
|
+
thread = threading.Thread(target=run)
|
|
3766
|
+
thread.daemon = True
|
|
3767
|
+
thread.start()
|
|
3768
|
+
|
|
3769
|
+
time.sleep(0.5)
|
|
3770
|
+
file.write('!')
|
|
3771
|
+
file.flush()
|
|
3772
|
+
""".format_map(locals())
|
|
3773
|
+
res, _ = run_python_until_end("-c", code)
|
|
3774
|
+
err = res.err.decode()
|
|
3775
|
+
if res.rc != 0:
|
|
3776
|
+
# Failure: should be a fatal error
|
|
3777
|
+
self.assertIn("Fatal Python error: could not acquire lock "
|
|
3778
|
+
"for <_io.BufferedWriter name='<{stream_name}>'> "
|
|
3779
|
+
"at interpreter shutdown, possibly due to "
|
|
3780
|
+
"daemon threads".format_map(locals()),
|
|
3781
|
+
err)
|
|
3782
|
+
else:
|
|
3783
|
+
self.assertFalse(err.strip('.!'))
|
|
3784
|
+
|
|
3785
|
+
def test_daemon_threads_shutdown_stdout_deadlock(self):
|
|
3786
|
+
self.check_daemon_threads_shutdown_deadlock('stdout')
|
|
3787
|
+
|
|
3788
|
+
def test_daemon_threads_shutdown_stderr_deadlock(self):
|
|
3789
|
+
self.check_daemon_threads_shutdown_deadlock('stderr')
|
|
3790
|
+
|
|
3791
|
+
|
|
3792
|
+
class PyMiscIOTest(MiscIOTest):
|
|
3793
|
+
io = pyio
|
|
3794
|
+
|
|
3795
|
+
|
|
3796
|
+
@unittest.skipIf(os.name == 'nt', 'POSIX signals required for this test.')
|
|
3797
|
+
class SignalsTest(unittest.TestCase):
|
|
3798
|
+
|
|
3799
|
+
def setUp(self):
|
|
3800
|
+
self.oldalrm = signal.signal(signal.SIGALRM, self.alarm_interrupt)
|
|
3801
|
+
|
|
3802
|
+
def tearDown(self):
|
|
3803
|
+
signal.signal(signal.SIGALRM, self.oldalrm)
|
|
3804
|
+
|
|
3805
|
+
def alarm_interrupt(self, sig, frame):
|
|
3806
|
+
1/0
|
|
3807
|
+
|
|
3808
|
+
@unittest.skipUnless(threading, 'Threading required for this test.')
|
|
3809
|
+
def check_interrupted_write(self, item, bytes, **fdopen_kwargs):
|
|
3810
|
+
"""Check that a partial write, when it gets interrupted, properly
|
|
3811
|
+
invokes the signal handler, and bubbles up the exception raised
|
|
3812
|
+
in the latter."""
|
|
3813
|
+
read_results = []
|
|
3814
|
+
def _read():
|
|
3815
|
+
if hasattr(signal, 'pthread_sigmask'):
|
|
3816
|
+
signal.pthread_sigmask(signal.SIG_BLOCK, [signal.SIGALRM])
|
|
3817
|
+
s = os.read(r, 1)
|
|
3818
|
+
read_results.append(s)
|
|
3819
|
+
t = threading.Thread(target=_read)
|
|
3820
|
+
t.daemon = True
|
|
3821
|
+
r, w = os.pipe()
|
|
3822
|
+
fdopen_kwargs["closefd"] = False
|
|
3823
|
+
large_data = item * (support.PIPE_MAX_SIZE // len(item) + 1)
|
|
3824
|
+
try:
|
|
3825
|
+
wio = self.io.open(w, **fdopen_kwargs)
|
|
3826
|
+
t.start()
|
|
3827
|
+
# Fill the pipe enough that the write will be blocking.
|
|
3828
|
+
# It will be interrupted by the timer armed above. Since the
|
|
3829
|
+
# other thread has read one byte, the low-level write will
|
|
3830
|
+
# return with a successful (partial) result rather than an EINTR.
|
|
3831
|
+
# The buffered IO layer must check for pending signal
|
|
3832
|
+
# handlers, which in this case will invoke alarm_interrupt().
|
|
3833
|
+
signal.alarm(1)
|
|
3834
|
+
try:
|
|
3835
|
+
self.assertRaises(ZeroDivisionError, wio.write, large_data)
|
|
3836
|
+
finally:
|
|
3837
|
+
signal.alarm(0)
|
|
3838
|
+
t.join()
|
|
3839
|
+
# We got one byte, get another one and check that it isn't a
|
|
3840
|
+
# repeat of the first one.
|
|
3841
|
+
read_results.append(os.read(r, 1))
|
|
3842
|
+
self.assertEqual(read_results, [bytes[0:1], bytes[1:2]])
|
|
3843
|
+
finally:
|
|
3844
|
+
os.close(w)
|
|
3845
|
+
os.close(r)
|
|
3846
|
+
# This is deliberate. If we didn't close the file descriptor
|
|
3847
|
+
# before closing wio, wio would try to flush its internal
|
|
3848
|
+
# buffer, and block again.
|
|
3849
|
+
try:
|
|
3850
|
+
wio.close()
|
|
3851
|
+
except OSError as e:
|
|
3852
|
+
if e.errno != errno.EBADF:
|
|
3853
|
+
raise
|
|
3854
|
+
|
|
3855
|
+
def test_interrupted_write_unbuffered(self):
|
|
3856
|
+
self.check_interrupted_write(b"xy", b"xy", mode="wb", buffering=0)
|
|
3857
|
+
|
|
3858
|
+
def test_interrupted_write_buffered(self):
|
|
3859
|
+
self.check_interrupted_write(b"xy", b"xy", mode="wb")
|
|
3860
|
+
|
|
3861
|
+
# Issue #22331: The test hangs on FreeBSD 7.2
|
|
3862
|
+
@support.requires_freebsd_version(8)
|
|
3863
|
+
def test_interrupted_write_text(self):
|
|
3864
|
+
self.check_interrupted_write("xy", b"xy", mode="w", encoding="ascii")
|
|
3865
|
+
|
|
3866
|
+
@support.no_tracing
|
|
3867
|
+
def check_reentrant_write(self, data, **fdopen_kwargs):
|
|
3868
|
+
def on_alarm(*args):
|
|
3869
|
+
# Will be called reentrantly from the same thread
|
|
3870
|
+
wio.write(data)
|
|
3871
|
+
1/0
|
|
3872
|
+
signal.signal(signal.SIGALRM, on_alarm)
|
|
3873
|
+
r, w = os.pipe()
|
|
3874
|
+
wio = self.io.open(w, **fdopen_kwargs)
|
|
3875
|
+
try:
|
|
3876
|
+
signal.alarm(1)
|
|
3877
|
+
# Either the reentrant call to wio.write() fails with RuntimeError,
|
|
3878
|
+
# or the signal handler raises ZeroDivisionError.
|
|
3879
|
+
with self.assertRaises((ZeroDivisionError, RuntimeError)) as cm:
|
|
3880
|
+
while 1:
|
|
3881
|
+
for i in range(100):
|
|
3882
|
+
wio.write(data)
|
|
3883
|
+
wio.flush()
|
|
3884
|
+
# Make sure the buffer doesn't fill up and block further writes
|
|
3885
|
+
os.read(r, len(data) * 100)
|
|
3886
|
+
exc = cm.exception
|
|
3887
|
+
if isinstance(exc, RuntimeError):
|
|
3888
|
+
self.assertTrue(str(exc).startswith("reentrant call"), str(exc))
|
|
3889
|
+
finally:
|
|
3890
|
+
wio.close()
|
|
3891
|
+
os.close(r)
|
|
3892
|
+
|
|
3893
|
+
def test_reentrant_write_buffered(self):
|
|
3894
|
+
self.check_reentrant_write(b"xy", mode="wb")
|
|
3895
|
+
|
|
3896
|
+
def test_reentrant_write_text(self):
|
|
3897
|
+
self.check_reentrant_write("xy", mode="w", encoding="ascii")
|
|
3898
|
+
|
|
3899
|
+
def check_interrupted_read_retry(self, decode, **fdopen_kwargs):
|
|
3900
|
+
"""Check that a buffered read, when it gets interrupted (either
|
|
3901
|
+
returning a partial result or EINTR), properly invokes the signal
|
|
3902
|
+
handler and retries if the latter returned successfully."""
|
|
3903
|
+
r, w = os.pipe()
|
|
3904
|
+
fdopen_kwargs["closefd"] = False
|
|
3905
|
+
def alarm_handler(sig, frame):
|
|
3906
|
+
os.write(w, b"bar")
|
|
3907
|
+
signal.signal(signal.SIGALRM, alarm_handler)
|
|
3908
|
+
try:
|
|
3909
|
+
rio = self.io.open(r, **fdopen_kwargs)
|
|
3910
|
+
os.write(w, b"foo")
|
|
3911
|
+
signal.alarm(1)
|
|
3912
|
+
# Expected behaviour:
|
|
3913
|
+
# - first raw read() returns partial b"foo"
|
|
3914
|
+
# - second raw read() returns EINTR
|
|
3915
|
+
# - third raw read() returns b"bar"
|
|
3916
|
+
self.assertEqual(decode(rio.read(6)), "foobar")
|
|
3917
|
+
finally:
|
|
3918
|
+
rio.close()
|
|
3919
|
+
os.close(w)
|
|
3920
|
+
os.close(r)
|
|
3921
|
+
|
|
3922
|
+
def test_interrupted_read_retry_buffered(self):
|
|
3923
|
+
self.check_interrupted_read_retry(lambda x: x.decode('latin1'),
|
|
3924
|
+
mode="rb")
|
|
3925
|
+
|
|
3926
|
+
def test_interrupted_read_retry_text(self):
|
|
3927
|
+
self.check_interrupted_read_retry(lambda x: x,
|
|
3928
|
+
mode="r")
|
|
3929
|
+
|
|
3930
|
+
@unittest.skipUnless(threading, 'Threading required for this test.')
|
|
3931
|
+
def check_interrupted_write_retry(self, item, **fdopen_kwargs):
|
|
3932
|
+
"""Check that a buffered write, when it gets interrupted (either
|
|
3933
|
+
returning a partial result or EINTR), properly invokes the signal
|
|
3934
|
+
handler and retries if the latter returned successfully."""
|
|
3935
|
+
select = support.import_module("select")
|
|
3936
|
+
|
|
3937
|
+
# A quantity that exceeds the buffer size of an anonymous pipe's
|
|
3938
|
+
# write end.
|
|
3939
|
+
N = support.PIPE_MAX_SIZE
|
|
3940
|
+
r, w = os.pipe()
|
|
3941
|
+
fdopen_kwargs["closefd"] = False
|
|
3942
|
+
|
|
3943
|
+
# We need a separate thread to read from the pipe and allow the
|
|
3944
|
+
# write() to finish. This thread is started after the SIGALRM is
|
|
3945
|
+
# received (forcing a first EINTR in write()).
|
|
3946
|
+
read_results = []
|
|
3947
|
+
write_finished = False
|
|
3948
|
+
error = None
|
|
3949
|
+
def _read():
|
|
3950
|
+
try:
|
|
3951
|
+
while not write_finished:
|
|
3952
|
+
while r in select.select([r], [], [], 1.0)[0]:
|
|
3953
|
+
s = os.read(r, 1024)
|
|
3954
|
+
read_results.append(s)
|
|
3955
|
+
except BaseException as exc:
|
|
3956
|
+
nonlocal error
|
|
3957
|
+
error = exc
|
|
3958
|
+
t = threading.Thread(target=_read)
|
|
3959
|
+
t.daemon = True
|
|
3960
|
+
def alarm1(sig, frame):
|
|
3961
|
+
signal.signal(signal.SIGALRM, alarm2)
|
|
3962
|
+
signal.alarm(1)
|
|
3963
|
+
def alarm2(sig, frame):
|
|
3964
|
+
t.start()
|
|
3965
|
+
|
|
3966
|
+
large_data = item * N
|
|
3967
|
+
signal.signal(signal.SIGALRM, alarm1)
|
|
3968
|
+
try:
|
|
3969
|
+
wio = self.io.open(w, **fdopen_kwargs)
|
|
3970
|
+
signal.alarm(1)
|
|
3971
|
+
# Expected behaviour:
|
|
3972
|
+
# - first raw write() is partial (because of the limited pipe buffer
|
|
3973
|
+
# and the first alarm)
|
|
3974
|
+
# - second raw write() returns EINTR (because of the second alarm)
|
|
3975
|
+
# - subsequent write()s are successful (either partial or complete)
|
|
3976
|
+
written = wio.write(large_data)
|
|
3977
|
+
self.assertEqual(N, written)
|
|
3978
|
+
|
|
3979
|
+
wio.flush()
|
|
3980
|
+
write_finished = True
|
|
3981
|
+
t.join()
|
|
3982
|
+
|
|
3983
|
+
self.assertIsNone(error)
|
|
3984
|
+
self.assertEqual(N, sum(len(x) for x in read_results))
|
|
3985
|
+
finally:
|
|
3986
|
+
write_finished = True
|
|
3987
|
+
os.close(w)
|
|
3988
|
+
os.close(r)
|
|
3989
|
+
# This is deliberate. If we didn't close the file descriptor
|
|
3990
|
+
# before closing wio, wio would try to flush its internal
|
|
3991
|
+
# buffer, and could block (in case of failure).
|
|
3992
|
+
try:
|
|
3993
|
+
wio.close()
|
|
3994
|
+
except OSError as e:
|
|
3995
|
+
if e.errno != errno.EBADF:
|
|
3996
|
+
raise
|
|
3997
|
+
|
|
3998
|
+
def test_interrupted_write_retry_buffered(self):
|
|
3999
|
+
self.check_interrupted_write_retry(b"x", mode="wb")
|
|
4000
|
+
|
|
4001
|
+
def test_interrupted_write_retry_text(self):
|
|
4002
|
+
self.check_interrupted_write_retry("x", mode="w", encoding="latin1")
|
|
4003
|
+
|
|
4004
|
+
|
|
4005
|
+
class CSignalsTest(SignalsTest):
|
|
4006
|
+
io = io
|
|
4007
|
+
|
|
4008
|
+
class PySignalsTest(SignalsTest):
|
|
4009
|
+
io = pyio
|
|
4010
|
+
|
|
4011
|
+
# Handling reentrancy issues would slow down _pyio even more, so the
|
|
4012
|
+
# tests are disabled.
|
|
4013
|
+
test_reentrant_write_buffered = None
|
|
4014
|
+
test_reentrant_write_text = None
|
|
4015
|
+
|
|
4016
|
+
|
|
4017
|
+
def load_tests(*args):
|
|
4018
|
+
tests = (CIOTest, PyIOTest, APIMismatchTest,
|
|
4019
|
+
CBufferedReaderTest, PyBufferedReaderTest,
|
|
4020
|
+
CBufferedWriterTest, PyBufferedWriterTest,
|
|
4021
|
+
CBufferedRWPairTest, PyBufferedRWPairTest,
|
|
4022
|
+
CBufferedRandomTest, PyBufferedRandomTest,
|
|
4023
|
+
StatefulIncrementalDecoderTest,
|
|
4024
|
+
CIncrementalNewlineDecoderTest, PyIncrementalNewlineDecoderTest,
|
|
4025
|
+
CTextIOWrapperTest, PyTextIOWrapperTest,
|
|
4026
|
+
CMiscIOTest, PyMiscIOTest,
|
|
4027
|
+
CSignalsTest, PySignalsTest,
|
|
4028
|
+
)
|
|
4029
|
+
|
|
4030
|
+
# Put the namespaces of the IO module we are testing and some useful mock
|
|
4031
|
+
# classes in the __dict__ of each test.
|
|
4032
|
+
mocks = (MockRawIO, MisbehavedRawIO, MockFileIO, CloseFailureIO,
|
|
4033
|
+
MockNonBlockWriterIO, MockUnseekableIO, MockRawIOWithoutRead)
|
|
4034
|
+
all_members = io.__all__ + ["IncrementalNewlineDecoder"]
|
|
4035
|
+
c_io_ns = {name : getattr(io, name) for name in all_members}
|
|
4036
|
+
py_io_ns = {name : getattr(pyio, name) for name in all_members}
|
|
4037
|
+
globs = globals()
|
|
4038
|
+
c_io_ns.update((x.__name__, globs["C" + x.__name__]) for x in mocks)
|
|
4039
|
+
py_io_ns.update((x.__name__, globs["Py" + x.__name__]) for x in mocks)
|
|
4040
|
+
# Avoid turning open into a bound method.
|
|
4041
|
+
py_io_ns["open"] = pyio.OpenWrapper
|
|
4042
|
+
for test in tests:
|
|
4043
|
+
if test.__name__.startswith("C"):
|
|
4044
|
+
for name, obj in c_io_ns.items():
|
|
4045
|
+
setattr(test, name, obj)
|
|
4046
|
+
elif test.__name__.startswith("Py"):
|
|
4047
|
+
for name, obj in py_io_ns.items():
|
|
4048
|
+
setattr(test, name, obj)
|
|
4049
|
+
|
|
4050
|
+
suite = unittest.TestSuite([unittest.makeSuite(test) for test in tests])
|
|
4051
|
+
return suite
|
|
4052
|
+
|
|
4053
|
+
if __name__ == "__main__":
|
|
4054
|
+
unittest.main()
|