Commit graph

6574 commits

Author SHA1 Message Date
Nadeem Vawda
bc459bb484 Rename lzma.check_is_supported() to is_check_supported() to avoid grammatical confusion. 2012-05-06 23:01:51 +02:00
Nadeem Vawda
f55b329edc Add lzma.{encode,decode}_filter_properties(). 2012-05-06 23:01:27 +02:00
Nadeem Vawda
54c74ece28 Fix formatting of preset values for exception messages in _lzmamodule.c. 2012-05-06 13:35:47 +02:00
Benjamin Peterson
eaa5eeef57 Backed out changeset 709850f1ec67 2012-05-05 21:22:14 -04:00
Larry Hastings
cfe6f2af3c Update Misc/NEWS for issues #14127 and #14705. (And, technically, #10148.) 2012-05-05 17:39:09 -07:00
Larry Hastings
faf91e75ab Issue #14705: Add 'p' format character to PyArg_ParseTuple* for bool support. 2012-05-05 16:54:29 -07:00
Stefan Krah
6b03f2ce45 Fix typo in exception message. 2012-05-05 22:37:05 +02:00
Richard Oudkerk
fdb8dcf675 Fix for Issue 14725 for 3.3 branch. 2012-05-05 19:45:37 +01:00
Benjamin Peterson
fbd85a0fbf initialization not needed 2012-05-04 11:06:09 -04:00
Richard Oudkerk
f072b45e34 Fix for fatal errors in os.*utime*()
The address of an object was being decreffed instead of the object.
2012-05-04 12:01:31 +01:00
Larry Hastings
b333640aba Issue #14127: Fix two bugs with the Windows implementation. 2012-05-04 02:31:57 -07:00
Benjamin Peterson
9bd9d74996 what is a invalid tuple? 2012-05-04 01:42:41 -04:00
Benjamin Peterson
b399ab2c5c clean up converted path on error 2012-05-04 01:31:13 -04:00
Benjamin Peterson
3e2e368f3b avoid unitialized memory 2012-05-04 01:14:03 -04:00
Benjamin Peterson
35a8f0dee5 check correct variable for error 2012-05-04 01:10:59 -04:00
Larry Hastings
76ad59b7e8 Issue #14127: Add ns= parameter to utime, futimes, and lutimes.
Removed futimens as it is now redundant.
Changed shutil.copystat to use st_atime_ns and st_mtime_ns from os.stat
and ns= parameter to utime--it once again preserves exact metadata on Linux!
2012-05-03 00:30:07 -07:00
Benjamin Peterson
49a69e4d48 strip is_ prefixes on clock_info fields 2012-05-01 09:38:34 -04:00
Richard Oudkerk
3e268aac3b Mark multiprocessing files with "Licensed to PSF under a Contributor Agreement"
instead of BSD licence.
2012-04-30 12:13:55 +01:00
Mark Dickinson
57404891a0 Issue #14696: Merge from 3.2 2012-04-29 22:20:01 +01:00
Mark Dickinson
407b3bd89b Issue #14696: Fix parser module to understand 'nonlocal' declarations. 2012-04-29 22:18:31 +01:00
Mark Dickinson
b63fd2a408 Issue #9154: Merge fix from 3.2. 2012-04-29 18:35:56 +01:00
Mark Dickinson
ea7e9f9a83 Issue #9154: Fix parser module to understand function annotations. 2012-04-29 18:34:40 +01:00
Victor Stinner
ec89539ccc Issue #14428, #14397: Implement the PEP 418
* Rename time.steady() to time.monotonic()
 * On Windows, time.monotonic() uses GetTickCount/GetTickCount64() instead of
   QueryPerformanceCounter()
 * time.monotonic() uses CLOCK_HIGHRES if available
 * Add time.get_clock_info(), time.perf_counter() and time.process_time()
   functions
2012-04-29 02:41:27 +02:00
Brett Cannon
aa93642a35 Issue #14605: Use None in sys.path_importer_cache to represent no
finder instead of using some (now non-existent) implicit finder.
2012-04-27 15:30:58 -04:00
Brett Cannon
ce418b448f Issue #14605: Stop having implicit entries for sys.meta_path.
ImportWarning is raised if sys.meta_path is found to be empty.
2012-04-27 14:01:58 -04:00
Victor Stinner
8f825060f1 Check newly created consistency using _PyUnicode_CheckConsistency(str, 1)
* In debug mode, fill the string data with invalid characters
 * Simplify also reference counting in PyCodec_BackslashReplaceErrors()
   and PyCodec_XMLCharRefReplaceError()
