| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
module.
Also clean up related tests in test_struct.
The stacklevel fix should be backported to 2.6 once that branch is unfrozen.
|
| |
|
|
|
|
| |
mistake. ( It may come in for sure tough)
|
|
|
|
| |
Patch by flox
|
|
|
|
| |
make sure that out-of-range values consistently raise struct.error.
|
|
|
|
| |
reorganize the test_struct module to remove duplicated code and tests.
|
| |
|
|
|
|
| |
integer packing, and reenable some previously broken tests.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
tuples, dicts and sets on failure.
Many new handy type and comparison specific assert* methods have been added
that fail with error messages actually useful for debugging. Contributed in
by Google and completed with help from mfoord and GvR at PyCon 2009 sprints.
Discussion lives in http://bugs.python.org/issue2578.
|
| |
|
|
|
|
|
|
| |
negative arguments. Previously, it raised TypeError.
Thanks Lisandro Dalcin.
|
|
|
|
| |
in struct's L format.
|
|
|
|
|
|
|
|
| |
WarningsRecorder object. This makes the API simpler to use as no special object
must be learned.
Closes issue 3781.
Review by Benjamin Peterson.
|
| |
|
|
|
|
| |
python-dev. Also add explicit tests for itto test_warnings.
|
|
|
|
| |
buildbot.
|
|
|
|
|
|
| |
Added checks for integer overflows, contributed by Google. Some are
only available if asserts are left in the code, in cases where they
can't be triggered from Python code.
|
|
|
|
|
| |
I had to disable one test because it was functioning incorrectly, see #1530559
I also removed the debugging prints
|
|
|
|
|
|
|
|
|
|
| |
across platforms: it should now raise OverflowError on all
platforms. (Previously it raised OverflowError only on
non IEEE 754 platforms.)
Also fix the (already existing) test for this behaviour
so that it actually raises TestFailed instead of just
referencing it.
|
|
|
|
| |
compatibility with PEP3118.
|
|
|
|
|
|
|
|
| |
test.test_support.catch_warning is more full-featured and provides the same
functionality.
Since guard_warnings_filter was added in 2.6 there is no
backwards-compatibility issues.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
manager that protects warnings.filter from being modified once the context is
exited.
|
|
|
|
|
| |
Passing float arguments to struct.pack when integers are expected
now triggers a DeprecationWarning.
|
|
|
|
|
|
|
|
|
|
| |
string_reverse(): Simplify.
assertRaises(): Raise TestFailed on failure.
test_unpack_from(), test_pack_into(), test_pack_into_fn(): never
use `assert` to test for an expected result (it doesn't test anything
when Python is run with -O).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Following Guido's comments, renamed
* pack_to -> pack_into
* recv_buf -> recv_into
* recvfrom_buf -> recvfrom_into
- Made fixes to _struct.c according to Neal Norwitz comments on the checkins
list.
- Converted some ints into the appropriate -- I hope -- ssize_t and size_t.
|
| |
|
| |
|
|
|
|
| |
since the deprecation warning wouldn't be raised.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
are run in the order:
test_genexps (or any other doctest-based test)
test_struct
test_doctest
The `warnings` module needs an advertised way to save/restore
its internal filter list.
|
|
|
|
| |
compatibility with older struct usage (ugly)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer
protocol (send and sendto already did).
* Added struct.pack_to(), that is the corresponding buffer compatible method to
unpack_from().
* Fixed minor typos in arraymodule.
|
| |
|
| |
|
|
|
|
| |
From SF patch #852334.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pack_float, pack_double, save_float: All the routines for creating
IEEE-format packed representations of floats and doubles simply ignored
that rounding can (in rare cases) propagate out of a long string of
1 bits. At worst, the end-off carry can (by mistake) interfere with
the exponent value, and then unpacking yields a result wrong by a factor
of 2. In less severe cases, it can end up losing more low-order bits
than intended, or fail to catch overflow *caused* by rounding.
Bugfix candidate, but I already backported this to 2.2.
In 2.3, this code remains in severe need of refactoring.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
imports e.g. test_support must do so using an absolute package name
such as "import test.test_support" or "from test import test_support".
This also updates the README in Lib/test, and gets rid of the
duplicate data dirctory in Lib/test/data (replaced by
Lib/email/test/data).
Now Tim and Jack can have at it. :)
|
|
|
|
|
| |
and count exceed 255. Changed to preserve as much of the string as
possible (instead of count%256 characters).
|
|
|
|
|
| |
check correctly on pack(). While these were checking OK on my 32-bit box,
Mark Favas reported failures on a 64-bit box (alas, easy to believe).
|
|
|
|
|
|
|
|
| |
Unfortunately, the std-mode bBhHIL codes don't do any range-checking; if
and when some of those get fixed, remove their letters from the
IntTester.BUGGY_RANGE_CHECK string. In the meantime, a msg saying that
range-tests are getting skipped is printed to stdout whenever one is
skipped.
|
|
|
|
| |
Repaired that, and added appropriate tests for it to test_struct.py.
|