[issue24921] Operator precedence table in 5.15 should be highest to lowest precedence
New submission from Joseph Schachner: We should not make people who need to read Python documentation do an extra transformation in their heads to correctly understand that in section 5.15 higher precedence is at the bottom of the table and lower precedence is at the top. Because the documentation has this table inverted from the way it is usually presented in other references, one of the top hits in a Google search shows an instructor felt the need to make a version in the usual high to low precedence order to show students, see: http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html That version is so much more comfortable for me to read, it seems almost strange, but it is true. Please consider changing section 5.15 so it would not need the top paragraph explaining that the table order is not what the reader probably expects, instead just present the table as at the link above - in the order the reader does expect - higher precedence on top, lower on the bottom. That only needs two short sentences of explanation that don't make the reader think wait ... what? -- assignee: docs@python components: Documentation messages: 249046 nosy: Joseph Schachner, docs@python priority: normal severity: normal status: open title: Operator precedence table in 5.15 should be highest to lowest precedence versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24921 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24907] Module location load order is not respected if pkg_resources is imported and a namespace is declared
Vadim Kantorov added the comment: From my (novice) standpoint, it's very weird that importing pkg_resources in a module's __init__.py causes Python to deviate from its core module import rules / sequence. Would you consider reporting this issue to pkg_resources's authors more appropriate? -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24907 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24922] assertWarnsRegex doesn't allow multiple warning messages
New submission from Cal Leeming: There was a discussion/patch in #9754 [1]. This allows for multiple warning types as a tuple, e.g.; self.assertWarnsRegex((DeprecationWarning, RuntimeWarning), ^E1000:) However, it does not allow testing for multiple warning messages, e.g.; expect = ((UserWarning, ^W1000), (UserWarning, ^W1001)) self.assertWarnsRegex(*expect) This is slightly unexpected, as `test.support.check_warnings` allows this behaviour, e.g. expect = ((UserWarning, ^W1000), (UserWarning, ^W1001)) check_warnings(*expect) Therefore I am proposing that `assertWarnsRegex` and `assertWarns` are modified to reflect the behaviour of `check_warnings`, whilst ensuring backwards compatibility. (e.g. if arg[0] is tuple, use new approach, otherwise use old approach). [1]: http://bugs.python.org/issue9754 -- components: Interpreter Core messages: 249048 nosy: sleepycal priority: normal severity: normal status: open title: assertWarnsRegex doesn't allow multiple warning messages type: behavior versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24922 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24907] Module location load order is not respected if pkg_resources is imported and a namespace is declared
R. David Murray added the comment: Yes, unless you can identify a python bug yourself. I believe pkg_resources does a bunch of imports when it is imported, so I'm not really surprised that it has an effect on the order in which things are imported. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24907 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24915] Profile Guided Optimization active by-default
Changes by Alecsandru Patrascu alecsandru.patra...@intel.com: Added file: http://bugs.python.org/file40238/python2.7-pgo-v02-mac.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24915 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24915] Profile Guided Optimization active by-default
Alecsandru Patrascu added the comment: I modified the patches after the review made by Brett (python2.7-pgo-v02.patch and python3.6-pgo-v02.patch): - removed the call to pybench - left the PGO steps as optional. To use it we run make profile-opt - in the initial patches, I left out test_hashlib because in our benchmarks we did not see any gain by applying PGO to the hash functions. It is not harmful and we can let it there or skip it. Nevertheless, in order not to create confusions about it, I removed that parameter from the patch. I also added the patches for Mac exclusively (python2.7-pgo-v02-mac.patch and python3.6-pgo-v02-mac.patch). You must have llvm-profdata installed and in your path (in /Library/Developer/CommandLineTools/usr/bin/) to use it. I tested on Yosemite and it compiles fine with clang. I am working on a generic version (configure and Makefile patches) to merge all these platforms and will post them as soon as it is done. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24915 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24915] Profile Guided Optimization active by-default
Stefan Krah added the comment: My initial reaction is that the default should be optimized for short build times. I would not want to type disable-profile-opt every time I'm running the tests. -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24915 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24907] Module location load order is not respected if pkg_resources is imported and a namespace is declared
R. David Murray added the comment: To be clear: I believe it imports things that are not in the standard library, based on scanning sys.path. But I haven't studied the code in depth, so I could be wrong. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24907 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24915] Profile Guided Optimization active by-default
Changes by Alecsandru Patrascu alecsandru.patra...@intel.com: Added file: http://bugs.python.org/file40237/python3.6-pgo-v02.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24915 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24921] Operator precedence table in 5.15 should be highest to lowest precedence
Stefan Krah added the comment: Yacc uses low to high. -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24921 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24915] Profile Guided Optimization active by-default
Changes by Alecsandru Patrascu alecsandru.patra...@intel.com: Added file: http://bugs.python.org/file40236/python2.7-pgo-v02.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24915 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Sandboxing Python
On Saturday, August 22, 2015 at 11:58:30 PM UTC-4, Laura Creighton wrote: Ned Batchelder has researched this one quite a bit, see: see: http://nedbatchelder.com/blog/201206/eval_really_is_dangerous.html http://nedbatchelder.com/blog/201302/looking_for_python_3_builtins.html http://nedbatchelder.com/blog/201302/finding_python_3_builtins.html Laura When I saw the subject line, I was going to jump in, but it looks like maybe I don't have to! :) What we use at edX for sandboxing Python is isolation of processes at the OS level, with AppArmor. We've encapsulated it in a library called CodeJail: https://github.com/edx/codejail --Ned. -- https://mail.python.org/mailman/listinfo/python-list
[issue24915] Profile Guided Optimization active by-default
Changes by Alecsandru Patrascu alecsandru.patra...@intel.com: Added file: http://bugs.python.org/file40239/python3.6-pgo-v02-mac.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24915 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24923] Append system paths in setup.py instead of prepending
New submission from Chris Hogan: Setup.py evaluates what's given in LDFLAGS and CPPFLAGS and CFLAGS. These variables are the usual mechanism to communicate custom paths/libs/defs to a build process. However, setup.py puts system paths in front of custom paths which makes it impossible to use these variables for providing search paths to overwrite system settings. This patch puts system paths at the end of the list to avoid this problem. Is there a rationale for prepending system paths? -- components: Build files: append-sys-paths.patch keywords: patch messages: 249054 nosy: christopher.hogan priority: normal severity: normal status: open title: Append system paths in setup.py instead of prepending type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file40240/append-sys-paths.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24923 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24926] Incorrect Example in HTMLParser.handle_comment(data)
New submission from Vineet Kumar Doshi: Hi, link : https://docs.python.org/2/library/htmlparser.html#HTMLParser.HTMLParser.handle_comment Incorrect Line : The content of Internet Explorer conditional comments (condcoms) will also be sent to this method, so, for !--[if IE 9]IE9-specific content![endif]--, this method will receive '[if IE 9]IE-specific content![endif]'. Corrected Line : The content of Internet Explorer conditional comments (condcoms) will also be sent to this method, so, for !--[if IE 9]IE9-specific content![endif]--, this method will receive '[if IE 9]IE9-specific content![endif]'. Please correct this mistake in the docs. Let me know, if it helps. Thanks Best Regards -- assignee: docs@python components: Documentation messages: 249063 nosy: docs@python, vineetkumardoshi priority: normal severity: normal status: open title: Incorrect Example in HTMLParser.handle_comment(data) type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24926 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24924] _posixsubprocess.c: sysconf() might not be async-signal-safe
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24924 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24925] Allow doctest to find line number of __test__ strings if formatted as a triple quoted string.
Changes by R. David Murray rdmur...@bitdance.com: Removed file: http://bugs.python.org/file40241/doctest_find__test__.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24925 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24925] Allow doctest to find line number of __test__ strings if formatted as a triple quoted string.
Changes by R. David Murray rdmur...@bitdance.com: Added file: http://bugs.python.org/file40242/doctest_find__test__.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24925 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: concurrent.futures vs gevent
Some people have tried to make a case that concurrent.futures should be adopted as a replacement wherever greenlet based algorithms are in use. However, my experience is that greenelts combined with concurrent.futures provides significant advantages. In other words, to a degree the two approaches complement each other. Specifically, 'greening' a ThreadPoolExecutor delivers the simplicity of either a context manager, or a map, depending on the use case, hadling in a few lines of simple Python what might have otherwise been a complex call-back or 'twisted' solution. Please note, this usage applies only to ThreadPool, not ProcessPool. for example: import eventlet eventlet.patcher.monkey_patch(os=False, socket=True, select=True, thread=True) futures = eventlet.import_patched('concurrent.futures') # 'greening' futures, fut_tp_exec = futures.ThreadPoolExecutor # the lines above enable even nested map / context manager 'futures' # adding the lines below enables a vast number of 'simultaneous' HTTP requests. import requests req_f_sess = eventlet.import_patched('requests_futures.sessions') # 'green' req o_rest_sess = req_f_sess.FuturesSession(executor=fut_tp_exec(max_workers=5000)) -- https://mail.python.org/mailman/listinfo/python-list
[issue24915] Profile Guided Optimization active by-default
Brett Cannon added the comment: the v02 patches LGTM. I'm fine with seeing those committed as-is knowing Alecsandru is actively working towards Clang support. -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24915 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19469] Duplicate namespace package portions (but not on Windows)
Brett Cannon added the comment: OK, if someone finds a way to reproduce the bug in the next week then we will keep this open as active, else I'm closing it as out-of-date. -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19469 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24926] Incorrect Example in HTMLParser.handle_comment(data)
Roundup Robot added the comment: New changeset 6eb5e59886e1 by R David Murray in branch '3.4': #24926: Fix typo in example. https://hg.python.org/cpython/rev/6eb5e59886e1 New changeset ae9a9f201870 by R David Murray in branch '3.5': Merge: #24926: Fix typo in example. https://hg.python.org/cpython/rev/ae9a9f201870 New changeset ccde4da4d0de by R David Murray in branch 'default': Merge: #24926: Fix typo in example. https://hg.python.org/cpython/rev/ccde4da4d0de -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24926 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24927] multiprocessing.Pool hangs forever on segfault
Changes by Jonas Obrist ojiido...@gmail.com: Added file: http://bugs.python.org/file40248/process_segfault.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24927 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24926] Incorrect Example in HTMLParser.handle_comment(data)
Roundup Robot added the comment: New changeset ff53dbcdc85f by R David Murray in branch '2.7': #24926: Fix typo in example. https://hg.python.org/cpython/rev/ff53dbcdc85f -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24926 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24927] multiprocessing.Pool hangs forever on segfault
New submission from Jonas Obrist: When using multiprocessing.Pool, if the function run in the pool segfaults, the program will simply hang forever. However when using multiprocessing.Process directly, it runs fine, setting the exitcode to -11 as expected. I would expect the Pool to behave similar to Process, or at the very least an exception to be raised instead of just silently hanging forever. I was able to reproduce this issue both on Linux (Ubuntu 15.04) and Mac OS X. -- files: pool_segfault.py messages: 249068 nosy: Jonas Obrist, jnoller, sbt priority: normal severity: normal status: open title: multiprocessing.Pool hangs forever on segfault type: behavior versions: Python 3.4 Added file: http://bugs.python.org/file40243/pool_segfault.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24927 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Using urlopen in Python2 and Python3
In Python2 urlopen is part of urllib, but in Python3 it is part of urllib.request. I solved this by the following code: from platform import python_version if python_version()[0] '3': from urllib import urlopen else: from urllib.request import urlopen -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list
[issue24926] Incorrect Example in HTMLParser.handle_comment(data)
R. David Murray added the comment: Thanks for the report. -- nosy: +r.david.murray resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24926 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16123] IDLE - deprecate running without a subprocess
Terry J. Reedy added the comment: Torgil, thank you for the interesting feedback. I will respond to your four paragraphs slightly out of order. 1. Starting Idle with '-n', I verified that running 'print(a)' from the editor works after entering 'a=1' in the shell. The intended purpose of the editor is to edit files that run as is. From this viewpoint, the carryover behavior is a bug. Idle's original single process mode, now accessed with -n, only remains because communicating with a subprocess via sockets turns out to be a bit unreliable. 3. Using an editor as a extension of the shell is an alternate use. It does not have to be tied to -n. I have been thinking about alternate run modes and added 'run as input' to my list. A useful version might be this: don't require a name for the editor buffer; don't restart; enter each statement at a prompt and run as if typed. The latter would make all the code run in Shell visible and add each statement to the history list. 2. I am a bit puzzled by your matlab comment. When tkinter code is run from editor in a separate process, it successfully grabs keyboard and mouse input. (One of the reasons for the shift from 1 to 2 processes was to disentangle user tkinter guis from the Idle tkinter gui.) On the other hand, running import msvcrt; k = msvcrt.kbhit() on Windows does not work with either 1 or 2 processes because the Idle gui retains input focus. If you want to pursue this, please open a new issue on the tracker or post to the idle-sig list or its news.gmane.org mirror gmane.comp.python.idle. In either case, say more about what 'not work' means. 4.This issue was opened before PEP 434 and before 2.7 maintenance was extended from 5 years (expiring now as 3.5 is released) to 10 years. Hence the deprecation notice was not added to 2.7. I do not expect this to change. -- versions: +Python 3.6 -Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16123 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Using urlopen in Python2 and Python3
On Monday, August 24, 2015 at 1:14:20 PM UTC-4, Cecil Westerhof wrote: In Python2 urlopen is part of urllib, but in Python3 it is part of urllib.request. I solved this by the following code: from platform import python_version if python_version()[0] '3': from urllib import urlopen else: from urllib.request import urlopen A less specific technique is: try: from urllib import urlopen except ImportError: from urllib.request import urlopen Even better, the six package, which helps with 2/3 compatibility, provides this: from six.moves.urllib.request import urlopen which works on both 2 and 3. --Ned. -- https://mail.python.org/mailman/listinfo/python-list
Re: Using urlopen in Python2 and Python3
On Monday 24 Aug 2015 19:37 CEST, Ned Batchelder wrote: On Monday, August 24, 2015 at 1:14:20 PM UTC-4, Cecil Westerhof wrote: In Python2 urlopen is part of urllib, but in Python3 it is part of urllib.request. I solved this by the following code: from platform import python_version if python_version()[0] '3': from urllib import urlopen else: from urllib.request import urlopen A less specific technique is: try: from urllib import urlopen except ImportError: from urllib.request import urlopen Even better, the six package, which helps with 2/3 compatibility, provides this: from six.moves.urllib.request import urlopen which works on both 2 and 3. Implemented. Thanks. At the moment I also use: from __future__ import division, print_function . . . # To work with Python2 the flush is a seperate statement print('It took {0:.5f} seconds'.format(end_time - start_time)) sys.stdout.flush() Would it be better to use: from six import print_ . . . print_('It took {0:.5f} seconds'.format(end_time - start_time), flush = true) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list
[issue24928] mock.patch.dict spoils order of items in collections.OrderedDict
New submission from Alexander Oblovatniy: Hi! Current implementation of `patch.dict` spoils order of items in `collections.OrderedDict`, because it explicitly converts passed `values` to `dict` (https://github.com/python/cpython/blob/923527f560acd43d4cc11293060900e56c7cb39b/Lib/unittest/mock.py#L1559-L1560): ```python # support any argument supported by dict(...) constructor self.values = dict(values) ``` Most obvious way is to check if `values` is an instance of `dict`. If it's not, then we need to convert it to dict: ```python if not isinstance(values, dict): values = dict(values) self.values = values ``` This will work for `OrderedDict`, because it's a subclass of `dict`. But this will not work for `UserDict.UserDict`, `UserDict.DictMixin`, `collections.MutableMapping`, etc., because they do not subclass `dict`. So, better way is to less strict check and look if `values` implements `dict`-like interface, e.g.: ```python if not hasattr(values, 'update'): values = dict(values) self.values = values ``` Here is a question existence of what attrs to check. Any ideas? Thanks! -- components: Library (Lib) messages: 249069 nosy: Alexander Oblovatniy priority: normal severity: normal status: open title: mock.patch.dict spoils order of items in collections.OrderedDict type: behavior versions: Python 2.7, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24928 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24928] mock.patch.dict spoils order of items in collections.OrderedDict
Alexander Oblovatniy added the comment: Hi! Current implementation of `patch.dict` spoils order of items in `collections.OrderedDict`, because it explicitly converts passed `values` to `dict` (https://github.com/python/cpython/blob/923527f560acd43d4cc11293060900e56c7cb39b/Lib/unittest/mock.py#L1559-L1560): # support any argument supported by dict(...) constructor self.values = dict(values) Most obvious way is to check if `values` is an instance of `dict`. If it's not, then we need to convert it to dict: if not isinstance(values, dict): values = dict(values) self.values = values This will work for `OrderedDict`, because it's a subclass of `dict`. But this will not work for `UserDict.UserDict`, `UserDict.DictMixin`, `collections.MutableMapping`, etc., because they do not subclass `dict`. So, better way is to less strict check and look if `values` implements `dict`-like interface, e.g.: if not hasattr(values, 'update'): values = dict(values) self.values = values Here is a question existence of what attrs to check. Any ideas? Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24928 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24872] Add /NODEFAULTLIB:MSVCRT to _msvccompiler
Christoph Gohlke added the comment: Two findings regarding the new semi-static linking options: Distutils now creates libraries (.lib) that may not be readable by subsequent versions of Visual C++ https://msdn.microsoft.com/en-us/library/0zza0de8.aspx. Build times and static library sizes significantly increase to a point where it becomes impractical in some cases. For example, on my system, the zeromq package builds in 90 s on Python 3.4.3, while on Python 3.5rc1 it takes 470 s. Building HDF5 static libs with the new options takes 30 minutes (close to 100% CPU usage on 8 logical processors) compared to less than 5 minutes for the default options. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24872 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16379] SQLite error code not exposed to python
Daniel Shahaf added the comment: What's the reasoning behind offering a error code to name mapping? Allowing code that runs into an error to print the error name rather than its numeric value. This saves whoever reads the error message having to look it up himself. his seem problematic to me. In case a newer SQLite version introduces a new error code, this error code cannot be found in the mapping. I propose to leave this out in order to not have this problem. Otherwise we will have people depending on any error code being able to be found in this mapping. Then people shouldn't depend on the mapping being complete. Let's keep the mapping and document that people should only use it as `sqlite3.errorcode.get(...)`, never as `sqlite3.errorcode[...]`. Or if that's not a good API, we could encapsulate the incompleteness of the mapping into a small wrapper function: def something(errorcode): return sqlite3.errorcode.get(errorcode, sqlite3 error {!d}.format(errorcode)) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16379 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
ANN: ScratchABit - Interactive disassembler
Hello, ScratchABit is pure-Python, interactive disassembler (direct-manipulation, textmode UI), suitable for reverse engineering work of malware analysis, security research, developing open-source drivers, etc. ScratchABit is architecture-independent and supports particular CPU using plugins. Plugin API used is compatible with IDAPython, which is pretty much an industry standard and allow easy reuse of the wealth of plugins developed by community. A sample plugin for Intel x86 (32 or 64 bit) is included, based on pure-Python PyMsasid disassembly engine. ScratchABit is distributed as a git repository with submodules pulling in any required components (plugins), allowing quick start even for people who aren't familiar with Python (Python3 is the only requirement). Project is at version 0.9 currently. https://github.com/pfalcon/ScratchABit -- Best regards, Paul mailto:pmis...@gmail.com -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
Nikola 7.6.4 is out!
On behalf of the Nikola team, I am pleased to announce the immediate availability of Nikola v7.6.4. It fixes some bugs and adds new features. What is Nikola? === Nikola is a static site and blog generator, written in Python. It can use Mako and Jinja2 templates, and input in many popular markup formats, such as reStructuredText and Markdown — and can even turn Jupyter (IPython) Notebooks into blog posts! It also supports image galleries, and is multilingual. Nikola is flexible, and page builds are extremely fast, courtesy of doit (which is rebuilding only what has been changed). Find out more at the website: https://getnikola.com/ Downloads = Install using `pip install Nikola` or download tarballs on [GitHub][] and [PyPI][]. [GitHub]: https://github.com/getnikola/nikola/releases/tag/v7.6.4 [PyPI]: https://pypi.python.org/pypi/Nikola/7.6.4 Changes === Features * Checking remote links also checks redirects (nikola check -lr) * Update suggested license to its latest version (Issue #1950) * Add Punjabi language, by Jasdeep Singh (Issue #1940) * New option to use custom, and several ``TEASER_END`` values Bugfixes * Rewrite srcset links (Issue #1939) * Add dependencies for include tag in Mako (Issue #1956) * Don’t duplicate BLOG_TITLE in the front page title (Issue #1952) * Escape instead of strip HTML in titles (Issue #1952) * Make LINK_CHECK_WHITELIST apply to remote link checks * Make STORY_INDEX work together with PRETTY_URLS (Issue #1949) * Refactor new_post to match lazy plugin loading (Issue #1943) * Make Nikola startup faster by not loading useless plugins (Issue #1825) * Ignore sliced multibyte characters when reading metadata for sitemaps * Fix NameError caused by failed import in auto plugin. -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
Exception AttributeError: 'NoneType' object has no attribute 'population'
Hi all, I am a python learner. I encountered a problem when i was testing the following code. What is strange is that if I replace the object name with zhang, the program would be ok. And if I replace the Person.population with self.__class__.population, it will also be ok. So what is the matter? Here is the code, #!/usr/bin/python # Filename: objvar.py class Person: population = 0 def __init__(self, name): self.name = name print '(Initializing %s...)' % self.name Person.population += 1 def __del__(self): print '%s says bye.' % self.name Person.population -= 1 if Person.population == 0: print 'I am the last one.' else: print 'There are still %d people left.' % Person.population def sayHi(self): print 'Hi, my name is %s.' % self.name def howMany(self): if Person.population == 1: print 'I am the only person here.' else: print 'We have %d persons here.' % Person.population zhangsan = Person('Swaroop') zhangsan.sayHi() zhangsan.howMany() lisi = Person('LiSi') lisi.sayHi() lisi.howMany() zhangsan.sayHi() zhangsan.howMany()-- https://mail.python.org/mailman/listinfo/python-list
Update my Python library
I updated my Python library: https://github.com/CecilWesterhof/PythonLibrary/blob/master/utilDecebal.py One of the additions is time_fetchURLs. A function to display the needed time to receive a sequence of URLs from a server. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list
[issue24193] Make LOGGING_FORMAT of assertLogs configurable
Robert Collins added the comment: I don't know if or when it was moved, but right now: ./python -m pydoc unittest.case.TestCase.assertLogs ... the docs for it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24193 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24193] Make LOGGING_FORMAT of assertLogs configurable
Michael Foord added the comment: assertLogs is on a Python test suite helper, not TestCase itself. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24193 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Is this the way to go with SQLite
On Sunday 23 Aug 2015 16:03 CEST, Chris Angelico wrote: On Sun, Aug 23, 2015 at 11:18 PM, Cecil Westerhof ce...@decebal.nl wrote: Also an URL is unique, so I need to check that if it is found, the values are the same as the ones I wanted to insert. And if they aren't? Currently, all you do is print out a message and continue on; what happens if you get the same URL coming up more than once? That is all what I want at the moment: to get notified when an URL has two different descriptions. It is just a script to do an initial fill of the table. When run again I do not insert the URLs that are already in the database. But just skipping is not enough, when it has a different description I did something wrong and should investigate that. One thing I could do is when the only difference is case, that I use the latter definition and notify the change. select_url = '''SELECT year , month , description FROM LINKS WHERE URL = ?''' year= 2015 month = 8 PEP 8 has a word or two to say about this, but carry on. Something to read then. Incidentally, I'd be inclined to put the SELECT query down below, same as the INSERT query is; it's not in any way different from just using a string literal there, and this separates two pieces of code (IMO) unnecessarily. I am inclined to do the opposite: put the INSERT query where the SELECT is. Both will be used several times in the near future (next week) and I like DRY. Was an omission when I changed the code. I have taken care of that. for link in links: description = link[0] url = link[1] for description, url in links: url_values = c.execute(select_url, [url]).fetchall() if len(url_values) == 0: if not url_values: print('Adding {0}'.format(link)) c.execute('''INSERT INTO links (year, month, description, URL) VALUES (?, ?, ?, ?) ''', [year, month, description, url]) else: to_insert = (year, month, description) found = url_values[0] if found != to_insert: print('For {0} found {1} instead of {2}'.format(url, found, to_insert)) Implemented. Otherwise, looks reasonable. I'm normally expecting to see this kind of query, and if it isn't there, insert code to have an UPDATE in its other branch (which makes it into a classic upsert or merge operation - what MySQL calls INSERT... ON DUPLICATE KEY UPDATE), or else throw an error (in which case the cleanest way is to put a unique key on the column in question and let the database throw the In my case I do not want the old value changed. (Maybe with the exception if only the case is different.) I need to evaluate which value is the right one. error). The risk normally is of a race condition; you could execute your SELECT query, find no results, and then have someone else insert one just a moment before you do. But with SQLite, you're probably assuming no other writers anyway - an assumption which (I think) you can mandate simply by opening a transaction and holding it through the full update procedure - which would make this safe. I start with: conn = sqlite3.connect('links.sqlite') c = conn.cursor() and end with: conn.commit() conn.close() Taken from: https://docs.python.org/2/library/sqlite3.html This takes care of the transaction, or not? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list
Re: Is this the way to go with SQLite
On Mon, Aug 24, 2015 at 9:00 PM, Cecil Westerhof ce...@decebal.nl wrote: On Sunday 23 Aug 2015 16:03 CEST, Chris Angelico wrote: On Sun, Aug 23, 2015 at 11:18 PM, Cecil Westerhof ce...@decebal.nl wrote: Also an URL is unique, so I need to check that if it is found, the values are the same as the ones I wanted to insert. And if they aren't? Currently, all you do is print out a message and continue on; what happens if you get the same URL coming up more than once? That is all what I want at the moment: to get notified when an URL has two different descriptions. It is just a script to do an initial fill of the table. When run again I do not insert the URLs that are already in the database. But just skipping is not enough, when it has a different description I did something wrong and should investigate that. Sounds to me like you mostly want an error, but in some cases, you'll suppress the error (ie it's exactly the same description and datestamp). error). The risk normally is of a race condition; you could execute your SELECT query, find no results, and then have someone else insert one just a moment before you do. But with SQLite, you're probably assuming no other writers anyway - an assumption which (I think) you can mandate simply by opening a transaction and holding it through the full update procedure - which would make this safe. I start with: conn = sqlite3.connect('links.sqlite') c = conn.cursor() and end with: conn.commit() conn.close() Taken from: https://docs.python.org/2/library/sqlite3.html This takes care of the transaction, or not? Yep, I think so. If not, you should be able to ensure transactional integrity by simply adding an explicit BEGIN query. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[issue16123] IDLE - deprecate running without a subprocess
Torgil Svensson added the comment: I frequently use IDLE as an interactive shell to Python with the Editor attached. It's very nice for this purpose as it's lightweight and embedded in Python delivery. This is only possible with -n flag as without it each press on F5 will restart the interpreter and I lose all variables, graphs etc. Under 2.7 (not related to this thread) I'm also unable to use interactive graphs [ ion()] in matplotlib without the -n flag. Is there another way to run the module without restarting interpreter without the -n option? Will 2.7 be affected by this change in the future? -- nosy: +Torgil Svensson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16123 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Exception AttributeError: 'NoneType' object has no attribute 'population'
On 2015-08-24 06:49, 344276105 wrote: Hi all, I am a python learner. I encountered a problem when i was testing the following code. What is strange is that if I replace the object name with zhang, the program would be ok. And if I replace the Person.population with self.__class__.population, it will also be ok. So what is the matter? Here is the code, #!/usr/bin/python # Filename: objvar.py class Person: population = 0 def __init__(self, name): self.name = name print '(Initializing %s...)' % self.name Person.population += 1 def __del__(self): print '%s says bye.' % self.name Person.population -= 1 if Person.population == 0: print 'I am the last one.' else: print 'There are still %d people left.' % Person.population def sayHi(self): print 'Hi, my name is %s.' % self.name def howMany(self): if Person.population == 1: print 'I am the only person here.' else: print 'We have %d persons here.' % Person.population zhangsan = Person('Swaroop') zhangsan.sayHi() zhangsan.howMany() lisi = Person('LiSi') lisi.sayHi() lisi.howMany() zhangsan.sayHi() zhangsan.howMany() The error occurs because the program has finished and Python is cleaning up. Unfortunately, it looks like when the __del__ methods run, the Person class has already been cleaned up (Person is None at that point). It looks like that behaviour was fixed in Python 3.2. By the way, it's recommended that you use the latest version of Python 3 unless you require Python 2 because of some dependency on something that doesn't (yet?) work on Python 3. -- https://mail.python.org/mailman/listinfo/python-list
[issue24492] using custom objects as modules: AttributeErrors new in 3.5
Roundup Robot added the comment: New changeset 5a9ac801f9b4 by larry in branch '3.5': Merged in brettcannon/cpython350/3.5 (pull request #2) https://hg.python.org/cpython/rev/5a9ac801f9b4 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24492 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24928] mock.patch.dict spoils order of items in collections.OrderedDict
R. David Murray added the comment: Based on reading the patch.dict doct, I'm guessing that that dict call is making a copy in order to do a restore later. Perhaps replacing the dict call with a copy call would be sufficient? (I haven't looked at the dict.patch code). -- nosy: +r.david.murray, rbcollins ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24928 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python/Github
On Monday, August 24, 2015 at 2:16:55 PM UTC-7, Chris Rebert wrote: On Mon, Aug 24, 2015 at 1:14 PM, DBS davanand.bah...@gmail.com wrote: Hello, I'm trying to retrieve the number of commits and changed files on all pull requests submitted to a branch. The call to get all the pull requests is GET /repos/:owner/:repo/pulls, but it does not return commits or changed_files. The call that returns number of commits and changed files is GET /repos/:owner/:repo/pulls/:number. Any guidance on how I can modify the call below to include commits and changed files on all pull requests? #!/usr/bin/env python import json import requests snip Have you considered using a GitHub API Python library such as github3.py (https://github.com/sigmavirus24/github3.py ) rather than reinventing the wheel? Cheers, Chris -- http://chrisrebert.com Hello Chris, No I haven't. I didn't know it existed until now. I'm still in the midst of learning python. I will head over that way and read up on the documentation and give it a try. If I have any questions, I will come back and post :). Thanks again!! Thanks, DBS -- https://mail.python.org/mailman/listinfo/python-list
[issue24294] DeprecationWarnings should be visible by default in the interactive REPL
Robert Collins added the comment: Hi, just to say - I'm happy to help steer this through. I think its an important ecosystem fixup. -- nosy: +rbcollins ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24294 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24927] multiprocessing.Pool hangs forever on segfault
Jonas Obrist added the comment: So the reason this is happening is very simple: When using Pool.apply, the task (function) is sent to the task queue, which is consumed by the worker. At this point the task is in progress. However, the worker dies without being able to finish the task or in any other way tell the Pool that it can't finish the task. The actual process is then ended by the Pool but the task is still in limbo, so any attempt at getting a result will hang forever. I'm not sure there's a straight forward way to solve this (the ways I can think of from the top of my head involve adding quite a bit of overhead to the Pool so it keeps track of which process/worker is handling which task at a given time, so if it exits prematurely this task can be finished), but at the very least this case should be documented I think. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24927 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)
Gregory P. Smith added the comment: i'm updating the title to be more accurate. turning it on by default is likely not desirable as the makefile is primarily used by developers who are iterating on changes. but having it use a good workload (regrtest) and work with llvm and os x are good. :) -- nosy: +gregory.p.smith title: Profile Guided Optimization active by-default - Profile Guided Optimization improvements (better training, llvm support, etc) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24915 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Python/Github
Hello, I'm trying to retrieve the number of commits and changed files on all pull requests submitted to a branch. The call to get all the pull requests is GET /repos/:owner/:repo/pulls, but it does not return commits or changed_files. The call that returns number of commits and changed files is GET /repos/:owner/:repo/pulls/:number. Any guidance on how I can modify the call below to include commits and changed files on all pull requests? #!/usr/bin/env python import json import requests import datetime import sys import codecs sys.stdout = codecs.getwriter('utf8')(sys.stdout) sys.stderr = codecs.getwriter('utf8')(sys.stderr) OAUTH_KEY = xxx repos = ['my-repo'] # List pull request def list_pr(): for repo in repos: r = requests.get('https://api.github.com/repos/owner/%s/pulls' % repo, auth=('token', OAUTH_KEY)) data = r.json() for i in data: print \nUser: + i['user']['login'] + '\n' + Number: + str(i['number']) + '\n' + Time created: + i['created_at'] + '\n' + Title: + i['title'] + '\n' + Body: + i['body'] + '\n' list_pr() -- https://mail.python.org/mailman/listinfo/python-list
Re: Python/Github
On Mon, Aug 24, 2015 at 1:14 PM, DBS davanand.bah...@gmail.com wrote: Hello, I'm trying to retrieve the number of commits and changed files on all pull requests submitted to a branch. The call to get all the pull requests is GET /repos/:owner/:repo/pulls, but it does not return commits or changed_files. The call that returns number of commits and changed files is GET /repos/:owner/:repo/pulls/:number. Any guidance on how I can modify the call below to include commits and changed files on all pull requests? #!/usr/bin/env python import json import requests snip Have you considered using a GitHub API Python library such as github3.py (https://github.com/sigmavirus24/github3.py ) rather than reinventing the wheel? Cheers, Chris -- http://chrisrebert.com -- https://mail.python.org/mailman/listinfo/python-list
[issue24929] _strptime.TimeRE should not enforce range in regex
New submission from Steve Yeung: Currently, the regex in TimeRE enforces the numeric ranges. For example: 'm': r(?Pm1[0-2]|0[1-9]|[1-9]), As a result, an invalid month will cause an generic regex error: ValueError: time data '2015/16/5' does not match format '%Y/%m/%d' However, if we relax the regex to not check the range and allow datetime to handle it: 'm': r(?Pm\d{1,2}) The error will be handle in datetime instead and the error will be much more helpful: ValueError: month must be in 1..12 Please consider relaxing the regex for numeric ranges in _strptime.TimeRE. -- components: Library (Lib) messages: 249074 nosy: Steve Yeung priority: normal severity: normal status: open title: _strptime.TimeRE should not enforce range in regex type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24929 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24294] DeprecationWarnings should be visible by default in the interactive REPL
Robert Collins added the comment: On testing this - I don't think subprocess tests are necessarily needed. The scenarios are these (from Nick's comment): Test frameworks. - there are two in the standard library. unittest and doctest. - unittest's code paths end up going through 'TestProgram'. - doctest via 'testmod'. - so alter the warning configuration in those APIs to enable both DeprecationWarning and PendingDeprecationWarning. I don't think (right now anyhow :)) that we need a 'do not do this' flag in them.. Interactive REPL. This includes IDLE in my opinion. - there are three here IIRC - IDLE and the cPython and a helper module (which may or may not be the REPL for ./python - I haven't climbed through that code in ---ages---). - Again here I'd just enable DW in those code paths. Don't worry about whether its a tty or not: thats irrelevant. If the REPL enters, its the REPL and we should treat it like a user. If someone is driving the REPL programattically its likely one of: a remote session - so they should see it - or its a test harness - so they should see it. Everything else. Don't change anything here. On docs: yes, we should update the docs for: - each changed module - the warnings module itself. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24294 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: asyncio, coroutines, etc. and simultaneous execution
On 23.08.2015 23:43, Charles Hixson wrote: If I understand correctly asyncio, coroutines, etc. (and, of course, Threads) are not simultaneously executed, and that if one wants that one must still use multiprocessing. But I'm not sure. The note is still there at the start of threading, so I'm pretty sure about that one. The requirement that coroutines always be awaited seems to confirm this, but doesn't really say so explicitly. And the concurrent.futures can clearly be either, depending on your choices, but the chart in 18.5.3.1.3 Example: Chain coroutines is of a kind that I am more familiar with in the context of multiprocessing. (E.g., the only gap in the chart, which extends across all headings is when a result is being waited for during a sleep.) For threaded execution I would expect there to be a gap whenever processing is shifted from one column to another. If someone has authority to edit the documentation a comment like: If you want your application to make better use of the computational resources of multi-core machines, you are advised to use multiprocessing https://docs.python.org/3.5/library/multiprocessing.html#module-multiprocessing or concurrent.futures.ProcessPoolExecutor https://docs.python.org/3.5/library/concurrent.futures.html#concurrent.futures.ProcessPoolExecutor. However, threading is still an appropriate model if you want to run multiple I/O-bound tasks simultaneously. (to quote from the threading documentation) would be helpful at or very near the top of each of the appropriate modules. It would also be useful if the modules that were definitely intended to result in simultaneous execution, when feasible, were so marked quite near the top. OTOH, I may be mistaken about coroutines. I haven't been able to tell. P.S.: I do note that the threading comment was a *CPython implementation detail:*, and not a part of the Python specifications. But CPython is, I believe, a sufficiently dominant implementation that such details are quite important. We already have a discussion on python-ideas where we collected many many aspects on this particular subject. The results so far: https://mail.python.org/pipermail/python-ideas/2015-July/034813.html I know the table is a bit screwed but you will be able to handle that. Do you have anything you want to add to it? Cheers, Sven -- https://mail.python.org/mailman/listinfo/python-list
Python Developer- Houston, TX
Hi, Hope you are doing well !!! My name is Siva and I'm a recruiter at TheAppliedthought , a global staffing and IT consulting company. Please find the below job description which may suits any of your consultants who are available in market or who are looking for change, please send me latest updated resume along with contact details and expected hourly rate to my email id s...@theappliedthought.com or you can reach me on 407-574-7610. Position: Python Developer Location: Houston, TX Duration: Long Term Job Description *6+ years of experience with Linux/UNIX Systems Administration *2+ years of Openstack Experience *Hypervisor KVM, BIOS, Firmware update *Storage Technologies (NAS, SAN Cloud Storage) *Experience with configuration management tools (Chef expert!!) *Analytical problem-solving and conceptual skills *Strong scripting and/or development chops (Ruby, Python, Bash, Perl) *Experience with database technologies (MySQL, Percona, MongoDB) *Experience with automation (Chef etc.) and monitoring (Nagios, etc.) technologies in production setting *Experience with networking technologies including TCP/IP VPN DNS routing firewalls VLAN. *Excellent communication skills *Excellent team player Thanks Regards Siva Executive-Talent Acquisition Bench Sales Email: s...@theappliedthought.com IM: malladi sivaramakrishna88 Phone: 407-574-7610 Fax: 407-641-8184 -- https://mail.python.org/mailman/listinfo/python-list
[issue24305] The new import system makes it impossible to correctly issue a deprecation warning for a module
Larry Hastings added the comment: If this has been broken since 3.3, I don't think it's a release blocker for 3.5. I'm willing to consider it a bug and accept a fix, but I'd prefer it to be as low-risk as possible (aka the Python version). Can someone fix the regressions? And, if the C fix is better somehow, let's definitely get that into 3.6. -- priority: release blocker - deferred blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24930] test_ssl broker was fixed
R. David Murray added the comment: Most likely you ran the test using a different version of python from the one the test is from. All the tests in that file pass on our buildbots when run by the python version they are for. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24930 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24844] Python 3.5rc1 compilation error with Apple clang 4.2 included with Xcode 4
Larry Hastings added the comment: Please either mark as wontfix or send me a pull request. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24844 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24305] The new import system makes it impossible to correctly issue a deprecation warning for a module
Larry Hastings added the comment: The C implementation is making me nervous. My gut feeling is the Python implementation would be easier to get right. I still don't quite understand: what is the user-perceived result of this change? Module authors issuing a DeprecationWarning can now use stacklevel=2 instead of stacklevel=10? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24305] The new import system makes it inconvenient to correctly issue a deprecation warning for a module
Changes by Larry Hastings la...@hastings.org: -- title: The new import system makes it impossible to correctly issue a deprecation warning for a module - The new import system makes it inconvenient to correctly issue a deprecation warning for a module ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24931] _asdict breaks when inheriting from a namedtuple
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24931 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24911] Context manager of socket.socket is not documented
Changes by Berker Peksag berker.pek...@gmail.com: -- keywords: +easy stage: - needs patch type: - enhancement versions: +Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24911 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24931] _asdict breaks when inheriting from a namedtuple
Changes by Yury Selivanov yseliva...@gmail.com: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24931 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2786] Names in traceback should have class names, if they're methods
Robert Collins added the comment: Forgot docs - I'll do before committing, but not worried about review of them so much. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2786 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24305] The new import system makes it impossible to correctly issue a deprecation warning for a module
Nathaniel Smith added the comment: I still don't quite understand: what is the user-perceived result of this change? Module authors issuing a DeprecationWarning can now use stacklevel=2 instead of stacklevel=10? Exactly. There are a lot of deprecated modules in the wild, and the correct way to mark a module as deprecated is by writing warnings.warn(This module is deprecated!, stacklevel=2) at the top-level of your module. Except that in Python 3.3 you have to use stacklevel=10, and in Python 3.4 you have to use stacklevel=8, and I haven't checked what you need in Python 3.5 but it may well be different again, because it depends on internal implementation details of the import system. Fortunately AFAICT from some code searches no-one is actually depending on this though; instead everyone just writes stacklevel=2 and gets the wrong result. (This is made more urgent b/c people are increasingly relying on the stacklevel information to filter whether they even see the DeprecationWarning. E.g. I've seen multiple test suites which register a warnings filter that displays DeprecationWarnings iff they are attributed to the package-under-test, and IPython now shows deprecation warnings by default if the warning is attributed to interactive code -- see issue 24294. So there's a good chance that users will only find out that the module they are using is deprecated if the stacklevel= is set correctly.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21167] float('nan') returns 0.0 on Python compiled with icc
Changes by R. David Murray rdmur...@bitdance.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21167 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24930] test_ssl broker was fixed
Changes by marcos paulo marcos...@yahoo.com.br: -- title: fix - test_ssl broker was fixed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24930 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24931] _asdict breaks when inheriting from a namedtuple
New submission from Samuel Isaacson: When inheriting from namedtuples, _asdict and __dict__ return empty dictionaries: from collections import namedtuple class Point(namedtuple('_Point', ['x', 'y'])): pass a = Point(3, 4) print(a._asdict() == {}) gives False; it is True on Python 2.7.6 -- components: Library (Lib) messages: 249082 nosy: Samuel Isaacson priority: normal severity: normal status: open title: _asdict breaks when inheriting from a namedtuple type: behavior versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24931 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24931] _asdict breaks when inheriting from a namedtuple
Samuel Isaacson added the comment: Sorry; it returns True on Python 3.4, False on Python 2.7.6. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24931 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24844] Python 3.5rc1 compilation error with Apple clang 4.2 included with Xcode 4
Ned Deily added the comment: I don't think we should hold 3.5.0 for a patch for this. I recommend lowering the priority and targeting a patch for 3.5.1. -- priority: release blocker - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24844 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24930] test_ssl broker was fixed
marcos paulo added the comment: the version that i ran the test, is python 2.7.10 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24930 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24930] test_ssl broker was fixed
marcos paulo added the comment: anyway, this changes that i did, make this test more resilent! this test now is more complete than before! :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24930 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24305] The new import system makes it impossible to correctly issue a deprecation warning for a module
Nathaniel Smith added the comment: You're right, impossible is a slight exaggeration :-). As an alternative, every package could indeed carry around a table containing the details of importlib's call stack in every version of Python. (I also haven't checked whether it's consistent within a single stable release series. I guess we could add a rule that 3.5.x - 3.5.(x+1) cannot change the number of function calls inside the importlib callstack, because that is part of the public API, but I have less than perfect confidence that this rule has been enforced strictly in the past, and I don't think I'd want to be the one in charge of enforcing it in the future.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24930] fix
New submission from marcos paulo: Hello to everyone!!! This test https://hg.python.org/cpython/file/2.7/Lib/test/test_ssl.py on method ContextTests.test_options, is broker becouse has a error between lines 717 ~ 719; On 717 line, has a comment about # OP_ALL | OP_NO_SSLv2 is the default value, but it's not true, becouse this method is fail when i run it = py.test Lib/test/test_ssl.py -k ContextTests results === https://hg.python.org/cpython/file/2.7/Lib/test/test_ssl.py#l717 *** AssertionError: 2164261887 != 2197816319L I fixed this method and i wrote new cases about test_options using a lot of options from ssl.PROTOCOL, for example: ssl.PROTOCOL_TLSv1 ssl.PROTOCOL_TLSv1_1 ssl.PROTOCOL_TLSv1_2 ssl.PROTOCOL_SSLv2 ssl.PROTOCOL_SSLv23 ssl.PROTOCOL_SSLv3 on this test_options.patch, is the test fixed! thanks Att :-) marcosptf -- components: Library (Lib) files: test_options.patch keywords: patch messages: 249078 nosy: marcosptf priority: normal severity: normal status: open title: fix type: crash versions: Python 2.7 Added file: http://bugs.python.org/file40249/test_options.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24930 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2786] Names in traceback should have class names, if they're methods
Robert Collins added the comment: Ok, so this is an API and ABI change. I'm going to do a variant without that downside. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2786 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24847] Can't import tkinter in Python 3.5.0rc1
Larry Hastings added the comment: Pull request accepted and merged. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24847 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21167] float('nan') returns 0.0 on Python compiled with icc
Larry Hastings added the comment: Pull request accepted and merged. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21167 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2786] Names in traceback should have class names, if they're methods
Robert Collins added the comment: And herewith. -- Added file: http://bugs.python.org/file40250/issue-2786-1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2786 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24867] Asyncio Task.get_stack fails with native coroutines
Larry Hastings added the comment: Pull request accepted and merged. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24867 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24769] Interpreter doesn't start when dynamic loading is disabled
Larry Hastings added the comment: Yes, I'll accept this into 3.5.0, please send a pull request. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24769 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24305] The new import system makes it impossible to correctly issue a deprecation warning for a module
Larry Hastings added the comment: Is it really *impossible* to correctly issue a deprecation warning for a module, as the title asserts? Or does the new import system simply make it *tiresome*? if sys.version_info.major == 3 and sys.version_info.minor == 4: stacklevel = 8 elif sys.version_info.major == 3 and sys.version_info.minor == 4: stacklevel = 10 else: stacklevel = 2 # I bet they fixed it in 3.6! warnings.warn({} is deprecated.format(__name__), DeprecationWarning, stacklevel=stacklevel) That's Python for you, doing six impossible things before breakfast. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24847] Can't import tkinter in Python 3.5.0rc1
Changes by Larry Hastings la...@hastings.org: -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24847 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24789] ctypes doc string
Changes by Berker Peksag berker.pek...@gmail.com: -- keywords: +easy nosy: +berker.peksag stage: - needs patch type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24789 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24829] Use interactive input even if stdout is redirected
Martin Panter added the comment: I think Gnu Readline uses standard output for echoing input, prompts, controlling the cursor, etc. You can already see this by redirecting to a separate terminal. In Linux: $ python /dev/pts/2 So I think your assumption is not valid. Perhaps you can redirect standard error instead? (python -i . . . 2 output.txt, at least in Linux.) Or maybe use some terminal logging program, like the “script” Unix command. But I’m not sure there is a good use case for enabling Readline without a terminal to output to. -- nosy: +martin.panter ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24850] syslog.syslog() does not return error when unable to send the log
Martin Panter added the comment: I’ve never used syslog() in Python, but I thought I should point out that the standard Posix API does not do any error reporting either. See http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html: “The . . . functions shall not return a value. / No errors are defined.” -- nosy: +martin.panter ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24850 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24931] _asdict breaks when inheriting from a namedtuple
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file40251/nt_fix1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24931 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24932] Migrate _testembed to a C unit testing library
New submission from Nick Coghlan: Programs/_testembed (invoked by test_capi to test CPython's embedding support) is currently a very simple application with only two different embedding tests: https://hg.python.org/cpython/file/tip/Programs/_testembed.c In light of proposals like PEP 432 to change the interpreter startup sequence and make it more configurable, it seems desirable to be better able to test more configuration options directly, without relying on the abstraction layer provided by the main CPython executable. The specific unit testing library that prompted this idea was cmocka, which is used by libssh, sssd and cwrap: https://cmocka.org/ cwrap in turn is used by the Samba team to mock out network interfaces and other operations using LD_PRELOAD: https://cwrap.org/ We don't necessarily have to use those particular libraries, I'm just filing this issue to capture the idea of improving our C level unit testing capabilities, and then updating regrtest to better capture and report those results (currently there are just a couple of tests in test_capi that call the _testembed executable) -- components: Tests messages: 249106 nosy: encukou, eric.snow, ncoghlan priority: normal severity: normal status: open title: Migrate _testembed to a C unit testing library type: enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24932 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24808] PyTypeObject fields have incorrectly documented types
Roundup Robot added the comment: New changeset 54a9c649281d by Martin Panter vadmium in branch '3.4': Issue #24808: Update the documentation of some PyTypeObject fields https://hg.python.org/cpython/rev/54a9c649281d New changeset e81d692a00b1 by Martin Panter vadmium in branch '3.5': Issue #24808: Merge 3.4 into 3.5; adjust new tp_as_async field https://hg.python.org/cpython/rev/e81d692a00b1 New changeset 2637e2593f01 by Martin Panter vadmium in branch 'default': Issue #24808: Merge 3.5 into 3.6 https://hg.python.org/cpython/rev/2637e2593f01 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17781] optimize compilation options
Raymond Hettinger added the comment: I would like the see LTO enabled. The intermodule calls to code in abstract.c would become less expensive. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17781 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24928] mock.patch.dict spoils order of items in collections.OrderedDict
Raymond Hettinger added the comment: Perhaps replacing the dict call with a copy call would be sufficient? I think that would do it. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24928 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24769] Interpreter doesn't start when dynamic loading is disabled
Larry Hastings added the comment: I wanted to get this in to Python 3.5.0rc2, so I checked it in myself. Petr, I gave you credit in the checkin comment and Misc/NEWS. Hope that's okay! -- resolution: - fixed stage: commit review - resolved status: open - closed versions: +Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24769 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24931] _asdict breaks when inheriting from a namedtuple
Raymond Hettinger added the comment: For __dict__, I'm not sure what the right behavior should by for subclasses that don't define __slots__. In Python 3, the __dict__ is returning the dict for the subclass. This might be the correct and most desirable behavior: class Point(namedtuple('_Point', ['x', 'y'])): pass a = Point(3, 4) a.w = 5 a.__dict__ {'w': 5} If we leave the __dict__ behavior as is in Py3, then we still need to get _asdict() back to its documented behavior. For that, we would need to disconnect it from __dict__ by restoring the Py2.7 code for _asdict(): def _asdict(self): 'Return a new OrderedDict which maps field names to their values' return OrderedDict(zip(self._fields, self)) All this needs to be thought-out carefully. Putting in __dict__ support originally looked like a bugfix to get vars() working correctly, but it caused problems with pickling which then led to the addition of __getnewargs__. It seems that defining __dict__ leads to problems no matter how you do it. My inclination is to remove __dict__ and __getewargs__ from the namedtuple definition entirely and return to a simpler state of affairs that is easier to reason about and less likely to lead to unexpected behaviors like the one in this bug report. One note: using the Py2.7 namedtuple code in Python3 still doesn't restore the old behavior. Something else in the language appears to have changed (causing the subclasses' __dict__ to take precedence over the inherited __dict__ property). -- priority: normal - high versions: +Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24931 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24808] PyTypeObject fields have incorrectly documented types
Martin Panter added the comment: Most of this looks good. For the record, tp_flags was changed to unsigned in 3.4 (Issue 16086). The const and Py_ssize_t changes were done before 3.0. The only bits I would hesitate about are adding back the two comments saying “Assigned meaning in release 2”. These comments seem to have been removed from the Python 3 documentation in r67578, and I don’t see much point adding them back. I will have a go at committing the rest of the patch. (This is my first time making a commit.) -- assignee: docs@python - martin.panter nosy: +berker.peksag, martin.panter stage: - commit review versions: -Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10708] Misc/porting should be folded into the development FAQ or the devguide
Roundup Robot added the comment: New changeset 5b43ee3df43e by Berker Peksag in branch '3.5': Issue #10708: Add a link to devguide in Misc/Porting. https://hg.python.org/cpython/rev/5b43ee3df43e New changeset 23f4d8bf4f83 by Berker Peksag in branch 'default': Issue #10708: Add a link to devguide in Misc/Porting. https://hg.python.org/cpython/rev/23f4d8bf4f83 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10708 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Is your BI tool really intelligent ?
Is your #BI implementation ready to scale up for ALL of your future requirements? https://lnkd.in/ezeGr9b -- https://mail.python.org/mailman/listinfo/python-list