Commit Graph

4954 Commits

Author SHA1 Message Date
Hirokazu Yamamoto 264fc12fbf Issue #5385: Fixed mmap crash after resize failure on windows.
Now uses NULL instead of INVALID_HANDLE_VALUE as invalid map handle
because CreateFileMapping returns NULL when error occurs.
2009-03-05 14:21:12 +00:00
Hirokazu Yamamoto 8355155f22 Fixed memory leak. 2009-03-03 22:05:57 +00:00
Kristján Valur Jónsson 7705d0aaaf Fix SHA_new and MD5_new, that would crash if not given initial data 2009-03-03 03:20:42 +00:00
Mark Dickinson de28d6841e Issue #5393: typo in cmath.cos and cmath.cosh docstring 2009-02-28 15:50:40 +00:00
Hirokazu Yamamoto b0e10c760c Issue #1733986: Fixed mmap crash in accessing elements of second map object
with same tagname but larger size than first map. (Windows)
2009-02-28 12:13:07 +00:00
Hirokazu Yamamoto f2dc885780 Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer
overrun.
2009-02-28 10:31:54 +00:00
Benjamin Peterson 873389dbd8 fix compiler warnings 2009-02-21 23:09:33 +00:00
Mark Dickinson 3e4caeb3bf Issue #5341: Fix a variety of spelling errors. 2009-02-21 20:27:01 +00:00
Raymond Hettinger aa681c7b99 Fix keyword arguments for itertools.count().
Step arg without a start arg was ignored.
2009-02-21 07:17:22 +00:00
Raymond Hettinger 182edaefb5 Add keyword arg support to itertools.repeat(). 2009-02-19 02:38:25 +00:00
Raymond Hettinger 2e2909f584 Add keyword arg support to itertools.compress(). 2009-02-19 02:15:14 +00:00
Raymond Hettinger 08259e8f25 Py3k warnings now automatically include -Qwarn for division. 2009-02-18 23:10:19 +00:00
Hirokazu Yamamoto 17a837e4db Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0,
The file was resized to wrong size.
2009-02-17 13:17:26 +00:00
Hirokazu Yamamoto f6bbd0e71d Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. 2009-02-17 10:12:10 +00:00
Benjamin Peterson a7b0c12152 PyList_Append() can fail 2009-02-16 21:23:04 +00:00
Benjamin Peterson 062a7c3675 fix compiler warnings 2009-02-16 21:07:52 +00:00
Raymond Hettinger b21d8109af Add GC support to count() objects. Backport candidate. 2009-02-16 20:39:12 +00:00
Raymond Hettinger a4038038c6 Add keyword argument support to itertools.count(). 2009-02-14 00:25:51 +00:00
Georg Brandl 2c07929770 Fix warnings GCC emits where the argument of PyErr_Format is a single variable. 2009-02-13 11:10:04 +00:00
Gregory P. Smith ea38826ab2 - Issue #3745: Fix hashlib to always reject unicode and non buffer-api
supporting objects as input no matter how it was compiled (built in
  implementations or external openssl library).
(backported from a py3k branch)
2009-02-13 03:00:00 +00:00
Raymond Hettinger 66373ab888 Fix spaces/tabs in example. 2009-02-12 10:16:19 +00:00
Raymond Hettinger 31c769ca89 Issue 5032: added a step argument to itertools.count() and allowed non-integer arguments. 2009-02-12 05:39:46 +00:00
Gregory P. Smith 3605b5cee3 Issue #1008086: Fixes socket.inet_aton() to always return 4 bytes even
on LP64 platforms (most 64-bit Linux, bsd, unix systems).
2009-02-11 23:45:25 +00:00
Thomas Heller 3689ae256e Issue#5203: ctypes segfaults when passing a unicode string to a
function without argtypes, if HAVE_USABLE_WCHAR_T is false.
2009-02-10 18:43:01 +00:00
Mark Dickinson 4015f62e39 Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for
negative arguments.  Previously, it raised TypeError.

