Running opencv-python script in sub-interpreter causes a hang

2017-05-07 Thread Ashwin Prasad
Hi, We are hosting the python interpreter(version 2.7.13) in a C application and calling a python function that has some calls to opencv-python functions (Representative code fragments are below). When the python function is called in the main interpreter, it works fine. However, when the it is

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Options like -fno-stack-limit and -fsplit-stack can help to avoid a crash, but they are compiler-specific and we should test how they affect the performance and memory consumption. How can we test that the available stack is too small? This is not a part of

[issue29447] Add/check os.PathLike support for the tempfile module's 'dir' arguments

2017-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't see any changes in tempfile.py. If the path-like protocol already is supported for the dir argument, no change in the documentation is needed. tempfile.mkdtemp(dir=pathlike.Path(''), pre=b'', suf=b'') should raise a TypeError, but add also tests for

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-05-07 Thread Louie Lu
Changes by Louie Lu : -- pull_requests: +1598 ___ Python tracker ___ ___ Python-bugs-list

[issue29447] Add/check os.PathLike support for the tempfile module's 'dir' arguments

2017-05-07 Thread Louie Lu
Changes by Louie Lu : -- pull_requests: +1599 ___ Python tracker ___ ___ Python-bugs-list

[issue30299] Display the bytecode when compiled a regular expression in debug mode

2017-05-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Whoops, the one I thought I added previously. I must not have clicked the [comment] button after writing it and before closing the tab. -- ___ Python tracker

[issue29447] Add/check os.PathLike support for the tempfile module's 'dir' arguments

2017-05-07 Thread Louie Lu
Louie Lu added the comment: @Brett, do you think if given a path-like dir, it should only be treated as `str`, or it could be `str` and `bytes`? My PR is now treated path-like dir as `str`, not `bytes`. This will affect at this places: tempfile.mkdtemp(dir=pathlike.Path(''), pre=b'',

[issue29990] Range checking in GB18030 decoder

2017-05-07 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +1597 ___ Python tracker ___ ___

Re: cgi.FieldStorage() not work for python requests.post but work for requests.get

2017-05-07 Thread 程淼
在 2017年5月5日星期五 UTC+8下午6:04:26,程淼写道: > 在 2017年5月5日星期五 UTC+8下午6:02:04,程淼写道: > > here is the client use get > > -- > > import json > > import requests > > > > url = "http://abc.com:11/ip; > > auth =

[issue11245] Implementation of IMAP IDLE in imaplib?

2017-05-07 Thread Kostis Anagnostopoulos
Kostis Anagnostopoulos added the comment: Before merging `imaplib2` please consider making proper use of the Python's standard `logging` module. -- nosy: +ankostis ___ Python tracker

[issue23702] docs.python.org/3/howto/descriptor.html still refers to "unbound methods"

2017-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll fix that up. I've already been working on revising the document. There are a number of updates needed (user-friendly intro, properties revised to show the setting methods, __set_name__, etc). -- assignee: docs@python -> rhettinger nosy:

[issue23702] docs.python.org/3/howto/descriptor.html still refers to "unbound methods"

2017-05-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: Be careful with the documentation patch. Although unbound method as an object type is gone, unbound method as a concept is not. Conceptually, something like ``MyClass.spam`` is an unbound method: it is a method of the MyClass type, but bound to no instance.

[issue30302] Improve .__repr__ implementation for datetime.timedelta

2017-05-07 Thread Utkarsh Upadhyay
Utkarsh Upadhyay added the comment: > This was discussed fairly recently: > That thread went deep and culminated here, as far as I can tell: https://marc.info/?l=python-dev=145077422417470=2 (I may not

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Serhiy, do you have any ideas for a non-invasive global solution to running out of C-stack? The GCC options for -fno-stack-limit and -fsplit-stack are one avenue. Another is to put in a periodic check in the c-eval loop to test whether available stack is

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: What makes this report unique is that it is the first one occurring in the wild (i.e. wasn't an example contrived solely for the purpose of producing a crash). Otherwise, we're not ever seeing this happen in real code. --

[issue30302] Improve .__repr__ implementation for datetime.timedelta

2017-05-07 Thread Martin Panter
Martin Panter added the comment: This was discussed fairly recently: . There seems to be a bit of support for changing this. It is not a bug fix, so has to go into the next release, now 3.7. I disagree

Re: SQLObject 3.3.0

2017-05-07 Thread sum abiut
Thanks for the info On Mon, May 8, 2017 at 1:25 AM, Oleg Broytman wrote: > Hello! > > I'm pleased to announce version 3.3.0, the first stable release of branch > 3.3 of SQLObject. > > > What's new in SQLObject > === > > Features > > > * Support for

[issue30302] Improve .__repr__ implementation for datetime.datetime.timedelta

2017-05-07 Thread Utkarsh Upadhyay
Utkarsh Upadhyay added the comment: > The drawback is that this change increases the length of the repr. I would argue that it is a reasonable trade-off given the increase in ease of understanding. I know that this is a weak argument, but, keywords are not without precedent. Consider the

[issue30299] Display the bytecode when compiled a regular expression in debug mode

2017-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What the review note you mean Terry? -- ___ Python tracker ___ ___

[issue30302] Improve .__repr__ implementation for datetime.datetime.timedelta

2017-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The drawback is that this change increases the length of the repr. If you output few values in a row (for example output the repr of a list of timedeltas), this makes the output less readable. Users of datetime.timedelta know what arguments mean. If they

[issue30302] Improve .__repr__ implementation for datetime.datetime.timedelta

2017-05-07 Thread Utkarsh Upadhyay
Changes by Utkarsh Upadhyay : -- pull_requests: +1595 ___ Python tracker ___ ___

[issue30302] Improve .__repr__ implementation for datetime.datetime.timedelta

2017-05-07 Thread Utkarsh Upadhyay
New submission from Utkarsh Upadhyay: Currently, the default implementation of datetime.datetime.__repr__ (the default output string produced at the console/IPython) gives a rather cryptic output: from datetime import datetime as D D.fromtimestamp(1390953543.1) - D.fromtimestamp(1121871596) #

[issue30299] Display the bytecode when compiled a regular expression in debug mode

2017-05-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: The new output is the blank line and numbered lines, produced by the new dis function. The addition is specific to CPython's re module. Thus the doc for re.DEBUG remains "Display debug information about compiled expression." I think that the NEWS entry

[issue26336] Expose regex bytecode of compiled pattern object

2017-05-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: I changed the title because I believe a) the Python-level tuple of ints should be created on demand (I am not sure what the patch does); and b) the exposure should be done by an overt function rather than be an 'attribute', even if that is a front for a

