[issue23974] random.randrange() biased output
Mark Dickinson added the comment: See also #9025, which contains a fix for this exact problem in Python 3. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23974 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23986] Inaccuracy about in keyword for list and tuple
New submission from wim glenn: The comparisons section of the python 2 docs says: --- https://docs.python.org/2/reference/expressions.html#comparisons For the list and tuple types, x in y is true if and only if there exists an index i such that x == y[i] is true. --- But it's not strictly speaking correct. Simplest counter-example: x = float('nan') y = [x] The python 3 docs instead mention correct equivalent which is any(x is e or x == e for e in y) -- assignee: docs@python components: Documentation messages: 241317 nosy: docs@python, wim.glenn priority: normal severity: normal status: open title: Inaccuracy about in keyword for list and tuple type: enhancement versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23986 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23985] Crash when deleting slices from duplicated bytearray
New submission from Johan Dahlberg: Python 3.4.3 crashes after some time when running the attached program under Windows 7. The program appends a fixed bytes string to two independent bytearray buffers. If slices are removed from the beginnging of the two buffers and the two buffers are print:ed, the program will crash at some random occation. -- components: Windows files: bytearray_bug.py messages: 241316 nosy: johan, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Crash when deleting slices from duplicated bytearray type: crash versions: Python 3.4 Added file: http://bugs.python.org/file39086/bytearray_bug.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23985 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23980] Documentation for format units starting with 'e' is inconsistent
Marc-Andre Lemburg added the comment: On 17.04.2015 05:50, Larry Hastings wrote: Larry Hastings added the comment: The e variants (typically) allocate a buffer for you, since it's pretty much unknown how long the encoded data will be. All four will do it if you pass in a NULL pointer. es# and et# can reuse an existing buffer, because you can also pass in its size. Right. So I guess the e descriptions need to have the additional * removed or the paragraph has to be updated and all other listings need to be converted to precise types (that would be my preference). Here's the problem with removing the additional *. The first argument to encoding is a static string. You literally pass in the char * string, not a pointer to a variable containing the address of the string. e.g. PyArg_ParseTuple(es, args, utf-8, buffer); So how do we annotate that? [char, char *]? A literal static string is really a pointer as well. The compiler will allocate and initialize the string and then provide a pointer to reference it. It is also possible to pass in the pointer directly - it just needs to be a const char *, i.e. one who's target value doesn't change. So for es this would have to be [const char, char *], but I like your idea more: [ const char *, char **] I wonder why no one has noticed in all these years. Because nobody ever freaking uses the e format units. But by golly I'm going to see that the docs are right and Clinic supports them correctly--or die trying. It's not used much, but there are a few cases in the posixmodule and the Mac modules of the Python 2.7 stdlib, as well as in extension modules, of course. The Python 3.4 stdlib does not seem to use them anymore (the uses were replaced with custom solutions or the modules removed). I guess people never found out about those parser markers or simply always fetch Unicode as object rather than as encoded string. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23980 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23985] Crash when deleting slices from duplicated bytearray
Ned Deily added the comment: Reproduced with top of trunk default branch on OS X (so, not Windows-specific). With debug enabled: $ ./bin/python3.5 /tmp/b/bytearray_bug.py buf2: 13 5 bytearray(b'1234567890123') buf1: 13 3 bytearray(b'1234567890123') buf2: 21 2 bytearray(b'678901231234567890123') buf1: 23 5 bytearray(b'45678901231234567890123') buf2: 32 28 bytearray(b'89012312345678901231234567890123') buf1: 31 21 bytearray(b'9012312345678901231234567890123') buf2: 17 10 bytearray(b'01231234567890123') buf1: 23 9 bytearray(b'45678901231234567890123') buf2: 20 3 bytearray(b'78901231234567890123') buf1: 27 14 bytearray(b'312345678901231234567890123') buf2: 30 22 bytearray(b'012312345678901231234567890123') buf1: 26 17 bytearray(b'12345678901231234567890123') buf2: 21 1 bytearray(b'678901231234567890123') buf1: 22 12 bytearray(b'5678901231234567890123') buf2: 33 13 bytearray(b'789012312345678901231234567890123') buf1: 23 4 bytearray(b'45678901231234567890123') buf2: 33 23 bytearray(b'789012312345678901231234567890123') buf1: 32 4 bytearray(b'89012312345678901231234567890123') buf2: 23 19 bytearray(b'45678901231234567890123') buf1: 41 36 bytearray(b'23123456789012312345678901231234567890123') buf2: 17 3 bytearray(b'01231234567890123') buf1: 18 3 bytearray(b'901231234567890123') buf2: 27 23 bytearray(b'312345678901231234567890123') buf1: 28 22 bytearray(b'2312345678901231234567890123') buf2: 17 2 bytearray(b'01231234567890123') buf1: 19 5 bytearray(b'8901231234567890123') buf2: 28 10 bytearray(b'2312345678901231234567890123') buf1: 27 2 bytearray(b'312345678901231234567890123') buf2: 31 7 bytearray(b'9012312345678901231234567890123') buf1: 38 2 bytearray(b'23456789012312345678901231234567890123') buf2: 37 23 bytearray(b'3456789012312345678901231234567890123') buf1: 49 2 bytearray(b'4567890123123456789012312345678901231234567890123') buf2: 27 21 bytearray(b'312345678901231234567890123') buf1: 60 1 bytearray(b'678901231234567890123123456789012312345678901231234567890123') Debug memory block at address p=0x10bd238e0: API 'o' 61 bytes originally requested The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected. The 8 pad bytes at tail=0x10bd2391d are not all FORBIDDENBYTE (0xfb): at tail+0: 0x33 *** OUCH at tail+1: 0x00 *** OUCH at tail+2: 0xfb at tail+3: 0xfb at tail+4: 0xfb at tail+5: 0xfb at tail+6: 0xfb at tail+7: 0xfb The block was made by call #44842 to debug malloc/realloc. Data at p: 34 35 36 37 38 39 30 31 ... 35 36 37 38 39 30 31 32 Fatal Python error: bad trailing pad byte Current thread 0x7fff70e18300 (most recent call first): File /tmp/b/bytearray_bug.py, line 25 in module Abort trap: 6 -- components: +Interpreter Core -Windows nosy: +ned.deily stage: - needs patch versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23985 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23974] random.randrange() biased output
Mark Dickinson added the comment: In the #9025 discussion, reproducibility was a key concern. Though I note that despite the comments there, we *still* have no documented guarantees of reproducibility, so maybe it's safe to go ahead and change this. Raymond? IMO, the fix from #9025 should be backported. Note that that fix fixes the issue completely: all outputs will occur with equal probability. That's under the unrealistic assumption of a perfect source of random bits/words, of course; but the key point is that randrange shouldn't introduce any *new* biases that aggravate existing ones in the source generator. Reducing `_maxwidth` would just reduce the size of the randrange bias without eliminating it completely: if we're going to make any change at all to the source, we should fix the problem once and for all. Another option that avoids breaking reproducibility would be to note the bias in the docs, and provide a doc recipe for an unbiased randrange, for those who need it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23974 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23970] Update distutils.msvccompiler for VC14
Marc-Andre Lemburg added the comment: On 17.04.2015 00:06, Steve Dower wrote: So it looks like what I should do is use the include_dirs and library_dirs members from CCompiler so they can be set through other properties. I see that you're basically reading the include and lib dirs from the vc_env which essentially reads the vcvars batch files, so that's no different than what we're already doing. It may be useful to add an official helper to the module to run this extraction outside the compiler class, e.g. def get_vc_var(var): return _get_vc_env(plat_spec).get(var) The extra arguments are passed into compile() as extra_preargs and extra_postargs, though I'm not entirely sure where they come from. I'd rather figure out how to use those than invent a new way of specifying them (FWIW, they've always been supported by the various msvccompiler implementations). Hmm, to hook into those, we'd have to find every single use of those methods and override them. Doesn't sound like a good way to do this, if you want a few options extra with every single compile call. I guess we'll then just continue to override the .initialize() call. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23970 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23985] Crash when deleting slices from duplicated bytearray
Ned Deily added the comment: Above was in 64-bit mode (x86_64). Same run in 32-bit (i386): $ ./bin/python3.5-32 /tmp/b/bytearray_bug.py buf2: 13 2 bytearray(b'1234567890123') buf1: 13 11 bytearray(b'1234567890123') buf2: 24 16 bytearray(b'345678901231234567890123') buf1: 15 4 bytearray(b'231234567890123') buf2: 21 16 bytearray(b'678901231234567890123') buf1: 24 3 bytearray(b'345678901231234567890123') buf2: 18 1 bytearray(b'901231234567890123') buf1: 34 28 bytearray(b'6789012312345678901231234567890123') buf2: 30 21 bytearray(b'012312345678901231234567890123') buf1: 19 8 bytearray(b'8901231234567890123') buf2: 22 6 bytearray(b'5678901231234567890123') buf1: 24 11 bytearray(b'345678901231234567890123') buf2: 29 23 bytearray(b'12312345678901231234567890123') buf1: 26 15 bytearray(b'12345678901231234567890123') buf2: 19 15 bytearray(b'8901231234567890123') buf1: 24 4 bytearray(b'345678901231234567890123') buf2: 17 7 bytearray(b'01231234567890123') buf1: 33 21 bytearray(b'789012312345678901231234567890123') buf2: 23 13 bytearray(b'45678901231234567890123') buf1: 25 20 bytearray(b'2345678901231234567890123') buf2: 23 8 bytearray(b'45678901231234567890123') buf1: 18 7 bytearray(b'901231234567890123') buf2: 28 3 bytearray(b'2312345678901231234567890123') buf1: 24 8 bytearray(b'345678901231234567890123') buf2: 38 1 bytearray(b'23456789012312345678901231234567890123') buf1: 29 7 bytearray(b'12312345678901231234567890123') buf2: 50 38 bytearray(b'34567890123123456789012312345678901231234567890123') buf1: 35 7 bytearray(b'56789012312345678901231234567890123') buf2: 25 4 bytearray(b'2345678901231234567890123') buf1: 41 20 bytearray(b'23123456789012312345678901231234567890123') buf2: 34 24 bytearray(b'6789012312345678901231234567890123') buf1: 34 19 bytearray(b'6789012312345678901231234567890123') buf2: 23 1 bytearray(b'45678901231234567890123') buf1: 28 18 bytearray(b'2312345678901231234567890123') buf2: 35 20 bytearray(b'56789012312345678901231234567890123') buf1: 23 13 bytearray(b'45678901231234567890123') buf2: 28 16 bytearray(b'2312345678901231234567890123') buf1: 23 19 bytearray(b'45678901231234567890123') buf2: 25 16 bytearray(b'2345678901231234567890123') buf1: 17 4 bytearray(b'01231234567890123') buf2: 22 18 bytearray(b'5678901231234567890123') buf1: 26 18 bytearray(b'12345678901231234567890123') buf2: 17 14 bytearray(b'01231234567890123') buf1: 21 18 bytearray(b'678901231234567890123') buf2: 16 14 bytearray(b'1231234567890123') buf1: 16 11 bytearray(b'1231234567890123') buf2: 15 10 bytearray(b'231234567890123') buf1: 18 2 bytearray(b'901231234567890123') buf2: 18 2 bytearray(b'901231234567890123') buf1: 29 3 bytearray(b'12312345678901231234567890123') buf2: 29 11 bytearray(b'12312345678901231234567890123') buf1: 39 9 bytearray(b'123456789012312345678901231234567890123') buf2: 31 23 bytearray(b'9012312345678901231234567890123') buf1: 43 31 bytearray(b'0123123456789012312345678901231234567890123') Debug memory block at address p=0x7aec88: API 'o' 49 bytes originally requested The 3 pad bytes at p-3 are FORBIDDENBYTE, as expected. The 4 pad bytes at tail=0x7aecb9 are not all FORBIDDENBYTE (0xfb): at tail+0: 0x31 *** OUCH at tail+1: 0x32 *** OUCH at tail+2: 0x33 *** OUCH at tail+3: 0x00 *** OUCH The block was made by call #44809 to debug malloc/realloc. Data at p: 31 32 33 34 35 36 37 38 ... 33 34 35 36 37 38 39 30 Fatal Python error: bad trailing pad byte Current thread 0xa0ddc1d4 (most recent call first): File /tmp/b/bytearray_bug.py, line 25 in module Abort trap: 6 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23985 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23980] Documentation for format units starting with 'e' is inconsistent
Marc-Andre Lemburg added the comment: On 17.04.2015 06:42, Larry Hastings wrote: Larry Hastings added the comment: One more idea. We annotate with an when you pass in a pointer to a variable. So format unit 'i' would get [ int], 's' would get [ char *], and 'es#' would get [char *, char *, int]. That sounds like a nice solution. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23980 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23987] docs about containers membership testing wrong for broken objects
Jonathan Sharpe added the comment: I don't think it's as simple as linking to the hashable definition. The equivalent expression is simply wrong for dict/set/frozenset, as those types check hash equality, not identity. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23987] docs about containers membership testing wrong for broken objects
New submission from Ethan Furman: https://docs.python.org/3/reference/expressions.html#comparisons: The operators 'in' and 'not in' test for membership. 'x in s' evaluates to true if x is a member of s, and false otherwise. 'x not in s' returns the negation of 'x in s'. All built-in sequences and set types support this as well as dictionary, for which 'in' tests whether the dictionary has a given key. For container types such as list, tuple, set, frozenset, dict, or collections.deque, the expression 'x in y' is equivalent to 'any(x is e or x == e for e in y)'. StackOverflow question for context: http://stackoverflow.com/q/29692140/208880 Summary: if a user creates a broken object such that __hash__ returns a random number with every invocation, then that object will get lost in a dict or set; but the above statement about 'equivalent to' claims that such an object will still be found. On the other hand, https://docs.python.org/3/glossary.html#term-hashable says that a constant return value is required for an object to be hashable (of course, Python can't tell if future calls to __hash__ will return the same value). Perhaps a link to the #term-hashable would be appropriate? -- messages: 241320 nosy: eric.araujo, ethan.furman, ezio.melotti, georg.brandl priority: normal severity: normal status: open title: docs about containers membership testing wrong for broken objects versions: Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23985] Crash when deleting slices from duplicated bytearray
Wolfgang Maier added the comment: Also happening with Python 3.4.0 on Ubuntu 14.04 (after ~ half a minute and A LOT of output): [skipping lots of lines] buf2: 29 13 bytearray(b'12312345678901231234567890123') buf1: 25 9 bytearray(b'2345678901231234567890123') buf2: 29 2 bytearray(b'12312345678901231234567890123') buf1: 29 5 bytearray(b'12312345678901231234567890123') buf2: 40 8 bytearray(b'3123456789012312345678901231234567890123') buf1: 37 10 bytearray(b'3456789012312345678901231234567890123') buf2: 45 31 bytearray(b'890123123456789012312345678901231234567890123') buf1: 40 7 bytearray(b'3123456789012312345678901231234567890123') buf2: 27 3 bytearray(b'312345678901231234567890123') buf1: 46 9 bytearray(b'7890123123456789012312345678901231234567890123') buf2: 37 6 bytearray(b'3456789012312345678901231234567890123') buf1: 50 15 bytearray(b'34567890123123456789012312345678901231234567890123') buf2: 44 5 bytearray(b'90123123456789012312345678901231234567890123') buf1: 48 27 bytearray(b'567890123123456789012312345678901231234567890123') buf2: 52 3 bytearray(b'1234567890123123456789012312345678901231234567890123') buf1: 34 1 bytearray(b'6789012312345678901231234567890123') buf2: 62 16 bytearray(b'45678901231234567890123123456789012312345678901231234567890123') buf1: 46 13 bytearray(b'7890123123456789012312345678901231234567890123') *** Error in `python3': realloc(): invalid pointer: 0x7f2a4558 *** -- nosy: +wolma ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23985 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23987] docs about containers membership testing wrong for broken objects
Changes by Jonathan Sharpe j.r.sharpe+pyt...@gmail.com: -- assignee: - docs@python components: +Documentation nosy: +docs@python, jonrsharpe ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23985] Crash when deleting slices from duplicated bytearray
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +pitrou, serhiy.storchaka priority: normal - high ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23985 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23988] keyworded argument count is wrong
New submission from Albert Zeyer: Code: class C(object): def __init__(self, a, b=2, c=3): pass class D(C): def __init__(self, d, **kwargs): super(D, self).__init__(**kwargs) class E(D): def __init__(self, **kwargs): super(E, self).__init__(**kwargs) E(d=42, b=0, c=0) You get the funny message: TypeError: __init__() takes at least 2 arguments (3 given) -- components: Interpreter Core messages: 241335 nosy: Albert.Zeyer priority: normal severity: normal status: open title: keyworded argument count is wrong type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23988 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22829] Add --prompt option to venv
Stéphane Wirtel added the comment: ok, I will propose an update with the comments of the review. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23985] Crash when deleting slices from duplicated bytearray
Alexei Romanov added the comment: No problem with python 2.7.6 on Ubuntu 14.04.2 LTS amd64. Attached script was working about 2 hours - no crash. -- nosy: +alexei.romanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23985 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23882] unittest discovery and namespaced packages
Claudiu Popa added the comment: Isn't this already supported by the patch added in issue17457? -- nosy: +Claudiu.Popa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23882 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23970] Update distutils.msvccompiler for VC14
Steve Dower added the comment: Yeah, the basic functionality is no different, since there isn't really a better way to handle future versions of VS automatically. I'd rather not officially expose this stuff though. Maybe you could override the compiler creation code and return an alternative implementation? That will be most portable. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23970 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23985] Crash when deleting slices from duplicated bytearray
Wolfgang Maier added the comment: Surprisingly, a much simpler version with just one bytearray seems to run stably (for several minutes at least), but when you wait a while then hit Ctrl-C, you are getting a Segmentation fault: Python 3.4.0 (default, Apr 11 2014, 13:05:11) [GCC 4.8.2] on linux Type help, copyright, credits or license for more information. import random buf1 = bytearray() data = b1234567890123 while True: ... buf1 += data ... l = len(buf1) ... n = random.randrange(1, l-1) ... del buf1[:n] ... ^CSegmentation fault (core dumped) The same code crashes spontaneously (without attempting a keyboard interrupt) when run in IDLE. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23985 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h
koobs added the comment: @RAW, can you attach a patch against the default branch please so we can move this forward? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17120 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23882] unittest discovery and namespaced packages
Alex Shkop added the comment: Not fully. Patch for issue17457 fixed discovery when you explicitly specified namespace package as a target for discovery. I.e. when you run python -m unittest namespace_pkg But it didn't recurse into any namespace packages inside namespace_pkg. So when you run python -m unittest it doesn't go under all namespace packages (basically folders) in cwd. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23882 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23970] Update distutils.msvccompiler for VC14
Marc-Andre Lemburg added the comment: On 17.04.2015 16:04, Steve Dower wrote: Yeah, the basic functionality is no different, since there isn't really a better way to handle future versions of VS automatically. I'd rather not officially expose this stuff though. Maybe you could override the compiler creation code and return an alternative implementation? That will be most portable. I just had a look at our code and I think we can try a different approach which doesn't require monkey-patching: we're using a CompilerSupportMixin for the build commands which has a .prepare_compiler() method to set up the .compiler attribute which is then used for compiling things. We'll have to experiment with that a bit, since I'm not sure whether this will catch all cases where distutils uses a compiler. Alternatively, we could use monkey-patching (again :-() to override ccompiler.new_compiler() and then apply the fixes there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23970 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23899] HTTP regression in distutils uploads to chishop
Jason R. Coombs added the comment: There's nothing logged in the chishop logs except the POST request. I suspect dstufft is right. I'll try backing out that change and see what effect that has. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23899 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23987] docs about containers membership testing wrong for broken objects
Ethan Furman added the comment: It's not quite that simple -- those containers use the hash to find the objects that will be first checked by identity, and then equality* -- otherwise they would have to do a complete scan from first key to last, and that would kill performance. ... Okay, I see your point -- even for sane objects, a systematic check of every key is not undertaken for the hash-type containers. Perhaps something like: For container types such as list, tuple, or collections.deque, the expression 'x in y' is equivalent to 'any(x is e or x == e for e in y)'. For container types such as set, frozenset, and dict, 'x in y' is equivalent to 'any(x is e or x == e for e in z)' where 'z' is a collection of objects in 'y' that have the same hash. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23988] keyworded argument count is wrong
Benjamin Peterson added the comment: This is a well-known shortcoming of 2.x function signature errors. The situation is much improved in 3.x: TypeError: __init__() missing 1 required positional argument: 'a' -- nosy: +benjamin.peterson resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23988 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6818] remove/delete method for zipfile/tarfile objects
Dave Sawyer added the comment: Maybe it takes a little longer than a week. I have a final signed agreement from Ewa (https://secure.echosign.com/public/viewAgreement?aid=X88L4EVP5IXC289eid=X88M6DGQ93J5K38;) signed on 04/17/2014 6:48 PM Wow, exactly one year ago! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6818 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20184] Derby #16: Convert 50 sites to Argument Clinic across 9 files
Roundup Robot added the comment: New changeset 49910ff21ba5 by Serhiy Storchaka in branch 'default': Issue #20184: Converted _dbm and _gdbm modules to Argument Clinic. https://hg.python.org/cpython/rev/49910ff21ba5 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20184 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20181] Derby #12: Convert 50 sites to Argument Clinic across 4 files
Roundup Robot added the comment: New changeset c6d468e0ecc6 by Serhiy Storchaka in branch 'default': Issue #20181: Converted the unicodedata module to Argument Clinic. https://hg.python.org/cpython/rev/c6d468e0ecc6 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20181 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23989] Add recommendation to use requests to the documentation, per summit
New submission from VanL: Attached is a basic patch to add a recommendation to use requests to the http.client documentation for 3.5. It is implemented as a seealso at the top of the file: See Also: The Requests package is recommended for a higher-level http client interface. If people are happy with the wording, I'll also add the same message to urllib.request and do the same with previous versions (2.7, 3.3, and 3.4). -- assignee: docs@python components: Documentation files: recommend_requests.patch keywords: patch messages: 241349 nosy: VanL, docs@python priority: normal severity: normal status: open title: Add recommendation to use requests to the documentation, per summit type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file39088/recommend_requests.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23989 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23971] dict(list) and dict.fromkeys() doesn't account for 2/3 fill ratio
Matt Mackall added the comment: We already presize the output dict and have for ages. The question here is what size to use. In the current state, we use twice as much memory and CPU as necessary quite often because we end up spilling and growing... even though we apparently intentionally sized the object to fit. In the sparse case, if we allocate a 1GB dictionary and use two entries in it, we will have consumed 1GB of address space but 1kB of actual memory. -- nosy: +Matt.Mackall ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23971 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23899] HTTP regression in distutils uploads to chishop
Jason R. Coombs added the comment: Confirmed. Backing out that change restores the behavior. If I trust the commit description (and it looks reasonable), the issue really does lie with chishop, though for compatibility, I may look to patch it. Thanks dstufft for the reference. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23899 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23882] unittest discovery and namespaced packages
Robert Collins added the comment: Hi. I'd be happy enough to use pkgutil helpers if they (like walkdirs) allowed trimming the output: part of the definition of discovery is that one can control it, to stop it importing or processing part of the tree that one doesn't want processed. Alex: can you create a test case please - just a small script, python or shell or whatever, that will setup a demonstration of the bug? Thanks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23882 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
New submission from Maries Ionel Cristian: It appears that callable doesn't really care for the descriptor protocol, so it return True even if __call__ is actually an descriptor that raise AttributeError (clearly not callable at all). Eg: Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)] on win32 Type help, copyright, credits or license for more information. callable built-in function callable class A: ... @property ... def __call__(self): ... raise AttributeError('go away') ... a = A() a __main__.A object at 0x0365B5C0 a.__call__ Traceback (most recent call last): File stdin, line 1, in module File stdin, line 4, in __call__ AttributeError: go away callable(a) True # it should be False :( -- components: Interpreter Core messages: 241352 nosy: ionel.mc priority: normal severity: normal status: open title: Callable builtin doesn't respect descriptors type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22198] Odd floor-division corner case
Mark Dickinson added the comment: Thanks for the ping, and sorry for forgetting about this. I'm -1 on applying this patch. I agree that floor division has some corner case issues (of which this is only one). But there's no clear agreement on what the right answer is, and I don't think making a tiny change to one corner case is worth it in terms of code churn. And making several such tiny changes over the course of different Python releases is something we'd definitely want to avoid. Ideally, there'd be a once-and-for-all agreement on exactly what should happen with *all* the corner cases; we'd fix the code to implement exactly that, and then we could forget about it. But without a standard to guide us, I don't think that's going to happen. So my vote is to close as wont fix. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22198 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22198] Odd floor-division corner case
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: mark.dickinson - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22198 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23986] Inaccuracy about in keyword for list and tuple
James Edwards added the comment: What about: For the list and tuple types, ``x in y`` is true if and only if there exists an -index *i* such that ``x == y[i]`` is true. +index *i* such that either ``x == y[i]`` or ``x is y[i]`` is true. Seems to address your issue, and match the semantics of the Python3 any() approach. -- keywords: +patch nosy: +jedwards Added file: http://bugs.python.org/file39087/issue23986.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23986 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23987] docs about containers membership testing wrong for broken objects
Ethan Furman added the comment: I think I like that better than my suggestion. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23930] SimpleCookie doesn't parse comma-only separated cookies correctly
Changes by Demian Brecht demianbre...@gmail.com: -- nosy: +demian.brecht ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23930 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23975] numbers.Rational implements __float__ incorrectly
Mark Dickinson added the comment: What happens if `self.numerator / self.denominator` returns another `Rational` instance? If I create `MyRational` and `MyInteger` classes, such that the quotient of two `MyInteger` instances is a `MyRational` instance and the numerator and denominator of a `MyRational` instance are both `MyInteger` instances, this suggestion would lead to an infinite recursion. OTOH, I agree that *something* needs to be fixed here, since having `__float__` return a `MyRational` instance is definitely wrong. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17123] Add OCSP support to ssl module
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17123 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Maries Ionel Cristian added the comment: For context this respects the descriptor protocol: a() Traceback (most recent call last): File stdin, line 1, in module File stdin, line 4, in __call__ AttributeError: go away Mind you, this is legal use: class B: ... @property ... def __call__(self): ... return lambda: 1 ... b = B() b() 1 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Changes by Joe Jevnik j...@quantopian.com: -- nosy: +ll ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23986] Inaccuracy about in keyword for list and tuple
R. David Murray added the comment: Those two should be in the reverse order, though. Identity is checked before equality. But why not backport the python3 wording? (Note that there is an open issue for slightly improving that wording). -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23986 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Ionel Cristian Mărieș added the comment: Christian, it's not clear why you're closing this. You basically just described the current broken behaviour. That by itself is not a reason enough (it's a sort of circular argument ;-). Can you please explain what prevents this to be fixed or how we got this implementation in the first place? From my perspective the current behavior is inconsistent, as outlined in the above examples. -- resolution: not a bug - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Christian Heimes added the comment: callable() just checks that an object can be called. It doesn't check if the actual call or even the access to the __call__() member succeeds. Magic methods are resolved on the class or type of an object, not the object itself. Therefore the descriptor protocol is not invoked unless you do the actual call. The check roughly translated to: def callable(obj): return hasattr(type(obj), '__call__') -- nosy: +christian.heimes resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23989] Add recommendation to use requests to the documentation, per summit
Changes by Cory Benfield c...@lukasa.co.uk: -- nosy: +Lukasa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23989 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Joe Jevnik added the comment: I am also confused by this; I would imagine that callable(obj) would respect the descriptor protocol. I have a proposed patch that would make this work with descriptors. -- keywords: +patch Added file: http://bugs.python.org/file39090/callable.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20168] Derby: Convert the _tkinter module to use Argument Clinic
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file39089/tkinter_4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20168 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20168] Derby: Convert the _tkinter module to use Argument Clinic
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file39091/tkinter_4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20168 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Ethan Furman added the comment: As Christian Heimes explained, this is not a bug. Please do not reopen it. -- nosy: +ethan.furman resolution: - not a bug status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Changes by Claudiu Popa pcmantic...@gmail.com: -- nosy: +Claudiu.Popa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23989] Add recommendation to use requests to the documentation, per summit
Changes by Ian Cordasco graffatcolmin...@gmail.com: -- nosy: +icordasc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23989 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16125] open accepts arbitrary mode strings as long as they contain U
Arfrever Frehtes Taifersar Arahesis added the comment: Still reproducible with Python 2.7.10rc0 on GNU/Linux: open('/tmp/a', 'az') open file '/tmp/a', mode 'az' at 0x7f68b117e420 open('/tmp/a', 'rz') open file '/tmp/a', mode 'rz' at 0x7f68b117e4b0 open('/tmp/a', 'wz') open file '/tmp/a', mode 'wz' at 0x7f68b117e420 open('/tmp/a', 'zU') open file '/tmp/a', mode 'zU' at 0x7f68b117e4b0 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16125 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20168] Derby: Convert the _tkinter module to use Argument Clinic
Serhiy Storchaka added the comment: Updated to the tip. Converted methods getint, getdouble, getboolean, splitlist, split. -- Added file: http://bugs.python.org/file39089/tkinter_4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20168 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20148] Derby: Convert the _sre module to use Argument Clinic
Serhiy Storchaka added the comment: Updated to the tip. -- Added file: http://bugs.python.org/file39092/sre_clinic_5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20148 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Christian Heimes added the comment: I have closed the issue because the code behaves according to the language specs and the language design. It is not broken at all. The callable test just checks for the attribute __call__ on the *type* of an object. The check is not performed on the *object* itself. In your example callable(a) does not do hasattr(a, '__call__') but hasattr(type(a), '__call__') which translates to hasattr(A, '__call__') The behavior is very well consistent. I presume it just doesn't match your expectations. Special methods have a slightly different lookup behavior than ordinary. Due to the highly dynamic nature of Python the __call__ attribute is not validated at all. For example this is expected behavior: class Example: ... __call__ = None ... callable(Example()) True class Example: ... __call__ = None ... example = Example() callable(example) True example() Traceback (most recent call last): File stdin, line 1, in module TypeError: 'NoneType' object is not callable -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Ethan Furman added the comment: See: https://docs.python.org/3/reference/datamodel.html#special-method-names and https://docs.python.org/3/reference/datamodel.html#object.__getattribute__ and https://docs.python.org/3/reference/datamodel.html#special-lookup -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15786] IDLE code completion window can hang or misbehave with mouse
Changes by Al Sweigart asweig...@gmail.com: -- nosy: +Al.Sweigart ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15786 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23966] More clearly expose/explain native and cross-build target information
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23966 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23969] please set a SOABI for MacOSX
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23969 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23954] Idle autocomplete: enter or clicking does not select the option
Terry J. Reedy added the comment: I have noticed ;-). TAB TAB is required to select, which is slightly obnoxious. Click within the box closes it, which is useless and annoying. Scrollwheel moves the entries but not the selection highlight, making it mostly useless These behaviors are mostly contrary to the doc and are overt bugs. Some of the bugginess appears specific to Windows. This issue is a duplicate of #15786, so I am closing it as such. -- nosy: +terry.reedy resolution: - duplicate stage: - resolved status: open - closed superseder: - IDLE code completion window can hang or misbehave with mouse title: Pressing enter/return or clicking IDLE's autocomplete does not select the option - Idle autocomplete: enter or clicking does not select the option ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23954 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15786] IDLE code completion window can hang or misbehave with mouse
Terry J. Reedy added the comment: I closed #23954 in favor of this one. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15786 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23961] IDLE autocomplete window does not automatically close when selection is made
Terry J. Reedy added the comment: I believe Tab is working as designed. If so, you are requesting that the design be reviewed and possible changed. As noted in #15786, Click and Enter are not working as intended, so I think fixing the bugs is a higher priority. -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23961 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23978] ttk.Style.element_create using incorrect tk.call syntax
Terry J. Reedy added the comment: Reproduced on Win7, 3.4.3, with updated import: from tkinter import ttk. The example should serve as a test. -- nosy: +terry.reedy stage: - needs patch type: - behavior versions: +Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23978 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Ionel Cristian Mărieș added the comment: Ethan, those sections you have linked to have nothing to do with special methods that are descriptors, or behaviour regarding descriptors. As seen in this example, descriptors are working even for special methods: class B: ... @property ... def __call__(self): ... return lambda: 1 ... b = B() b() 1 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23937] IDLE start maximized
Terry J. Reedy added the comment: With a large, wide monitor, I run very few things maximized other that a browser and full screen games. A much smaller notebook screen would be very different. For Idle, I want Shell and Editor side-by-side. I would however, like windows vertically maximized, as with Window = Zoomheight, except that Zoomheight is buggy in that it ignores the taskbar and puts the Idle status bar underneath. (Maximize does not do this.) The idea of removing the option and remembering the last position is worth considering, but there may be multiple windows upon closing. I would actually like the horizontal positioning of shell and editor kept separate. So I agree that initial window size and position could be improved, but I am not sure how. -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23937 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23972] Asyncio reuseport
Changes by Terry J. Reedy tjre...@udel.edu: -- versions: -Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23972 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23982] Tkinter in Python 3.4 for Windows incorrectly renders certain colors using non-TclTk RGB values
Terry J. Reedy added the comment: I ran colortest on Win7 with 2.7.9, 3.3.5, 3.4.3, and 3.5.0a3. The first two are the same, the last two are also the same, but with the muted colors noted. The obvious difference is that for Windows, we changed from tcl/tk 8.5 to 8.6 in 3.4.0. The same change will happen (I believe) on OSX for 3.5.0. You might want to try 3.5.0a3 on OSX and see if a) the tcl/tk version has changed and b) if it affects the colors there. (I believe some people have also installed and run tcl/tk 8.6 with Python 3.4 but I do not know the details.) AFAIK, tkinter passes color words to tk unchanged and has nothing to do with conversion to rgb and color rendering. I presume the data for the conversion dict is somewhere in the tcl/tk source. Perhaps Serhiy can commont on this. -- nosy: +serhiy.storchaka, terry.reedy stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23982 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Changes by Joe Jevnik j...@quantopian.com: Removed file: http://bugs.python.org/file39090/callable.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Joe Jevnik added the comment: Oops, I messed up the test case; here is a fixed version (the class name was wrong). Just a note: all the existing test cases passed AND the one proposed in this thread. I understand that it is currently working as intended; however, the argument is that the intended behaviour should be changed. -- Added file: http://bugs.python.org/file39093/callable.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18262] ZipInfo.external_attr are not documented
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: docs@python - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18262 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23985] Crash when deleting slices from duplicated bytearray
Terry J. Reedy added the comment: Win7, 64 bit, 3.5.0a3: crash in about 10 seconds. -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23985 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23982] Tkinter in Python 3.4 for Windows incorrectly renders certain colors using non-TclTk RGB values
Serhiy Storchaka added the comment: From Tcl/Tk 8.6 on, Tk uses Web colours instead of X11 ones, where they conflict. http://www.tcl.tk/cgi-bin/tct/tip/403.html -- resolution: - not a bug stage: test needed - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23982 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23978] ttk.Style.element_create using incorrect tk.call syntax
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23978 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Alexander Belopolsky added the comment: From https://mail.python.org/pipermail/python-ideas/2015-April/033018.html: GvR I think you've found an unintended and undocumented backdoor. I admit I don't understand how this works in CPython. Overloaded operators like __add__ or __call__ should be methods in the class, and we don't look for them in the instance. But somehow defining them with @property works (I guess because @property is in the class). What's different for __call__ is that callable() exists. And this is probably why I exorcised it Python 3.0 -- but apparently it's back. :-( In the end callable() doesn't always produce a correct answer; but maybe we can make it work in this case by first testing the class and then the instance? Something like (untested): def callable(x): return hasattr(x.__class__, '__call__') and hasattr(x, '__call__') GvR -- nosy: +belopolsky resolution: not a bug - stage: resolved - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Alexander Belopolsky added the comment: But somehow defining them with @property works (I guess because @property is in the class). IMO, this is the bug and not the callable() behavior. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Joe Jevnik added the comment: I don't think that using a property to define a callable in the class is a bug; while it seems less ideal, I don't understand why it would be unsupported with callable when it executes correctly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
James Edwards added the comment: It seems like this issue has morphed over time. At the beginning, it looked like you expected perfectly reasonable (but odd) definitions of __call__ attributes, where the logic inside raised an Exception, to be somehow determined to be uncallable. This does not seem realistic at all. Then it turned into detecting whether the __call__ attribute was None or not. Fine, I guess. But towards the end, it has turned into you wanting to check whether both an instance and a class have __call__ attributes. Which doesn't seem like too much of an unreasonable change. But these changes and the proposed patch won't address your initial issue of somehow detecting that the logic inside will raise an AttributeError or that __call__ is defined, but None. -- nosy: +jedwards ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Ionel Cristian Mărieș added the comment: Actually it does address it, as AttributeError is very special: a.__call__ Traceback (most recent call last): File stdin, line 1, in module File stdin, line 4, in __call__ AttributeError: go away hasattr(a, '__call__') False -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23985] Crash when deleting slices from duplicated bytearray
Martin Panter added the comment: Here is a reduced version without using random numbers that reliably crashes for me on 64-bit Linux. Hopefully it also crashes for others, and they can investigate further. Crashes for me with the standard Arch Linux binary: Python 3.4.3 (default, Feb 26 2015, 23:01:07) [GCC 4.9.2 20150204 (prerelease)] on linux and my recently built v3.5 version: Python 3.5.0a3+ (default:0b3027a2abbc, Apr 11 2015, 23:27:07) [GCC 4.9.1] on linux It does not crash on 32 bit computer I tried though. -- nosy: +vadmium Added file: http://bugs.python.org/file39094/linux-x86-64.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23985 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Ionel Cristian Mărieș added the comment: Some more discussions happened here: https://mail.python.org/pipermail/python-ideas/2015-April/033027.html So for Christian or Ethan, can you reconsider this issue? Joe has already kindly provided a patch for this that just does one extra check. It still checks the type of the object first. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23979] Multiprocessing Pool.map pickles arguments passed to workers
Luis added the comment: Thanks for answer, although I still think I haven't made myself fully understood here, allow me to paraphrase: ...You need some means of transferring objects between processes, and pickling is the Python standard serialization method Yes, but the question that stands is why Pool has to use a multiprocess.Queue to load and spin the workers (therefore pickling-unpickling their arguments), whereas we should just inheriting in that moment and then just create a Queue for the returns of the workers. This applies to method fork, not to spawn, and not sure for fork server. Plus, I'm not trying to avoid inheritance, I'm trying to use it with Pools and large arguments as theoretically allowed by forking, and instead at the moment I'm forced to use Processes with a Queue for the results, as shown in the code above. OverflowError: cannot serialize a bytes object larger than 4 GiB is just what allows us to expose this behavior, cause the Pool pickles the arguments without, in my opinion, having to do so. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23979 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Ionel Cristian Mărieș added the comment: But somehow defining them with @property works (I guess because @property is in the class). IMO, this is the bug and not the callable() behavior. By the same reasoning we shouldn't be able to use staticmethod or classmethod for special methods. I'm pretty sure that's intended, even if it looks useless. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23852] Wrong computation of max_fd on OpenBSD
William Orr added the comment: I've updated Cédric's patch to only run that portion on OpenBSD. -- Added file: http://bugs.python.org/file39097/max_fd.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23852 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23982] Tkinter in Python 3.4 for Windows incorrectly renders certain colors using non-TclTk RGB values
Terry J. Reedy added the comment: Aha. http://www.tcl.tk/man/tcl8.6/TkCmd/colors.htm should be changed. Not an issue for this tracker though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23982 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23991] ZipFile sanity checks
New submission from Antony Lee: ZipFile.{open,read} could raise IsADirectoryError when called on a directory entry, rather than return an empty bytes. ZipFile.writestr could fail writing non-empty bytes to a directory entry. Use case for open and read: I was trying to write a zip merger (taking multiple zip files and merge them into a single zip). Unfortunately, the obvious approach (iterate on the original infolists, extract each of them and writestr them to the new ZipFile object) created invalid zip files because it'll create empty files for each directory. Raising IsADirectoryError would have brought attention to the issue much earlier. The suggested modification to writestr is a bit different, but also makes sense because the bytes argument is not written anywhere anyways in the case of directory entries. -- components: Library (Lib) messages: 241396 nosy: Antony.Lee priority: normal severity: normal status: open title: ZipFile sanity checks versions: Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23991 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Terry J. Reedy added the comment: To extend msg241386: A bug, for this tracker, is a discrepancy between specification and behavior. Wrapping an instance method with @property changes its behavior so that it no longer meets the specification for an 'instance method'. (PS to Joe: please leave the headers alone.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Ethan Furman added the comment: Python 3.4.0 (default, Apr 11 2014, 13:05:18) [GCC 4.8.2] on linux Type help, copyright, credits or license for more information. -- class NonIter: ...pass ... -- list(iter(NonIter())) Traceback (most recent call last): File stdin, line 1, in module TypeError: 'NonIter' object is not iterable -- class MaybeIter: ...@property ...def __next__(self): ... raise AttributeError ...def __iter__(self): ... return self ... -- iter(MaybeIter()) __main__.MaybeIter object at 0xb6a5da2c # seems to work -- list(iter(MaybeIter())) Traceback (most recent call last): File stdin, line 1, in module File stdin, line 4, in __next__ AttributeError This is exactly analogous to what you are seeing with __call__ and callable(). I am not opposed to fixing callable(), I'm opposed to fixng only callable(). If you want to have the descriptor protocol be given more weight in dealing with special methods (aka magic methods aka dunder methods) then be thorough. Find all (or at least most ;) of the bits and pieces that rely on these __xxx__ methods, write a PEP explaining why this extra effort should be undertaken, get a reference implementation together so the performance hit can be measured, and then make the proposal. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23985] Crash when deleting slices from duplicated bytearray
Martin Panter added the comment: After cleaning my build and rebuilding with “./configure --with-pymalloc --with-pydebug”, I reduced my script to these four lines: b1 = bytearray(babcdefghij) # 10 bytes del b1[:1] del b1[:1] b1 += bklmnopq # 7 bytes Patch bytearray-fix.patch fixes the bug by taking account fact that ob_start is offset into the allocated memory buffer when checking if a reallocation is necessary. Explanation with the unpatched code and my four-line script above: 1. First line allocates 11 bytes of memory (10 for the byte string + 1 NUL terminator) 2. First “del” reduces the bytearray length to 9 bytes, but actually reallocates an expanded memory buffer of 16 bytes! (quirky but not the bug) 3. Second “del” reduces the bytearray length to 8 bytes, and increments an internal ob_start offset without any memory copying or reallocation. (Fine.) 4. Appending step needs to add 7 bytes to the 8-byte array. 7 + 8 + 1 is 16 bytes total required for bytearray and NUL terminator, but since ob_start is offset from the start of the allocated memory buffer, we overwrite past the end of the buffer. Memory debugging output and extra debug printfs of my own: Resizing to size 10 (current log. offset 0 alloc 0) = Major upsize, new alloc = 11 Assigning to linear slice - Shifting ob_start for negative growth -1 Resizing to size 9 (current log. offset 1 alloc 11) = Moderate upsize, new alloc = 16 - Done assigning to linear slice Assigning to linear slice - Shifting ob_start for negative growth -1 Resizing to size 8 (current log. offset 1 alloc 16) = Minor downsize - Done assigning to linear slice Debug memory block at address p=0x7f1af630a0d0: API 'o' 16 bytes originally requested The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected. The 8 pad bytes at tail=0x7f1af630a0e0 are not all FORBIDDENBYTE (0xfb): at tail+0: 0x00 *** OUCH at tail+1: 0xfb at tail+2: 0xfb at tail+3: 0xfb at tail+4: 0xfb at tail+5: 0xfb at tail+6: 0xfb at tail+7: 0xfb The block was made by call #32897 to debug malloc/realloc. Data at p: 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 Fatal Python error: bad trailing pad byte -- keywords: +patch Added file: http://bugs.python.org/file39098/bytearray-fix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23985 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23985] Crash when deleting slices from duplicated bytearray
Martin Panter added the comment: Posting bytearray-resize.patch which stops “del” from expanding the allocated buffer. This one is not necessary to fix the reported bug, but avoids the separate quirk identified in step 2. -- stage: needs patch - patch review Added file: http://bugs.python.org/file39099/bytearray-resize.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23985 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23987] docs about containers membership testing wrong for broken objects
R. David Murray added the comment: Could we add For dictionaries and sets this equivalence expression is modified by the addition of 'if hash(x) == hash(e)'? -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23955] Add python.ini file for embedded/applocal installs
Éric Araujo added the comment: Hm, could you reuse the venv config file with use-site-packages=true? -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23955 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23982] Tkinter in Python 3.4 for Windows incorrectly renders certain colors using non-TclTk RGB values
Martin Falatic added the comment: This change wasn't in their documentation anywhere: http://www.tcl.tk/man/tcl8.5/TkCmd/colors.htm http://www.tcl.tk/man/tcl8.6/TkCmd/colors.htm It would be of value to call this out in the Python documentation (as far as I can find, there's nothing specifying which version of TclTk goes with what version of Python for Windows). As for OSX, it appears to use whatever TclTk is installed on the system. The recommended version isn't consistent with this change either - Python specifies 8.5 for 2.7 and 3.4: https://www.python.org/download/mac/tcltk/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23982 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20669] OpenBSD: socket.recvmsg tests fail with OSError: [Errno 40] Message too long
Changes by William Orr w...@worrbase.com: Removed file: http://bugs.python.org/file39028/recvmsg_trunc_emsgsize_cmsg_linux_only.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20669 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12978] Figure out extended attributes on BSDs
William Orr added the comment: Here's an initial attempt at implementing extended attribute support. Let me know if there's any interest. There's currently one deficiency, which is that the namespace isn't prepended to the attribute name when calling lsxattr. Let me know if my approach is good, so I can continue fixing lsxattr. All other unit tests pass. -- keywords: +patch nosy: +worr Added file: http://bugs.python.org/file39095/initial_freebsd_xattrs.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12978 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20669] OpenBSD: socket.recvmsg tests fail with OSError: [Errno 40] Message too long
Changes by William Orr w...@worrbase.com: Removed file: http://bugs.python.org/file38990/recvmsg_trunc_emsgsize_cmsg_obsd_skip.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20669 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20669] OpenBSD: socket.recvmsg tests fail with OSError: [Errno 40] Message too long
William Orr added the comment: Double checked on a FreeBSD box and confirmed. I missed the loop in the kernel source. I've attached a new patch, without the emsgsize change. -- Added file: http://bugs.python.org/file39096/recvmsg_linux_freebsd_only.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20669 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Joe Jevnik added the comment: As ionelmc mentioned, it does address the issue proposed originally and in the patch this is added as another test case for the callable function -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23990] Callable builtin doesn't respect descriptors
Terry J. Reedy added the comment: __call__ is a reserved name defined to be an instance method. I view wrapping *any* reserved-name instance method with @property to be a bug in that it redefines the name as a data attribute implemented with a 'hidden' get method. A function wrapped with @staticmethod or @classmethod is also not an instance method. The doc for callable says If this returns true, it is still possible that a call fails, In your example, calling a() fails with AttributeError, with or without the @property decoration. Either way it does not contradict the doc. The doc also says but if it is false, calling object will never succeed. So if you can define an object f such that callable(f) == False and print(f()) prints something, that would show a bug (and be a test case). Failing that, this is appears to be a feature request, not a bug fix. -- nosy: +terry.reedy stage: - test needed type: behavior - enhancement versions: +Python 3.5 -Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com