cpython/Modules
Neil Schemenauer e38d12ed34 bpo-17852: Maintain a list of BufferedWriter objects. Flush them on exit. (#1908)
* Maintain a list of BufferedWriter objects.  Flush them on exit.

In Python 3, the buffer and the underlying file object are separate
and so the order in which objects are finalized matters.  This is
unlike Python 2 where the file and buffer were a single object and
finalization was done for both at the same time.  In Python 3, if
the file is finalized and closed before the buffer then the data in
the buffer is lost.

This change adds a doubly linked list of open file buffers.  An atexit
hook ensures they are flushed before proceeding with interpreter
shutdown.  This is addition does not remove the need to properly close
files as there are other reasons why buffered data could get lost during
finalization.

Initial patch by Armin Rigo.

* Use weakref.WeakSet instead of WeakKeyDictionary.

* Simplify buffered double-linked list types.

* In _flush_all_writers(), suppress errors from flush().

* Remove NEWS entry, use blurb.
2017-09-04 20:18:38 -07:00
..
_blake2 Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever 2017-01-23 09:47:21 +02:00
_ctypes bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (#31) 2017-08-28 14:08:49 +02:00
_decimal bpo-30923: Disable warning that has been part of -Wextra since gcc-7.0. (#3142) 2017-08-18 21:39:32 +02:00
_io bpo-17852: Maintain a list of BufferedWriter objects. Flush them on exit. (#1908) 2017-09-04 20:18:38 -07:00
_multiprocessing bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051) 2017-04-16 10:46:38 +03:00
_sha3 bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955) 2017-07-03 21:20:15 +03:00
_sqlite bpo-30592: Fixed error messages for some builtins. (#1996) 2017-06-08 14:41:19 +03:00
cjkcodecs bpo-31275: Small refactoring to silence a fall-through warning. (#3206) 2017-08-25 18:31:22 +02:00
clinic Regen Moduls/clinic/_ssl.c.h (GH-3320) 2017-09-04 15:45:18 -07:00
expat bpo-31170: Update libexpat from 2.2.3 to 2.2.4 (#3315) 2017-09-05 01:58:08 +02:00
zlib - Issue #29169: Update zlib to 1.2.10. 2017-01-31 13:49:48 +01:00
_asynciomodule.c bpo-31185: Fixed miscellaneous errors in asyncio speedup module. (#3076) 2017-09-03 08:10:14 +03:00
_bisectmodule.c Issue #28792: Remove aliases from _bisect 2016-11-24 23:31:59 +01:00
_bz2module.c bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051) 2017-04-16 10:46:38 +03:00
_codecsmodule.c bpo-24037: Add Argument Clinic converter bool(accept={int}). (#485) 2017-03-12 10:10:47 +02:00
_collectionsmodule.c Code clean-up. Remove unnecessary pre-increment before the loop starts. (#3312) 2017-09-04 16:07:06 -07:00
_cryptmodule.c Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 17:35:15 +03:00
_csv.c Use NULL rather than 0. (#778) 2017-03-23 17:53:47 +02:00
_curses_panel.c Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever 2017-01-23 09:47:21 +02:00
_cursesmodule.c [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302) 2017-06-28 08:30:06 +03:00
_datetimemodule.c Closes issue bpo-5288: Allow tzinfo objects with sub-minute offsets. (#2896) 2017-07-31 10:26:50 -04:00
_dbmmodule.c bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051) 2017-04-16 10:46:38 +03:00
_elementtree.c bpo-31095: fix potential crash during GC (GH-2974) 2017-08-24 14:55:17 +09:00
_functoolsmodule.c bpo-31095: fix potential crash during GC (GH-2974) 2017-08-24 14:55:17 +09:00
_gdbmmodule.c bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051) 2017-04-16 10:46:38 +03:00
_hashopenssl.c Remove _PyArg_NoStackKeywords(). (#2641) 2017-07-10 10:25:34 +02:00
_heapqmodule.c Issue #15984: Merge PyUnicode doc from 3.5 2016-04-15 02:27:11 +00:00
_json.c bpo-31095: fix potential crash during GC (GH-2974) 2017-08-24 14:55:17 +09:00
_localemodule.c [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302) 2017-06-28 08:30:06 +03:00
_lsprof.c Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever 2017-01-23 09:47:21 +02:00
_lzmamodule.c Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
_math.c Issue #28256: Cleanup _math.c 2016-10-18 16:29:27 +02:00
_math.h Issue #28256: Cleanup _math.c 2016-10-18 16:29:27 +02:00
_opcode.c Issue #27332: Fixed the type of the first argument of module-level functions 2016-07-07 17:35:15 +03:00
_operator.c bpo-30592: Fixed error messages for some builtins. (#1996) 2017-06-08 14:41:19 +03:00
_pickle.c bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638) 2017-09-04 17:54:09 -06:00
_posixsubprocess.c bpo-16500: Don't use string constants for os.register_at_fork() behavior (#1834) 2017-05-29 10:03:41 -07:00
_randommodule.c bpo-30592: Fixed error messages for some builtins. (#1996) 2017-06-08 14:41:19 +03:00
_scproxy.c Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever 2017-01-23 09:47:21 +02:00
_sre.c bpo-30285: Optimize case-insensitive matching and searching (#1482) 2017-05-09 23:37:14 +03:00
_ssl.c bpo-30502: Fix handling of long oids in ssl. (#2909) 2017-09-05 00:28:53 +02:00
_ssl_data.h
_stat.c
_struct.c bpo-31095: fix potential crash during GC (GH-2974) 2017-08-24 14:55:17 +09:00
_testbuffer.c Expand the PySlice_GetIndicesEx macro. (#1023) 2017-04-08 09:53:51 +03:00
_testcapimodule.c bpo-31243: Fixed PyArg_ParseTuple failure checks. (#3171) 2017-08-29 11:58:27 +03:00
_testimportmultiple.c
_testmultiphase.c Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever 2017-01-23 09:47:21 +02:00
_threadmodule.c bpo-6532: Make the thread id an unsigned integer. (#781) 2017-03-23 14:48:39 +01:00
_tkinter.c Use NULL rather than 0. (#778) 2017-03-23 17:53:47 +02:00
_tracemalloc.c bpo-31018: Switch to #pragma pack from __declspec(align) (#2848) 2017-07-25 10:47:43 +02:00
_weakref.c Issue #28427: old keys should not remove new values from 2016-12-27 14:19:20 +01:00
_winapi.c bpo-30745: Fix compiler warnings introduced in bpo-30730. (#2376) 2017-06-24 16:14:08 +03:00
addrinfo.h replace PY_LONG_LONG with long long 2016-09-06 10:46:49 -07:00
arraymodule.c bpo-24700: Add a fast path for comparing array.array of equal type (#3009) 2017-08-17 14:46:06 +02:00
atexitmodule.c bpo-28994: Fixed errors handling in atexit._run_exitfuncs(). (#2034) 2017-06-12 08:25:04 +03:00
audioop.c bpo-28261: Fixed err msgs where PyArg_ParseTuple is used to parse normal tuples. (#3119) 2017-08-20 18:35:36 +03:00
binascii.c bpo-9566: Fix some Windows x64 compiler warnings (#2492) 2017-07-26 15:17:57 -07:00
cmathmodule.c Issue 23229: add cmath.inf, cmath.nan, cmath.infj and cmath.nanj. 2016-08-29 13:56:58 +01:00
config.c.in
errnomodule.c
faulthandler.c bpo-30557: faulthandler now correctly filters and displays exception codes on Windows (#1924) 2017-06-05 15:54:15 -07:00
fcntlmodule.c bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051) 2017-04-16 10:46:38 +03:00
fpectlmodule.c remove IRIX support (closes bpo-31341) (#3310) 2017-09-04 16:36:05 -07:00
fpetestmodule.c Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever 2017-01-23 09:47:21 +02:00
gc_weakref.txt
gcmodule.c Issue #20185: Converted the gc module to Argument Clinic. 2017-02-04 11:19:59 +02:00
getaddrinfo.c Issue #26505: merge from 3.5 2016-03-07 14:52:46 -05:00
getbuildinfo.c bpo-27593: Get SCM build info from git instead of hg. (#446) 2017-03-04 00:19:55 -05:00
getnameinfo.c
getpath.c Issue #19398: Extra slash no longer added to sys.path components in case of 2016-11-11 12:06:38 +02:00
grpmodule.c [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302) 2017-06-28 08:30:06 +03:00
hashlib.h Issue #26798: Add BLAKE2 (blake2b and blake2s) to hashlib. 2016-09-06 22:03:25 +02:00
hashtable.c Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy(). 2016-09-13 20:22:02 +02:00
hashtable.h Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy(). 2016-09-13 20:22:02 +02:00
itertoolsmodule.c bpo-30592: Fixed error messages for some builtins. (#1996) 2017-06-08 14:41:19 +03:00
ld_so_aix.in Issue #10656: Fix out-of-tree building on AIX 2016-11-20 07:56:37 +00:00
main.c bpo-30565: Add PYTHONCOERCECLOCALE=warn runtime flag (GH-2260) 2017-06-18 12:29:42 +10:00
makesetup bpo-20210: Support the *disabled* marker in Setup files (GH-132) 2017-05-27 18:25:03 +02:00
makexp_aix
mathmodule.c bpo-29962: add math.remainder (#950) 2017-04-05 18:34:27 +01:00
md5module.c Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever 2017-01-23 09:47:21 +02:00
mmapmodule.c Expand the PySlice_GetIndicesEx macro. (#1023) 2017-04-08 09:53:51 +03:00
nismodule.c [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302) 2017-06-28 08:30:06 +03:00
ossaudiodev.c bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051) 2017-04-16 10:46:38 +03:00
overlapped.c bpo-28261: Fixed err msgs where PyArg_ParseTuple is used to parse normal tuples. (#3119) 2017-08-20 18:35:36 +03:00
parsermodule.c bpo-30070: Fixed leaks and crashes in errors handling in the parser module. (#1131) 2017-04-19 21:09:21 +03:00
posixmodule.c bpo-30581: Windows: os.cpu_count() returns wrong number of processors (#2934) 2017-08-30 11:01:08 +02:00
posixmodule.h
pwdmodule.c [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302) 2017-06-28 08:30:06 +03:00
pyexpat.c bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638) 2017-09-04 17:54:09 -06:00
readline.c bpo-30946: Remove obsolete fallback code in readline module (#2738) 2017-07-18 17:05:03 +02:00
README
resource.c bpo-20185: Convert the resource moduel to Argument Clinic. (#545) 2017-03-12 13:08:30 +02:00
rotatingtree.c
rotatingtree.h
selectmodule.c bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096) 2017-04-19 20:03:52 +03:00
Setup.config.in remove --with(out)-signal-module, since the signal module is non-optional 2016-09-09 12:01:10 -07:00
Setup.dist remove IRIX support (closes bpo-31341) (#3310) 2017-09-04 16:36:05 -07:00
sha1module.c Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever 2017-01-23 09:47:21 +02:00
sha256module.c Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever 2017-01-23 09:47:21 +02:00
sha512module.c Removed redundant Argument Clinic directives. 2017-02-04 11:53:22 +02:00
signalmodule.c bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state (#2417) 2017-07-17 12:25:19 +02:00
socketmodule.c remove IRIX support (closes bpo-31341) (#3310) 2017-09-04 16:36:05 -07:00
socketmodule.h Add sockaddr_alg to sock_addr_t (#234) 2017-02-22 12:12:00 +01:00
spwdmodule.c [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302) 2017-06-28 08:30:06 +03:00
sre.h Issue #28765: _sre.compile() now checks the type of groupindex and indexgroup 2016-11-22 23:04:39 +01:00
sre_constants.h bpo-30215: Make re.compile() locale agnostic. (#1361) 2017-05-05 08:53:40 +03:00
sre_lib.h bpo-30215: Make re.compile() locale agnostic. (#1361) 2017-05-05 08:53:40 +03:00
symtablemodule.c Issue #20186: Converted the symtable module to Argument Clinic. 2017-02-04 12:13:20 +02:00
syslogmodule.c Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever 2017-01-23 09:47:21 +02:00
termios.c Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever 2017-01-23 09:47:21 +02:00
testcapi_long.h
timemodule.c bpo-28261: Fixed err msgs where PyArg_ParseTuple is used to parse normal tuples. (#3119) 2017-08-20 18:35:36 +03:00
tkappinit.c
tkinter.h
unicodedata.c bpo-30736: upgrade to Unicode 10.0 (#2344) 2017-06-22 22:31:08 -07:00
unicodedata_db.h bpo-30736: upgrade to Unicode 10.0 (#2344) 2017-06-22 22:31:08 -07:00
unicodename_db.h bpo-30736: upgrade to Unicode 10.0 (#2344) 2017-06-22 22:31:08 -07:00
winreparse.h Issue #17599: Use unique _Py_REPARSE_DATA_BUFFER etc names to avoid conflict 2016-08-04 02:38:59 +00:00
xxlimited.c merge 3.5 (#29398) 2017-01-31 23:31:10 -08:00
xxmodule.c Issue #25923: Added more const qualifiers to signatures of static and private functions. 2015-12-25 20:01:53 +02:00
xxsubtype.c
zipimport.c bpo-31291: Fixed an assertion failure in zipimport.zipimporter.get_data() (#3226) 2017-08-29 20:40:15 +03:00
zlibmodule.c bpo-9566: Fix some Windows x64 compiler warnings (#2492) 2017-07-26 15:17:57 -07:00

Source files for standard library extension modules,
and former extension modules that are now builtin modules.