[issue30301] “AttributeError: 'SimpleQueue' object has no attribute '_poll'”

2017-05-07 Thread Daniel Moore
New submission from Daniel Moore: I originally posted this as a question on StackOverflow thinking I was doing something wrong: http://stackoverflow.com/questions/43834494/python-3-6-attributeerror-simplequeue-object-has-no-attribute-poll/43835368#43835368 But I think I found the solution and

[issue14010] deeply nested filter segfaults

2017-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue30297 for yet one instance of this in starmap(). -- ___ Python tracker ___

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks as a duplicate of issue14010 (and many other issues). -- nosy: +serhiy.storchaka resolution: -> duplicate superseder: -> deeply nested filter segfaults ___ Python tracker

[issue30168] Class Logger is unindented in the documentation.

2017-05-07 Thread Vinay Sajip
Vinay Sajip added the comment: New changeset 55ace65eba587fe3cf3759a43cccf85214651971 by Vinay Sajip (Jim Fasarakis-Hilliard) in branch 'master': Closes bpo-30168: indent methods in Logger Class (#1295) https://github.com/python/cpython/commit/55ace65eba587fe3cf3759a43cccf85214651971

[issue30300] asyncio.Controller

2017-05-07 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- pull_requests: +1594 ___ Python tracker ___ ___

[issue30300] asyncio.Controller

2017-05-07 Thread Barry A. Warsaw
New submission from Barry A. Warsaw: Over in https://github.com/aio-libs/aiosmtpd we have a Controller class which is very handy for testing and other cases. I realized that this isn't really aiosmtpd specific, and with just a few tweaks it could be appropriate for the stdlib. I have a

[issue30145] Create a How to or Tutorial documentation for asyncio

2017-05-07 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm not sure this can be fixed reasonably. It would entail taking every possible iterator in all of Python and adding some sort of recursion depth check. That approach risks introducing bugs, risks breaking existing code that relies on heavy iteration

[issue30298] Weak deprecations for inline regular expression modifiers

2017-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: LGTM -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list

[issue30248] Using boolean arguments in the _json module

2017-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: This looks like a nice improvement. -- ___ Python tracker ___ ___

Cheetah 3.0

2017-05-07 Thread Oleg Broytman
Hello! I'm pleased to announce version 3.0.0, the first stable release of branch 3.0 of CheetahTemplate3. What's new in CheetahTemplate3 == Contributors for this release are Adam Karpierz and Jonathan Ross Rogers. Major features: - !!!THIS RELEASE REQUIRES

Cheetah 3.0

2017-05-07 Thread Oleg Broytman
Hello! I'm pleased to announce version 3.0.0, the first stable release of branch 3.0 of CheetahTemplate3. What's new in CheetahTemplate3 == Contributors for this release are Adam Karpierz and Jonathan Ross Rogers. Major features: - !!!THIS RELEASE REQUIRES

Re: I want to learn Python and how to benefit from the great Data Science packages - have some questions.

2017-05-07 Thread Chris Angelico
On Mon, May 8, 2017 at 2:34 AM, Dennis Lee Bieber wrote: > I can partly agree with one aspect... In comparison to my old life > with > versions of FORTRAN, wherein standards were roughly 10 years apart, each > standard tended to accept all of a previous standard,

[issue30296] Remove unnecessary tuples, lists, sets, and dicts from Lib

2017-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Jon, we usually try to avoid sweeping changes across the library and instead preference to focus on one module at a time (Guido calls this "holistic refactoring"). There is a risk of introducing bugs and of destabiliizing code that has sat untouched but

[issue30295] msvcrt SetErrorMode not documented

2017-05-07 Thread Eryk Sun
Changes by Eryk Sun : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___

[issue30295] msvcrt SetErrorMode not documented

2017-05-07 Thread Eryk Sun
Eryk Sun added the comment: msvcrt set_error_mode, CrtReportMode, CrtReportFile and the associated CRT constants should be documented for use with debug builds. Also, msvcrt is missing the set_error_mode constants _OUT_TO_DEFAULT, _OUT_TO_STDERR, _OUT_TO_MSGBOX, and _REPORT_ERRMODE.

[issue26336] Expose regex bytecode as attribute of compiled pattern object

2017-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue30299 which adds the output of decoded bytecode in debug mode. The format of the bytecode is implementation detail, it is irregular, new opcodes can be added, and the format of existing opcodes can be changed. Thus it is hard to support third-party

[issue30299] Display the bytecode when compiled a regular expression in debug mode

2017-05-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1593 ___ Python tracker ___ ___

[issue30299] Display the bytecode when compiled a regular expression in debug mode

2017-05-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch makes compiling a regular expression in debug mode (with the re.DEBUG flag) displaying the bytecode in human readable form (in addition to the syntax tree). For example: >>> re.compile('test_[a-z_]+', re.DEBUG) LITERAL 116 LITERAL 101

Re: I want to learn Python and how to benefit from the great Data Science packages - have some questions.

2017-05-07 Thread breamoreboy
On Sunday, May 7, 2017 at 8:21:01 AM UTC+1, Shivangi Motwani wrote: > Hey! > > Learn Python The Hard Way is good I cannot recommend LPTHW after the author had this https://learnpythonthehardway.org/book/nopython3.html to say late last year. The best of the rebuttals is here

[issue30298] Weak deprecations for inline regular expression modifiers

2017-05-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1592 ___ Python tracker ___ ___

Re: I want to learn Python and how to benefit from the great Data Science packages - have some questions.

2017-05-07 Thread breamoreboy
On Saturday, May 6, 2017 at 8:33:57 PM UTC+1, Rahim Shamsy wrote: > Hi, > > Hope you are well. I am currently in the process of learning the basics of > programming in Python, and was just checking if I am in the right direction. > I have experience programming in C++ and Java, and want to

[issue30298] Weak deprecations for inline regular expression modifiers

2017-05-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: There is a difference between handling inline modifiers in regular expressions between Python and all other regular expression engines that support inline modifiers. In other engines an inline modifier affect only the part of the pattern after it. It

ANN: distlib 0.2.5 released on PyPI

2017-05-07 Thread Vinay Sajip via Python-announce-list
I've just released version 0.2.5 of distlib on PyPI [1]. For newcomers, distlib is a library of packaging functionality which is intended to be usable as the basis for third-party packaging tools. The main changes in this release are as follows: * Changed regular expressions to be compatible

ANN: pandas v0.20.1 released

2017-05-07 Thread Tom Augspurger
Hi all, I'm happy to announce that pandas 0.20.0 and 0.20.1 have been released. Pandas 0.20.1 contains a single additional change from 0.20.0 for backwards compatibility with projects using pandas' utils methods. See https://github.com/pandas-dev/pandas/pull/16250. The full release notes for

[issue29447] Add/check os.PathLike support for the tempfile module's 'dir' arguments

2017-05-07 Thread Louie Lu
Louie Lu added the comment: Regards my words, some place need to changed to support PathLike, I'll test it tomorrow. -- ___ Python tracker ___

SQLObject 3.3.0

2017-05-07 Thread Oleg Broytman
Hello! I'm pleased to announce version 3.3.0, the first stable release of branch 3.3 of SQLObject. What's new in SQLObject === Features * Support for Python 2.6 is declared obsolete and will be removed in the next release. Minor features -- *

TASU 4.0.0 released

2017-05-07 Thread Juancarlo Añez
TATSU (the successor to Grako) is a tool that takes grammars in a variation of EBNF as input, and outputs memoizing (Packrat) PEG parsers in Python. Tatsu can compile a grammar stored in a string into a tatsu.grammars.Grammar object that can be used to parse any given input, much like the re

SQLObject 3.3.0

2017-05-07 Thread Oleg Broytman
Hello! I'm pleased to announce version 3.3.0, the first stable release of branch 3.3 of SQLObject. What's new in SQLObject === Features * Support for Python 2.6 is declared obsolete and will be removed in the next release. Minor features -- *

[issue30296] Remove unnecessary tuples, lists, sets, and dicts from Lib

2017-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: * Some functions that accept an arbitrary iterable first convert it to temporary list and iterate that list. In these cases there is no significant difference in memory usage between list comprehension and generator, but the variant with list comprehension

[issue30296] Remove unnecessary tuples, lists, sets, and dicts from Lib

2017-05-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: Is this unnecessary code churn? That's not a rhetorical question. Fixing code that isn't broken is not always a good idea. ``func()`` is not always identical to ``func()``, there are situations where there is a significant performance difference between the

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Sebastian Noack
Sebastian Noack added the comment: I just noticed that the segfault can also be reproduced with Python 2 [1]. So please ignore what I said before that this wouldn't be the case. While it is debatable whether using a lazy evaluated object with so many recursions is a good idea in the first

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Sebastian Noack
New submission from Sebastian Noack: If I run following code (on Python 3.5.3, Linux) the interpreter crashes with a segfault: def pbkdf2_bin(data, salt, iterations=1000, keylen=24, hashfunc=None): hashfunc = hashfunc or hashlib.sha1 mac = hmac.new(data, None, hashfunc) def

[issue29447] Add/check os.PathLike support for the tempfile module's 'dir' arguments

2017-05-07 Thread Louie Lu
Louie Lu added the comment: Since tempfile is relay on `os`, e.g. `file = _os.join.path(dir, pre+name+suf)`, it can directly accept dir as PathLike type, this should need to add test case for it. -- nosy: +louielu ___ Python tracker

[issue30296] Remove unnecessary tuples, lists, sets, and dicts from Lib

2017-05-07 Thread Jon Dufresne
New submission from Jon Dufresne: Lib has some patterns that could be easily discovered and cleaned up. Doing so will reduce the number of unnecessary temporary lists in memory and unnecessary function calls. It will also take advantage of Python's own rich features in a way that better dog

[issue30295] msvcrt SetErrorMode not documented

2017-05-07 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola': Also SEM_FAILCRITICALERRORS and other SEM_constants. They should as setting error mode on Windows for console applications is a pretty common use case (in fact ./Lib/test/libregrtest/setup.py uses it). -- assignee: docs@python components:

[issue30286] ctypes FreeLibrary fails on Windows 64-bit

2017-05-07 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > It's documented that the default conversion for integer arguments is a 32-bit > C int. [...] Whenever a pointer is returned, you must set the function's > restype. OK, clear. Closing this out. -- resolution: -> not a bug stage: -> resolved

[issue30291] Allow windows launcher to specify bit lengths with & without minor version

2017-05-07 Thread Steve Barnes
Steve Barnes added the comment: I believe that I have a fix in pull request #1488 for the following points, and have manually tested for them: - py Still defaults to highest py3 with 64 bits as the default - py -2/3.n-32 Still works or reports not present as appropriate - py -2/3.n-64 Works

[issue28087] macOS 12 poll syscall returns prematurely

2017-05-07 Thread STINNER Victor
STINNER Victor added the comment: You want to get poll() on macOS. I'm ok with that but I would like to see tests for it. We should remove the skip in the test. Ok, I will update my PR to just blacklist macOS 10.12.0 and 10.2.1, and reenable the test. I just have to find the Darwin versions. I

[issue30291] Allow windows launcher to specify bit lengths with & without minor version

2017-05-07 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +1590 ___ Python tracker ___

[ANN] Biovarase version 0..1

2017-05-07 Thread Beppe
[ANN] Biovarase Biovarase version 0.1 has been released. This is the first announcement about Biovarase on this list. Biovarase is an application to manage clinical quality control data. This is the Tkinter version. The purpose of Quality Control Assurance in a clinical laboratory is to allow

[issue30097] Command-line option to suppress "from None" for debugging

2017-05-07 Thread Martin Panter
Martin Panter added the comment: This proposal would be useful. My use case is for when an API suppresses an external exception context: >>> import os >>> try: ... os.environ["NEW_VARIABLE"] = bug # Hidden exception ... finally: ... del os.environ["NEW_VARIABLE"] # KeyError ...

[issue30287] cpython and Clang Static Analyzer

2017-05-07 Thread Дилян Палаузов
Дилян Палаузов added the comment: I forgot to pass --with-pydebug to ./configure in order to consider also the asserts. Here we go: scan-build ./configure --enable-loadable-sqlite-extensions --enable-ipv6 --with-system-expat --with-system-libmpdec --with-pydebug scan-build -o

[issue30294] ./configure, pydebug and pymalloc

2017-05-07 Thread Дилян Палаузов
Дилян Палаузов added the comment: ./configure --help also does not indicate, whether just "./configure" enables or disables IPv6, thread support, dtrace*, computed-gotos*, doc-strings*. The asterisk features, suggest replacing AC_ARG_WITH with AC_ARG_ENABLE, as there are only two states. For

Re: perl + python tutorial available for download

2017-05-07 Thread retsithortmdk
On Monday, June 30, 2008 at 9:45:18 AM UTC-7, Xah wrote: > my perl and python tutorial > > http://xahlee.org/perl-python/index.html > > is now available for download for offline reading. > Download link at the bottom. > >Xah > ∑ http://xahlee.org/ > > ☄ --

[issue30294] ./configure, pydebug and pymalloc

2017-05-07 Thread Дилян Палаузов
New submission from Дилян Палаузов: Providing that during ./configure Py_DEBUG can either be set or not, but there is no third state, which third state would justify calling ./configure --with-pydebug=lambda, --with-pydebug shall be renamed to --enable-pydebug . Likewise for --with-pymalloc ,

Re: I want to learn Python and how to benefit from the great Data Science packages - have some questions.

2017-05-07 Thread Shivangi Motwani
Hey! Learn Python The Hard Way is good, apart from that you can take Udacitie's Intro to Data Analysis: https://in.udacity.com/course/intro-to-data-analysis--ud170/ This will help you learn numpy and pandas which will be very useful. Hope that helps! On Sun, May 7, 2017 at 1:03 AM, Rahim

[issue30291] Allow windows launcher to specify bit lengths with & without minor version

2017-05-07 Thread Eryk Sun
Eryk Sun added the comment: I don't see a pressing need to support a -64 architecture suffix. If you run 3.6 and get a 32-bit version, you can assume there's no 64-bit version installed and error out if you need 64-bit. That said, supporting this suffix would make the interface and error

[issue29956] math.exp documentation is misleading

2017-05-07 Thread Mark Dickinson
Mark Dickinson added the comment: Can this be closed? -- ___ Python tracker ___ ___ Python-bugs-list mailing

Re: Why does Python want to read /proc/meminfo

2017-05-07 Thread Marko Rauhamaa
Dan Stromberg : > Also, don't be overly hard on SELinux. It's a relatively young > technology and may still adapt to such needs better in the future. SELinux suffers from big problems, the biggest being its lack of a proper methodology. There is no cookbook for developers

[issue30287] cpython and Clang Static Analyzer

2017-05-07 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for this. I took a look at the 5 reports for Objects/longobject.c, and I don't think there's any action to be taken on any of them. (Two false positives; two "dead assignments" that are used when asserts are enabled, and one division-by-zero that

[issue30291] Allow windows launcher to specify bit lengths with & without minor version

2017-05-07 Thread Steve Barnes
Steve Barnes added the comment: Also noted when looking at the code that the validate function, (validate_version), has a couple of issues: - It will allow python major versions 0-9 (at the moment only 2 or 3 are valid). - It will not allow minor versions with more than one digit so if/when