[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu
Raghu added the comment: Serhiy, root@host:~# python Python 2.7.3 (default, Apr 3 2016, 22:31:30) [GCC 4.8.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import struct >>> struct.pack('d', 2.0) '@\x00\x00\x00\x00\x00\x00\x00' >>> struct.pack('d', float(2

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is the output of `struct.pack('d', 2.0)` and `struct.pack('d', float(2))`? -- ___ Python tracker ___

[issue26751] Possible bug in sorting algorithm

2016-04-13 Thread Tim Peters
Tim Peters added the comment: If that's the actual code you're using, it has a bug: the "if k2[1] is None" test is useless, since regardless of whether it's true or false, the next `if` suite overwrites `retval`. You probably meant elif k1[1] ... ^^ instead of if k1[1] ... Doe

[issue26751] Possible bug in sorting algorithm

2016-04-13 Thread David Manowitz
New submission from David Manowitz: I'm trying to sort a list of tuples. Most of the tuples are pairs of US state names. However, some of the tuples have None instead of the 2nd name. I want the items sorted first by the 1st element, and then by the 2nd element, BUT I want the None to count

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu
Raghu added the comment: It's windriver linux. Processor is PPC64-E5500 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: What is your Linux distribution and what is your CPU? (try to read /proc/cpuinfo) You cannot install a C compiler? -- ___ Python tracker ___ _

[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()

2016-04-13 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu
Raghu added the comment: my host details: Linux fpc0 3.10.62-ltsi-WR6.0.0.18_standard #1 SMP PREEMPT Sun Apr 3 23:17:02 PDT 2016 ppc64 ppc64 ppc64 GNU/Linux -- ___ Python tracker _

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu
Raghu added the comment: stinner victor, my host doesn't have a gcc compiler. is there a way you can give me the binary? -- ___ Python tracker ___ __

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: >>> print math.sqrt(2.0) Traceback (most recent call last): File "", line 1, in ValueError: math domain error I'm surprised that such basic math function fails. Can you please try to compile and run attached C program? $ gcc sqrt.c -o sqrt -lm && ./sqrt sqr

[issue26750] Mock autospec does not work with subclasses of property()

2016-04-13 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: When patching a class, mock.create_autospec() correctly detects properties and __slot__ attributes, but not subclasses of property() or other kinds of data descriptors. The attached patch detects all data descriptors and patch them the way they should

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Raghu
Raghu added the comment: Hi, I apologize. I didn't expect a quick reply. Here are the outputs you requested. root@host:~# python Python 2.7.3 (default, Apr 3 2016, 22:31:30) [GCC 4.8.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import math >>> print ma

[issue26748] enum.Enum is False-y

2016-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue23008. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailin

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 13/04/2016 21:55, Marc-Andre Lemburg a écrit : >> >> LTO is not stable on all platforms (according to doko), and people don't >> want to wait for PGO to build when they just run ./configure && make. >> >> --with-pgo and --with-lto is fine. > > Agreed. Let's n

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 13.04.2016 21:50, Stefan Krah wrote: > > LTO is not stable on all platforms (according to doko), and people don't > want to wait for PGO to build when they just run ./configure && make. > > --with-pgo and --with-lto is fine. Agreed. Let's not make compi

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: > LTO is not stable on all platforms (according to doko), and people don't want > to wait for PGO to build when they just run ./configure && make. Can we have a whitelist of arch known to support PGO and/or LTO? Or maybe a blacklist? Ubuntu already has this k

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-13 Thread Stefan Krah
Stefan Krah added the comment: LTO is not stable on all platforms (according to doko), and people don't want to wait for PGO to build when they just run ./configure && make. --with-pgo and --with-lto is fine. -- ___ Python tracker

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: + --with-lto Enable Link Time Optimization in PGO builds. + Disabled by default. I don't understand why it's disabled by default. IMHO we must enable all the best optimizers options *by default*. But I expect all optimiza

[issue26359] CPython build options for out-of-the box performance

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: Sorry, I don't understand this issue. I don't think that we need 3 flavors: debug, devel and release. We already have debug (--with-pydebug) and release, and IMHO debug is what developers should use. I like the idea of using the best optimizers options *by def

[issue16399] argparse: append action with default list adds to list instead of overriding

2016-04-13 Thread Gabriel Devenyi
Gabriel Devenyi added the comment: >From what I can tell a workaround for this still isn't documented. -- nosy: +Gabriel Devenyi ___ Python tracker ___ __

[issue26749] Update devguide to include Fedora's DNF

2016-04-13 Thread Luiz Poleto
Luiz Poleto added the comment: The attached patch contains the instructions on how to use DNF to install the system headers. -- keywords: +patch Added file: http://bugs.python.org/file42457/issue26749.patch ___ Python tracker

[issue26749] Update devguide to include Fedora's DNF

2016-04-13 Thread Luiz Poleto
New submission from Luiz Poleto: Starting with Fedora 22, yum is no longer the default packaging tool, being replaced by the new DNF (Dandified Yum). Section 1.1.3.1 of the devguide, Build dependencies, has instructions to install system headers using popular Linux distributions, including Fed

[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()

2016-04-13 Thread skydoom
skydoom added the comment: seems we also need to check whether _main_thread is daemon thread or not, so the proposed patch would look like: def _shutdown(): # add these checking first if( _main_thread.isDaemon() is False or _main_thread.is_alive() is False ): return -- __

[issue26748] enum.Enum is False-y

2016-04-13 Thread Ethan Furman
Ethan Furman added the comment: EnumMeta /is/ a collection (at least in the same sense the dict class is a collection). ;) Fix is on it's way... -- ___ Python tracker ___

[issue26748] enum.Enum is False-y

2016-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Just reading the code now, the reason is that EnumMeta pretends to be a collection (it defines a __len__ and an __iter__). -- ___ Python tracker __

[issue26748] enum.Enum is False-y

2016-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, I didn't find a separate bug tracker for the enum34 backport, which is why I included that version here. > for IntEnum the behavior is correct Do you remember the argument? I agree that IntEnum *instances* may be falsy, but IntEnum classes I don't see wh

[issue26748] enum.Enum is False-y

2016-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, we posted at the same time :-) Yes, the class is false-y. -- ___ Python tracker ___ ___ Python-b

[issue26748] enum.Enum is False-y

2016-04-13 Thread Guido van Rossum
Guido van Rossum added the comment: Oh wait. The *class* is False-y? That's definitely a bug, just fix it. -- ___ Python tracker ___ _

[issue26748] enum.Enum is False-y

2016-04-13 Thread Guido van Rossum
Guido van Rossum added the comment: I guess it's marked 2.7 because of the enum34 backport? There's no enum in the 2.7 stdlib. I believe this was brought up before on one of the lists but I don't recall the outcome of the discussion, except that for IntEnum the behavior is correct. I tend to

[issue26748] enum.Enum is False-y

2016-04-13 Thread Antoine Pitrou
New submission from Antoine Pitrou: >>> import enum >>> bool(enum.Enum) False >>> bool(enum.IntEnum) False This behaviour is relatively unexpected for classes, and can lead to subtle bugs such as the following: https://bitbucket.org/ambv/singledispatch/issues/8/inconsistent-hierarchy-with-enum

[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-13 Thread Josh Rosenberg
Josh Rosenberg added the comment: LGTM. Had to check the definition of PyDescr_IsData to determine that checking the value from tp_descr_set for NULL was exactly what that macro does, but yeah, it looks like the first test was redundant, and f is never assigned outside that block, so the secon

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: I opened a thread on the python-dev mailing list to discuss wordcode: https://mail.python.org/pipermail/python-dev/2016-April/144044.html -- ___ Python tracker

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: I ran the Python benchmark suite on wpy6.patch. * My platform: Linux-4.4.4-301.fc23.x86_64-x86_64-with-fedora-23-Twenty_Three * My PC: CPU Intel i7-2600 (~2.9 GHz) with 12 GB of RAM * Benchmark ran on isolated CPU: http://haypo-notes.readthedocs.org/microbenchm

[issue26747] types.InstanceType only for old style class only in 2.7

2016-04-13 Thread SilentGhost
Changes by SilentGhost : -- assignee: -> docs@python components: +Documentation nosy: +docs@python stage: -> patch review ___ Python tracker ___ ___

[issue26747] types.InstanceType only for old style class only in 2.7

2016-04-13 Thread Nan Wu
New submission from Nan Wu: >>> import types >>> a = 1 >>> isinstance(a, types.InstanceType) False >>> class A: ... pass ... >>> a = A() >>> isinstance(a, types.InstanceType) True >>> class A(object): ... pass ... >>> a = A() >>> isinstance(a, types.InstanceType) False Looks like isins

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: Demur Rumed: Is the peephole optimizer able to emit *two* EXTENDED_ARG for jump larger than 16 bits? Currently, it only has to retry once to add EXTENDED_ARG if a jump is larger than 16 bits (to use 32-bit jump offset). --

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: > Updated wpy5.patch to use a more standard diff format (patch generated with > Mercurial, hg diff > patch). Crap, I forgot Python/wordcode_helpers.h. I updated a fixed wpy6.patch. -- Added file: http://bugs.python.org/file42455/wpy6.patch __

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file42454/wpy5.patch ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: Updated wpy5.patch to use a more standard diff format (patch generated with Mercurial, hg diff > patch). -- Added file: http://bugs.python.org/file42454/wpy5.patch ___ Python tracker

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-13 Thread Demur Rumed
Demur Rumed added the comment: Made changes from code review, did a little extra on fixing up type consistency, not sure if this is exactly the patch format you wanted; I tried `git difftool --extcmd='diff -u' python/master` but it's listing the original files as being from /tmp I've updated

[issue26057] Avoid nonneeded use of PyUnicode_FromObject()

2016-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your review Martin. -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker __

[issue26057] Avoid nonneeded use of PyUnicode_FromObject()

2016-04-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3f3b3d4881f6 by Serhiy Storchaka in branch 'default': Issue #26057: Got rid of nonneeded use of PyUnicode_FromObject(). https://hg.python.org/cpython/rev/3f3b3d4881f6 -- nosy: +python-dev ___ Python track

[issue26718] super.__init__ leaks memory if called multiple times

2016-04-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue26718] super.__init__ leaks memory if called multiple times

2016-04-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 450f36750cb9 by Serhiy Storchaka in branch '3.5': Issue #26718: super.__init__ no longer leaks memory if called multiple times. https://hg.python.org/cpython/rev/450f36750cb9 New changeset 4680438f486f by Serhiy Storchaka in branch '2.7': Issue #267

[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-13 Thread Petr Viktorin
Petr Viktorin added the comment: Indeed, the size is 0 there: {'family': 'DejaVu Sans Mono', 'size': 0, 'slant': 'roman', 'weight': 'normal', 'overstrike': 0, 'underline': 0} -- ___ Python tracker ___

[issue15984] Wrong documentation for PyUnicode_FromObject() and PyUnicode_FromEncodedObject()

2016-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. Thank you Martin for this improvement. -- assignee: docs@python -> martin.panter stage: patch review -> commit review ___ Python tracker ___

[issue26746] struct.pack(): trailing padding bytes on x64

2016-04-13 Thread Stefan Krah
Stefan Krah added the comment: Thank you. So technically, in the above NumPy example the format string generated by NumPy would be considered incomplete if we assume struct syntax: >>> m = memoryview(x) >>> m.format 'T{B:x:xxxL:y:B:z:}' I find this "0L" thing a very odd notation. Taking c

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-13 Thread Mark Dickinson
Mark Dickinson added the comment: The output of `struct.pack(' ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%4

[issue26057] Avoid nonneeded use of PyUnicode_FromObject()

2016-04-13 Thread Martin Panter
Martin Panter added the comment: Apart from one redundancy (see review), this looks good to me. -- ___ Python tracker ___ ___ Python-b

[issue15984] Wrong documentation for PyUnicode_FromObject() and PyUnicode_FromEncodedObject()

2016-04-13 Thread Martin Panter
Martin Panter added the comment: Here is a new version where I use the phrase “true Unicode object”. -- Added file: http://bugs.python.org/file42452/from_object_v4.patch ___ Python tracker _

[issue26744] print() function hangs on MS-Windows 10

2016-04-13 Thread Ma Lin
Ma Lin added the comment: I'm afraid not. If run it 1000 times, only about <5 times occurs, the others are quite fine. I have installed faulthandler, let's wait the hunting. -- ___ Python tracker _

[issue26744] print() function hangs on MS-Windows 10

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: > In addition, the printed strings are Simplified Chinese, my system's language > is it as well. Maybe it's a factor? Ooh yes. The Windows Console sucks to display Unicode: see the very old issue #1602 which is not fixed yet and is 9 years old... Try to r

[issue26746] struct.pack(): trailing padding bytes on x64

2016-04-13 Thread Martin Panter
Martin Panter added the comment: This behaviour seems to be documented, although it is not very explicit, and a bit surprising to me. See the third note at the end of : “align the end . . . with a repeat count of zero

[issue3132] implement PEP 3118 struct changes

2016-04-13 Thread Stefan Krah
Changes by Stefan Krah : -- versions: +Python 3.6 -Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue3132] implement PEP 3118 struct changes

2016-04-13 Thread Stefan Krah
Stefan Krah added the comment: Here's a grammar that roughly describes the subset that NumPy supports. As for implementing this in the struct module: There is a new data description language on the horizon: http://datashape.readthedocs.org/en/latest/ It does not have all the low-level capab

[issue26744] print() function hangs on MS-Windows 10

2016-04-13 Thread Ma Lin
Ma Lin added the comment: >> It looks like a bug in your application. Can you provide a short script to >> reproduce the bug? It's hard to believe it, the code has no way to behavior like that. I think this is not reproducible, it's random hang. As my subjective feelings, I suspect it's a Wind

[issue26744] print() function hangs on MS-Windows 10

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: > To be honest, I'm a bit suprise that almost no one complain it, maybe it's my > system's fault? I don't know. It looks like a bug in your application. Can you provide a short script to reproduce the bug? -- ___ P

[issue26744] print() function hangs on MS-Windows 10

2016-04-13 Thread Ma Lin
Ma Lin added the comment: ok, I will try faulthandler module. >> Are you running your program in the Windows console (cmd.exe)? In IDLE? In >> PowerShell? One runs in pure command line mode, cmd.exe. The other is a simple tkinter GUI with a console for output message. To be honest, I'm a bit

[issue26744] print() function hangs on MS-Windows 10

2016-04-13 Thread STINNER Victor
STINNER Victor added the comment: > I have two programs, they occasionally infinite hang. Can you please try the faulthandler module to try to get a traceback of all Python threads? I suggest to use the watchdog with a short timeout (ex: 60 seconds): https://docs.python.org/dev/library/faultha

[issue26744] print() function hangs on MS-Windows 10

2016-04-13 Thread Ma Lin
Ma Lin added the comment: After my MS-Windows 10 updated to 10586.218 this day, it occurs again. It hung, the console cursor was flashing at the beginning of the current line. I pressed ENTER key on the console window, then it printed the supposed content and went on. I have read issue26624, i

[issue26746] struct.pack(): trailing padding bytes on x64

2016-04-13 Thread Stefan Krah
New submission from Stefan Krah: On the x64 architecture gcc adds trailing padding bytes after the last struct member. NumPy does the same: >>> import numpy as np >>> >>> t = np.dtype([('x', 'u1'), ('y', 'u8'), ('z', 'u1')], align=True) >>> x = np.array([(1, 2, 3)], dtype=t) >>> x.tostring() b

[issue1322] Deprecate platform.dist() and platform.linux_distribution() functions

2016-04-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: The idea is to have similar functionality implemented as a PyPI package, which can be updated more often than the stdlib. Unlike Windows and Mac OS X, the approach to finding out the distribution version is changing too often on Linux (w/r to how Python rele

[issue1322] Deprecate platform.dist() and platform.linux_distribution() functions

2016-04-13 Thread leycec
leycec added the comment: Deprecating platform.linux_distribution() while retaining platform.win32_ver() and platform.mac_ver() is non-orthogonal, unjustifiable, and (arguably) discriminatory. Platform version detection is no more a moving target under Linux than under Windows or OS X -- poss