Thanks Lisandro Dalcin.
2009-02-10 15:46:50 +00:00
Kristján Valur Jónsson 6a743d3694 Issue 4804. Add a function to test the validity of file descriptors on Windows, and stop using global runtime settings to silence the warnings / assertions. 2009-02-10 13:32:24 +00:00
Guilherme Polo c5eba1e4f7 Enforcing Tk 8.3.1 requirement. 2009-02-09 20:57:45 +00:00
Guilherme Polo a66cf5bd04 Fixed issue #5122: Synchronize tk load failure check to prevent a
potential deadlock.
2009-02-09 20:50:27 +00:00
Raymond Hettinger 94034ea584 Issue 5171: itertools.product docstring missing 'repeat' argument 2009-02-09 18:39:41 +00:00
Nick Coghlan 0194f5bc98 Issue #4512 closeout: Make ZipImport.get_filename() a public method 2009-02-08 03:17:00 +00:00
Guilherme Polo 363161a418 Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will
not be used again (this requires Tcl/Tk 8.3.1), also fix a memory
leak in Tkapp_Call when calling from a thread different than the one that
created the Tcl interpreter.
2009-02-06 22:48:07 +00:00
Guilherme Polo 14ff18d211 Partial fix to issue #1731706: memory leak in Tkapp_Call when calling
from a thread different than the one that created the Tcl interpreter.
2009-02-06 22:26:22 +00:00
Kristján Valur Jónsson fd4c872726 issue 4804: Provide checks for the format string of strftime, and for the "mode" string of fopen on Windows. These strings are user provided from python and so we can avoid invoking the C runtime invalid parameter handler by first checking that they are valid. 2009-02-04 10:05:25 +00:00
Thomas Heller 7757d7bb51 This refactoring should make it easier to add new calling conventions.
Replace ffi_call_STDCALL and ffi_call_SYSV by a ffi_call_x86 function
that cleans up the stack when FFI_SYSV is used, and does nothing for
FFI_STDCALL.

Remove libffi_msvc\win32.S, which is out of date and also unused; it
was only used for building ctypes with the MingW compiler.
2009-02-03 17:07:40 +00:00
Guilherme Polo 23fe2a867b Fix for issue #1581476 2009-02-02 21:08:32 +00:00
Gregory P. Smith de1a8b720a - Issue #5104: The socket module now raises OverflowError when 16-bit port and
protocol numbers are supplied outside the allowed 0-65536 range on bind()
  and getservbyport().
2009-01-31 22:57:30 +00:00
Benjamin Peterson b3619be995 make _tkinter._flatten check the result of PySequence_Size for errors #3880 2009-01-30 02:24:39 +00:00
Raymond Hettinger e76816b146 Fix typo. 2009-01-29 03:43:44 +00:00
Raymond Hettinger 36d816b0ab Update itertools.__doc__ to include all tools. 2009-01-29 03:21:42 +00:00
Raymond Hettinger d081abc8be Promote combinations_with_replacement() from a recipe to a regular itertool. 2009-01-27 02:58:49 +00:00
Raymond Hettinger 354cfc1330 Fix signed/unsigned mismatch. 2009-01-26 16:52:22 +00:00
Raymond Hettinger 2bcb8e9b0d Promote compress() from a recipe to being a regular itertool. 2009-01-25 21:04:14 +00:00
Benjamin Peterson 78821ddf8c fix building the core with --disable-unicode
I changed some bytearray methods to use strings instead of unicode like bytes_repr
Also, bytearray.fromhex() can take strings as well as unicode
2009-01-25 17:15:10 +00:00
Mark Dickinson a3ecd2c668 Issue #1672332: Fix unpickling of subnormal floats, which was raising
ValueError on some platforms as a result of the platform strtod setting
errno on underflow.
2009-01-24 16:40:29 +00:00
Antoine Pitrou e741cc607c Issue #5008: When a file is opened in append mode with the new IO library,
do an explicit seek to the end of file (so that e.g. tell() returns the
file size rather than 0). This is consistent with the behaviour of the
traditional 2.x file object.
2009-01-21 00:45:36 +00:00
Benjamin Peterson 8024cece59 backport r68802 (bugfix) 2009-01-20 14:31:08 +00:00
Jesse Noller e8b619c152 issue 5002: fix windows warning that I intro'ed with r68768 2009-01-20 00:16:38 +00:00
Benjamin Peterson 943a6ddc72 simplify code 2009-01-19 15:51:27 +00:00
Jesse Noller 9a5b2ad38d Resolve issue 3321: (segfault) _multiprocessing.Connection() doesn't check handle 2009-01-19 15:12:22 +00:00
Kristján Valur Jónsson 2e659ce36f Issue 4957
Let os.ftruncate raise OSError like documented.
2009-01-19 13:10:27 +00:00
Benjamin Peterson 5848d1ff35 raise an OSError for invalid fds #4991 2009-01-19 00:08:08 +00:00
Amaury Forgeot d'Arc 59ce042766 #4077: No need to append \n when calling Py_FatalError
+ fix a declaration to make it match the one in pythonrun.h
2009-01-17 20:18:59 +00:00
Thomas Heller 3a6a0431d0 Fix refcount leak in error cases. Bug found by coverity. 2009-01-13 17:32:28 +00:00
Amaury Forgeot d'Arc a40d573664 #3720: Interpreter crashes when an evil iterator removes its own next function.
Now the slot is filled with a function that always raises.