2012-04-27 13:55:39 +02:00
Jesus Cea
990eff0776 Backing out 86dc014cdd74. Not ready yet 2012-04-26 17:05:31 +02:00
Jesus Cea
2b47f0a23f Close #10142: Support for SEEK_HOLE/SEEK_DATA 2012-04-26 16:39:35 +02:00
Antoine Pitrou
5438ed1572 Issue #4892: multiprocessing Connections can now be transferred over multiprocessing Connections.
Patch by Richard Oudkerk (sbt).
2012-04-24 22:56:57 +02:00
Jesus Cea
1d642d2af1 Closes Issue #14661: posix module: add O_EXEC, O_SEARCH, O_TTY_INIT (I add some Solaris constants too) 2012-04-24 20:59:17 +02:00
Jesus Cea
cf381206fc Issue #14661: posix module: add O_EXEC, O_SEARCH, O_TTY_INIT 2012-04-24 20:44:40 +02:00
Stefan Krah
9d3a5aeabe Defensive programming: mpd_isspecial(r) already implies mpd_isspecial(q), but
this is more readable.
2012-04-20 21:00:31 +02:00
Stefan Krah
3c23a87e58 The divmod function for large numbers now has an ACL2 proof. Related changes:
1) Rename _mpd_qbarrett_divmod into _mpd_base_ndivmod: The function is
     only marginally related to either Barrett's algorithm or to the version
     in Hasselstrom's paper.

  2) In places where the proof assumes exact operations, use new versions of
     add/sub/multiply that set NaN/Invalid_operation if this condition is
     not met. According to the proof this cannot happen, so this should be
     regarded as an extra safety net.

  3) Raise Division_impossible for operands with a number of digits greater
     than MPD_MAX_PREC. This facilitates the audit of the function and can
     practically only occur in the 32-bit version under conditions where
     a MemoryError is already imminent.

  4) Use _mpd_qmul() in places where the result can exceed MPD_MAX_PREC in
     a well defined manner.

  5) Test for mpd_isspecial(qq) in a place where the addition of one
     can theoretically trigger a Malloc_error.

  6) Remove redundant code in _mpd_qdivmod().

  7) Add many comments.
2012-04-20 19:59:20 +02:00
Larry Hastings
6fe20b3aee Issue #14127: Add st_{cma}time_ns fields to os.stat() result object. 2012-04-19 15:07:49 -07:00
Martin v. Löwis
aa2efcb0bc Issue #14098: New functions PyErr_GetExcInfo and PyErr_SetExcInfo.
Patch by Stefan Behnel.
2012-04-19 14:33:43 +02:00
Antoine Pitrou
23bba4ca39 Issue #11750: The Windows API functions scattered in the _subprocess and
_multiprocessing.win32 modules now live in a single module "_winapi".
Patch by sbt.
2012-04-18 20:51:15 +02:00
Stefan Krah
c51b7fd65b 1) Simplify comment -- one has to read the complete proof (available in ACL2)
in order to understand the algorithm anyway.

2) v->exp == -v->digits may be assumed.

3) Fix comment (v always shares data with a).
2012-04-18 19:27:32 +02:00
Stefan Krah
5d0d2e2b04 Explain the strategy to avoid huge alignment shifts in _mpd_qadd() in detail. 2012-04-18 18:59:56 +02:00
Stefan Krah
ed4b21ff4f Cosmetic change: initialize digits to 1 (redundant). 2012-04-18 18:45:22 +02:00
Stefan Krah
bc771e9b19 Remove redundant finalization of the result. 2012-04-18 18:25:37 +02:00
Stefan Krah
aecaf0b663 Fix comments and whitespace. 2012-04-18 18:08:20 +02:00
Stefan Krah
6369f77d20 Support mythical ones' complement machines. 2012-04-18 17:57:56 +02:00
Stefan Krah
140893cbaa The previous code is correct, but hard to verify: The libmpdec documentation
rightfully states that an mpd_t with a coefficient flagged as MPD_CONST_DATA
must not be in the position of the result operand. In this particular case
several assumptions guarantee that a resize will never occur in all possible
code paths, which was the reason for using MPD_CONST_DATA and saving an
instruction by omitting the initialization of tmp.alloc.

For readability, tmp is now flagged as MPD_STATIC_DATA and tmp.alloc
is initialized.
2012-04-18 17:48:34 +02:00
Antoine Pitrou
a3f4457b17 Speed up reading of small files. This avoids multiple C read() calls on pyc files. 2012-04-17 13:50:58 +02:00
Brett Cannon
6f44d66bc4 Issue #13959: Rename imp to _imp and add Lib/imp.py and begin
rewriting functionality in pure Python.

To start, imp.new_module() has been rewritten in pure Python, put into
importlib (privately) and then publicly exposed in imp.
2012-04-15 16:08:47 -04:00
Mark Dickinson
da4210f77d Issue #13496: Merge from 3.2 2012-04-15 16:32:04 +01:00
Mark Dickinson
a13b109bc0 Issue 13496: Fix bisect.bisect overflow bug for large collections. 2012-04-15 16:30:35 +01:00
Kristján Valur Jónsson
69c635266e Issue #10576: Add a progress callback to gcmodule 2012-04-15 11:41:32 +00:00
Victor Stinner
b8d016955a Fix clock_gettime/getres/settime: PyArg_ParseTuple() expects an int
Only use a single #ifdef for the 3 functions.
2012-04-13 23:44:05 +02:00
Stefan Krah
ec766a6179 1) Remove claim of an input invariant that is only true for static mpd_t.
Resizing is used _inside_ libmpdec functions, and it is permitted to
   change x->alloc several times while setting x->len at the end of the
   function. Therefore, for dynamic mpd_t x->alloc can _temporarily_ drop
   below x->len. Of course the final result always has x->len <= x->alloc.

   For static mpd_t this cannot happen, since resizing to a smaller
   coefficient is a no-op.

2) Remove micro optimization in mpd_switch_to_dyn(): Previously only the
   valid initialized part of the existing coefficient up to x->len was
   copied to the new dynamic memory area. Now copying does the same as
   realloc() and the entire old memory area is copied.

   The rationale for this change is that it is no longer needed to memorize
   the explanation given in 1).
2012-04-10 23:11:54 +02:00