Eugene Kapun abacabadabac...@gmail.com added the comment:
Actually, this can't be fixed without modifying C API methods PyArg_ParseTuple
and PyArg_ParseTupleAndKeywords, because it's possible to make an object
deallocated before PyArg_ParseTuple returns, so Py_INCREF immediately after
parsing
Changes by Eugene Kapun abacabadabac...@gmail.com:
Added file: http://bugs.python.org/file19617/test-ctypes.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6083
Changes by Eugene Kapun abacabadabac...@gmail.com:
Added file: http://bugs.python.org/file19618/test-functools.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6083
Eugene Kapun abacabadabac...@gmail.com added the comment:
This patch still assumes that if so-table didn't change then the table wasn't
reallocated (see http://en.wikipedia.org/wiki/ABA_problem). One solution is to
check that so-mask didn't change as well. Also, checking that refcnt 1
Eugene Kapun abacabadabac...@gmail.com added the comment:
One solution is to check that so-mask didn't
change as well.
I saw that and agree it would make a tighter check, but haven't convinced
myself that it is necessary.
Without this check, it is possible that the comparison shrinks
Eugene Kapun abacabadabac...@gmail.com added the comment:
This code crashes python by using another bug in set_repr. This only affects
py3k. This code relies on out-of-memory condition, so run it like:
$ (ulimit -v 65536 python3 test.py)
Otherwise, it will eat all your free memory before
Changes by Eugene Kapun abacabadabac...@gmail.com:
Added file: http://bugs.python.org/file16981/repr.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8420
Eugene Kapun abacabadabac...@gmail.com added the comment:
-1 on special-casing string without an encoding. Current code does (almost)
this:
...
if argument_is_a_string:
if not encoding_is_given: # Special case
raise TypeError(string argument without an encoding
Eugene Kapun abacabadabac...@gmail.com added the comment:
I've found more unsafe code in Objects/setobject.c.
This code makes Python 3.1.2 segfault by using a bug in function set_merge:
class bad:
def __eq__(self, other):
if be_bad:
set2.clear
New submission from Eugene Kapun abacabadabac...@gmail.com:
This code shows that frozensets aren't really immutable. The same frozenset is
printed twice, with different content. Buggy functions are set_contains,
set_remove and set_discard, all in Objects/setobject.c
class bad:
def
Changes by Eugene Kapun abacabadabac...@gmail.com:
--
type: - crash
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8420
___
___
Python-bugs-list
New submission from Eugene Kapun abacabadabac...@gmail.com:
list().__init__(a=0)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: 'a' is an invalid keyword argument for this function
set().__init__(a=0)
--
components: Interpreter Core
messages: 103427
nosy
Eugene Kapun abacabadabac...@gmail.com added the comment:
Empty string is an iterable of integers in the range 0 = x 256, so it should
be allowed.
all(isinstance(x, int) and 0 = x 256 for x in )
True
bytearray()[:] =
Traceback (most recent call last):
File stdin, line 1, in module
New submission from Eugene Kapun abacabadabac...@gmail.com:
bytes(10)
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
bytes(10 ** 100)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: 'int' object is not iterable
--
components: Interpreter Core
messages
Changes by Eugene Kapun abacabadabac...@gmail.com:
--
nosy: +abacabadabacaba
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1766304
___
___
Python
Eugene Kapun abacabadabac...@gmail.com added the comment:
Not really, chars are not ints
Yes, however, empty string contains exactly zero chars.
and anyway the empty string fall in the first case.
Strings aren't mentioned in documentation of bytearray slice assignment.
However, I think
Eugene Kapun abacabadabac...@gmail.com added the comment:
__doc__ of bytearray says:
bytearray(iterable_of_ints) - bytearray
bytearray(string, encoding[, errors]) - bytearray
bytearray(bytes_or_bytearray) - mutable copy of bytes_or_bytearray
bytearray(memory_view) - bytearray
So, unless
New submission from Eugene Kapun abacabadabac...@gmail.com:
small_set = set(range(2000))
large_set = set(range(2000))
large_set -= small_set # Fast
small_set -= large_set # Slow, should be fast
small_set = small_set - large_set # Fast
--
components: Interpreter Core
messages
New submission from Eugene Kapun abacabadabac...@gmail.com:
a = bytearray()
a[:] = 0 # Is it a feature?
a
bytearray(b'')
a[:] = 10 # If so, why not document it?
a
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
a[:] = -1
Traceback (most recent call last):
File stdin, line 1
19 matches
Mail list logo