Will not backport: extensions compiled with 2.6.x would not run on 2.6.0.
2009-01-12 23:36:55 +00:00
Antoine Pitrou b74fc2b5fe Issue #3860: GzipFile and BZ2File now support the context manager protocol. 2009-01-10 16:13:45 +00:00
Antoine Pitrou 4c5ecb7cbb Issue #4074: Change the criteria for doing a full garbage collection (i.e.
collecting the oldest generation) so that allocating lots of objects without
destroying them does not show quadratic performance. Based on a proposal by
Martin von Löwis at http://mail.python.org/pipermail/python-dev/2008-June/080579.html.
2009-01-09 21:40:55 +00:00
Kristján Valur Jónsson 0e2d8c36e3 Issue 4293: Make Py_AddPendingCall() thread safe
Add test cases and documentation
2009-01-09 21:35:16 +00:00
Jeffrey Yasskin d89f5b20b2 Fix issue 4884, preventing a crash in the socket code when python is compiled
with llvm-gcc and run with a glibc <2.10.
2009-01-09 16:47:07 +00:00
Benjamin Peterson f902a949c6 be more specific in -3 option help 2009-01-09 03:07:27 +00:00
Raymond Hettinger 5b913e31a1 Forward port r68394 for issue 4816. 2009-01-08 06:39:04 +00:00
Guilherme Polo e7f140355b The _tkinter module functions "createfilehandler", "deletefilehandler",
"createtimerhandler", "mainloop", "dooneevent" and "quit" have been
deprecated for removal in 3.x (part of issue #3638).
2009-01-03 21:51:09 +00:00
Martin v. Löwis 9ac4927125 Issue #4051: Prevent conflict of UNICODE macros in cPickle. 2009-01-02 20:40:14 +00:00
Amaury Forgeot d'Arc 57eb0e90c1 #4801 _collections module fails to build on cygwin.
_PyObject_GC_TRACK is the macro version of PyObject_GC_Track,
and according to documentation it should not be used for extension modules.
2009-01-02 00:03:54 +00:00
Hirokazu Yamamoto 99a1b20bbf Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open
file with `str' filename on Windows.
2009-01-01 15:45:39 +00:00
Antoine Pitrou aa687902f2 Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. 2009-01-01 14:11:22 +00:00
Georg Brandl 6269fec171 #4228: Pack negative values the same way as 2.4
in struct's L format.
2009-01-01 12:15:31 +00:00
Hirokazu Yamamoto 3cda1db67f Just inserted blank line. 2008-12-31 05:47:19 +00:00
Hirokazu Yamamoto 52c1e3cc08 Fixed compile error on windows. 2008-12-31 05:24:37 +00:00
Nick Coghlan 180e400766 Issue #4701: implicitly call PyType_Ready from PyObject_Hash 2008-12-30 01:18:48 +00:00
Martin v. Löwis 03824e45f6 Issue #1040026: Fix os.times result on systems where HZ is incorrect. 2008-12-29 18:17:34 +00:00
Benjamin Peterson 7af65568ff #4764 in io.open, set IOError.filename when trying to open a directory on POSIX platforms 2008-12-29 17:56:58 +00:00
Alexandre Vassalotti f852bf97ef Fix issue #4730: cPickle corrupts high-unicode strings.
Update outdated copy of PyUnicode_EncodeRawUnicodeEscape.
Add a test case.
2008-12-27 07:08:47 +00:00
Benjamin Peterson e098c4abe5 make global static 2008-12-23 20:12:33 +00:00
Benjamin Peterson b6a53b5c52 use a global variable, so the compiler doesn't optimize the assignment out 2008-12-23 20:09:28 +00:00
Benjamin Peterson 5423abd182 silence compiler warning 2008-12-22 22:12:19 +00:00
Benjamin Peterson 4caef5c7e2 fix #4720: the format to PyArg_ParseTupleAndKeywords can now start with '|' 2008-12-22 20:51:15 +00:00
Benjamin Peterson 9de7298102 remove redundant sentence 2008-12-20 22:49:24 +00:00
Benjamin Peterson fed67fd41e beef up docstring 2008-12-20 02:57:19 +00:00
Antoine Pitrou 73c0e65fc3 Issue #2467: gc.DEBUG_STATS reports invalid elapsed times.
Patch by Neil Schemenauer, very slightly modified.
2008-12-17 22:46:54 +00:00
Amaury Forgeot d'Arc 31949b9108 #3954: Fix error handling code in _hotshot.logreader
Will port to 2.6. hotshot was deleted from python 3.
2008-12-15 21:47:57 +00:00
Nick Coghlan a2053475bb Fix several issues relating to access to source code inside zipfiles. Initial work by Alexander Belopolsky. See Misc/NEWS in this checkin for details. 2008-12-14 10:54:50 +00:00
Mark Dickinson 4c96fa5525 Issues #3167, #3682: tests for math.log and math.log10 were failing on
Solaris and OpenBSD.  Fix this by handling special values and domain
errors directly in mathmodule.c, passing only positive nonspecial floats
to the system log/log10.
2008-12-11 19:28:08 +00:00
Skip Montanaro 45313fe6e0 issue 4483 - dbm build failures on systems with gdbm_compat lib. 2008-12-06 17:43:30 +00:00
Georg Brandl fe879e8a23 #4529: fix parser's validation for try-except-finally statements. 2008-12-05 12:09:41 +00:00
Christian Heimes dee3c9c606 Issue #4025 again
Converted a C99 style comment to a C89 style comment (found by MAL).
2008-12-03 00:53:18 +00:00
Jeremy Hylton 0d52182f67 Move definition int sval into branch of ifdef where it is used.
Otherwise, you get a warning about an undefined variable.
2008-11-28 23:42:59 +00:00
Matthias Klose 4de979153e - Modules/Setup.dist: Update _elementtree, add _bisect, datetime 2008-11-27 10:14:22 +00:00
Matthias Klose b0c3c026a0 - Modules/Setup.dist: Update pyexpat 2008-11-27 07:45:25 +00:00
Matthias Klose 7fab0dcdd4 - Modules/Setup.dist: Mention _elementtree and _pickle. 2008-11-26 17:32:49 +00:00
Benjamin Peterson 9dfe6a8862 #4396 make the parser module correctly validate the with syntax 2008-11-24 04:09:03 +00:00
Matthias Klose 75bfcbaf88 - Fix typo in last checkin 2008-11-23 13:54:42 +00:00
Matthias Klose 225d60c31e - Modules/Setup.dist: Mention _functools in section "Modules that should
always be present (non UNIX dependent)"
2008-11-23 13:37:03 +00:00
Benjamin Peterson bfc51567f5 backport r67325: make FileIO.mode always contain 'b' 2008-11-22 01:59:15 +00:00
Amaury Forgeot d'Arc 322656596a Fixed issue #4233.
Changed semantic of _fileio.FileIO's close()  method on file objects with closefd=False.
The file descriptor is still kept open but the file object behaves like a closed file.
The FileIO  object also got a new readonly attribute closefd.

Approved by Barry

Backport of r67106 from the py3k branch
2008-11-20 23:34:31 +00:00
Amaury Forgeot d'Arc 7cfe7ea745 #4317: Fix an Array Bounds Read in imageop.rgb2rgb8.
Will backport to 2.4.
2008-11-18 22:19:37 +00:00
Hirokazu Yamamoto ed29bb49f8 Issue #4071: ntpath.abspath returned an empty string for long unicode path. 2008-11-08 03:46:17 +00:00
Martin v. Löwis bb86d83134 Issue #4204: Fixed module build errors on FreeBSD 4. 2008-11-04 20:40:09 +00:00
Benjamin Peterson 6624a9fddd #4048 make the parser module accept relative imports as valid 2008-11-03 15:14:51 +00:00
Benjamin Peterson dcee09d920 make sure the parser flags and passed onto the compiler
This fixes "from __future__ import unicode_literals" in an exec statment
See #4225
2008-10-31 02:16:05 +00:00
Christian Heimes ab5f879022 Issue #4237: io.FileIO() was raising invalid warnings caused by insufficient initialization of PyFileIOObject struct members. 2008-10-30 21:26:15 +00:00