[issue32319] re fullmatch error with non greedy modifier

2017-12-13 Thread Daniel Hrisca
New submission from Daniel Hrisca : Consider this code snippet: from re import match, fullmatch pattern = '".+?"' string = '"hello" "again"' print(match(pattern, string)) print(fullmatch(pattern, string)) Which prints: <_sre.SRE_Match object; span=(0, 7),

[issue29469] AST-level Constant folding

2017-12-13 Thread INADA Naoki
Change by INADA Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue29469] AST-level Constant folding

2017-12-13 Thread INADA Naoki
INADA Naoki added the comment: New changeset 7ea143ae795a9fd57eaccf490d316bdc13ee9065 by INADA Naoki in branch 'master': bpo-29469: Move constant folding to AST optimizer (GH-2858) https://github.com/python/cpython/commit/7ea143ae795a9fd57eaccf490d316bdc13ee9065

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread Chris Angelico
On Thu, Dec 14, 2017 at 5:44 PM, Christian Gollwitzer wrote: > Am 14.12.17 um 02:55 schrieb Chris Angelico: >> >> On Thu, Dec 14, 2017 at 12:35 PM, Rick Johnson >> wrote: >>> >>> On Tuesday, December 12, 2017 at 10:42:54 PM UTC-6, eryk sun wrote:

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread Christian Gollwitzer
Am 14.12.17 um 02:55 schrieb Chris Angelico: On Thu, Dec 14, 2017 at 12:35 PM, Rick Johnson wrote: On Tuesday, December 12, 2017 at 10:42:54 PM UTC-6, eryk sun wrote: [...] That said, I don't see this feature as being very useful compared to just using "open

[issue32318] Remove "globals()" call from "socket.accept()"

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: IMHO we should add a private mask constant, see: https://github.com/python/cpython/pull/4231#issuecomment-351622381 -- ___ Python tracker

[issue32228] truncate() changes current stream position

2017-12-13 Thread Nitish
Change by Nitish : -- keywords: +patch pull_requests: +4747 stage: -> patch review ___ Python tracker ___

[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Nathaniel Smith
Nathaniel Smith added the comment: > In any case, in my opinion, it doesn't matter. `sys.set_coroutine_wrapper` > controls a single thread-local setting, > `sys.set_unawaited_coroutine_tracking` *also* controls a single thread-local > setting. Both of them have the exact

[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Yury Selivanov
Yury Selivanov added the comment: > So first... that's not how nursery.start_soon works :-). It actually takes an > async function, not a coroutine object. [..] Interesting, and I think I like it. I definitely understand the motivation to not tell users the difference

[issue32318] Remove "globals()" call from "socket.accept()"

2017-12-13 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +4746 stage: -> patch review ___ Python tracker ___

[issue32318] Remove "globals()" call from "socket.accept()"

2017-12-13 Thread Yury Selivanov
New submission from Yury Selivanov : socket.accept currently has this code: type = self.type & ~globals().get("SOCK_NONBLOCK", 0) which I believe is (a) bad Python style; (b) slows things down. -- components: +Library (Lib) nosy: +asvetlov, vstinner type: ->

[issue32318] Remove "globals()" call from "socket.accept()"

2017-12-13 Thread Yury Selivanov
Change by Yury Selivanov : -- nosy: yselivanov priority: normal severity: normal status: open title: Remove "globals()" call from "socket.accept()" ___ Python tracker

[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Nathaniel Smith
Nathaniel Smith added the comment: > 1. How will trio handle situations like: > > c = coro() > await ... > nursery.start_soon(c) > > ? [...] > Maybe creating a coroutine and not immediately passing it to 'start_soon' or > similar API is an anti-pattern in Trio,

Re: Python GUI application embedding a web browser - Options?

2017-12-13 Thread yuriv1127
On Wednesday, October 19, 2016 at 3:08:15 AM UTC-7, Paul Moore wrote: > I'm looking to write a GUI application in Python (to run on Windows, using > Python 3.5). The application is just a relatively thin wrapper around a > browser - it's presenting an existing web application, just in its own

[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-12-13 Thread Dustin Spicuzza
Change by Dustin Spicuzza : -- keywords: +patch pull_requests: +4745 stage: -> patch review ___ Python tracker ___

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread Chris Angelico
On Thu, Dec 14, 2017 at 12:35 PM, Rick Johnson wrote: > On Tuesday, December 12, 2017 at 10:42:54 PM UTC-6, eryk sun wrote: > [...] >> That said, I don't see this feature as being very useful >> compared to just using "open with" when I occasionally need >> to open a

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread Rick Johnson
On Tuesday, December 12, 2017 at 10:42:54 PM UTC-6, eryk sun wrote: [...] > That said, I don't see this feature as being very useful > compared to just using "open with" when I occasionally need > to open a file with a non-default program. That's the point i was trying to make, but i think it may

[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4744 ___ Python tracker ___ ___

[issue30241] Add contextlib.AbstractAsyncContextManager

2017-12-13 Thread Yury Selivanov
Change by Yury Selivanov : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset b5fd9ad05e0f15f8272b8f1b829af22077230584 by Victor Stinner in branch 'master': bpo-32030: Rewrite _PyMainInterpreterConfig (#4854) https://github.com/python/cpython/commit/b5fd9ad05e0f15f8272b8f1b829af22077230584

[issue30241] Add contextlib.AbstractAsyncContextManager

2017-12-13 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 176baa326be4ec2dc70ca0c054b7e2ab7ca6a9cf by Yury Selivanov (Jelle Zijlstra) in branch 'master': bpo-30241: implement contextlib.AbstractAsyncContextManager (#1412)

[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4743 ___ Python tracker ___ ___

Re: Python homework

2017-12-13 Thread jladasky
On Thursday, December 7, 2017 at 7:11:18 AM UTC-8, Rhodri James wrote: > Sigh. Please don't do people's homework for them. It doesn't teach > them anything. Now Nick had got 90% of the way there and shown his > working, which is truly excellent, but what he needed was for someone to > hint

[issue32317] sys.exc_clear() clears exception in other stack frames

2017-12-13 Thread Garrett Berg
Garrett Berg added the comment: I found a workaround, and probably the reason this has not been detected before: import sys def doclear2() try: 1/0 except ZeroDivisionError: sys.exc_clear() try: 1/0 except

[issue32316] [3.6] make regen-all fails on Travis CI on "python3.6" command

2017-12-13 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32316] [3.6] make regen-all fails on Travis CI on "python3.6" command

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 1d2a387b9526ef5f4d694734d8022e739f7fd410 by Victor Stinner in branch '3.6': bpo-32316: Travis CI: use PYTHON_FOR_REGEN=python3 (#4853) https://github.com/python/cpython/commit/1d2a387b9526ef5f4d694734d8022e739f7fd410

[issue32298] Email.quopriprime over-encodes characters

2017-12-13 Thread Geoff Kuenning
Geoff Kuenning added the comment: I should have read that part of RFC 2047 before I submitted. I'd love to claim that I'm going to write a patch that would do as you suggest. But the reality is that I'm unlikely to find the time, so I'm going to be wise for once and avoid

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: shelve.Shelf is the example of such kind. -- ___ Python tracker ___

[issue32317] sys.exc_clear() clears exception in other stack frames

2017-12-13 Thread Garrett Berg
New submission from Garrett Berg : # Summary In python (2 or 3) it should always be valid to have a bare *raise* statement in an exception block. try: do_something() except SomeException: do_cleanup() raise # always reraises SomeException

[issue32317] sys.exc_clear() clears exception in other stack frames

2017-12-13 Thread Garrett Berg
Garrett Berg added the comment: I forgot to post this: python --version

ANN: Wing Python IDE v. 6.0.9 released

2017-12-13 Thread Wingware
Hi, We've just released Wing 6.0.9, which adds support for Vagrant, improves support for Django and Plone, further improves remote development, fixes startup problems seen on some OS X systems, and makes about 35 other improvements. For details, see

Re: Python homework

2017-12-13 Thread Terry Reedy
On 12/13/2017 8:28 AM, bo...@choices.random.py wrote: nick.martin...@aol.com (nick martinez2) writes: def rollDie(number): rolls = [0] * 6 for i in range(0, number): roll=int(random.randint(1,6)) One could just as well use randint(0, 5) and skip the -1 below.

[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Yury Selivanov
Yury Selivanov added the comment: Matthias, Thanks a lot for such a detailed write-up! I now better understand how you want to use the proposed API in Trio, and why the weakref approach isn't going to work (at least not in a straightforward way). >> 2. What if another

Re: Python homework

2017-12-13 Thread ROGER GRAYDON CHRISTMAN
On Wed, Dec 13, 2017, Lorenzo Sutton wrote: > On 05/12/17 06:33, nick martinez2 via Python-list wrote: >> I have a question on my homework. My homework is to write a program in >which >> the computer simulates the rolling of a die 50 times and then prints >> (i). the most frequent side of the die

[issue32143] os.statvfs lacks f_fsid

2017-12-13 Thread Fred L. Drake, Jr.
Change by Fred L. Drake, Jr. : -- nosy: +fdrake ___ Python tracker ___ ___

[issue32316] [3.6] make regen-all fails on Travis CI on "python3.6" command

2017-12-13 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +4742 stage: -> patch review ___ Python tracker ___

[issue32316] [3.6] make regen-all fails on Travis CI on "python3.6" command

2017-12-13 Thread STINNER Victor
New submission from STINNER Victor : The cpython job of Travis CI compiles Python with clang and then run "make regen-all" which fails. "make regen-all" fails for example on regen-typeslots which runs "$(PYTHON_FOR_REGEN) ...". On Travis CI, $(PYTHON_FOR_REGEN) is

[issue32296] Implement asyncio._get_running_loop() and get_event_loop() in C

2017-12-13 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset bfbf04ef18c93ca8cab0453f76aeea1d8fc23fb1 by Yury Selivanov in branch 'master': bpo-32296: Unbreak tests on Windows (#4850) https://github.com/python/cpython/commit/bfbf04ef18c93ca8cab0453f76aeea1d8fc23fb1 --

[issue32315] can't run any scripts with 2.7.x, 32 and 64-bit

2017-12-13 Thread Martin
New submission from Martin : When I try to run a really simple script like: def fun(a): print a return I get this error: Exception in Tkinter callback Traceback (most recent call last): File "C:\Python27\lib\lib-tk\Tkinter.py", line 1541, in __call__ return

[issue32314] Implement asyncio.run()

2017-12-13 Thread Yury Selivanov
Yury Selivanov added the comment: I'll open a separate issue to improve Server's API. AFAIK it's the main reason for having run_forever(). -- ___ Python tracker

[issue32314] Implement asyncio.run()

2017-12-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: I like avoiding run_forever() -- the function always was too cumbersome. -- ___ Python tracker

[issue32312] Create Py_AtExitRegister C API

2017-12-13 Thread Neil Schemenauer
Neil Schemenauer added the comment: Private is fine. We want to get the design correct before making it part of the official API. My thought is that providing a handy atexit hook would be a good thing in that it could be an alternative to 3rd party code using __del__

[issue32314] Implement asyncio.run()

2017-12-13 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +4741 stage: -> patch review ___ Python tracker ___

[issue32313] Wrong inspect.getsource for datetime

2017-12-13 Thread Aaron Meurer
New submission from Aaron Meurer : inspect.getsource(datetime) shows the Python source code for datetime, even when it is the C extension. This is very confusing. I believe it's because _datetime is used to override everything in datetime at the end of the file (here

[issue32314] Implement asyncio.run()

2017-12-13 Thread Yury Selivanov
New submission from Yury Selivanov : There's a fairly extensive discussion here: https://github.com/python/asyncio/pull/465 In short, asyncio.run() is a pretty straightforward addition, so let's add it. The discussion was more focused on the asyncio.run_forever()

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread eryk sun
On Wed, Dec 13, 2017 at 9:04 PM, Chris Angelico wrote: > On Thu, Dec 14, 2017 at 7:56 AM, eryk sun wrote: >> On Wed, Dec 13, 2017 at 5:43 AM, Chris Angelico wrote: >>> >>> A Windows equivalent would be to have a .py file associated normally

[issue32302] test_distutils: test_get_exe_bytes() failure on AppVeyor

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: > Happy for someone else to do it. I won't have time this week - too much going > on at work. Sure. I wrote a PR to fix the exact bug. -- ___ Python tracker

[issue32302] test_distutils: test_get_exe_bytes() failure on AppVeyor

2017-12-13 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +4740 stage: needs patch -> patch review ___ Python tracker ___

[issue32296] Implement asyncio._get_running_loop() and get_event_loop() in C

2017-12-13 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks Victor. I've made a PR to fix this. -- ___ Python tracker ___

[issue32296] Implement asyncio._get_running_loop() and get_event_loop() in C

2017-12-13 Thread Yury Selivanov
Change by Yury Selivanov : -- pull_requests: +4739 stage: resolved -> patch review ___ Python tracker ___

[issue32312] Create Py_AtExitRegister C API

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: Oh by the way, if we decide to add a function, I would prefer to start with a private function. The C API is big enough. We can decide in the next version if the function becomes useful enough to justify to be added to the public

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: > Don't make KeysView.__repr__ and ValuesView.__repr__ containing the lists of > all keys and values. This will make the repr of the view of a mapping which > is a proxy of an external DB containing the full content of that DB, which

[issue32312] Create Py_AtExitRegister C API

2017-12-13 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue32312] Create Py_AtExitRegister C API

2017-12-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Calling "atexit.register" using the C API isn't very difficult. The annoying part is to wrap a simple C function pointer in a callable PyObject (I don't think there is a simple C API for that). --

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread Aaron Meurer
Aaron Meurer added the comment: So the best fix is to just override keys() in the _Environ class, so that it returns an EnvironKeysView class that overrides __repr__? -- ___ Python tracker

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread Chris Angelico
On Thu, Dec 14, 2017 at 7:56 AM, eryk sun wrote: > On Wed, Dec 13, 2017 at 5:43 AM, Chris Angelico wrote: >> >> A Windows equivalent would be to have a .py file associated normally >> with the regular console, but some individual ones associated with >>

[issue32312] Create Py_AtExitRegister C API

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: See also: [Python-Dev] PEP 489: module m_traverse called with NULL module state https://mail.python.org/pipermail/python-dev/2017-December/151238.html -- ___ Python tracker

[issue32312] Create Py_AtExitRegister C API

2017-12-13 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +pitrou, vstinner ___ Python tracker ___ ___

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread eryk sun
On Wed, Dec 13, 2017 at 5:43 AM, Chris Angelico wrote: > > A Windows equivalent would be to have a .py file associated normally > with the regular console, but some individual ones associated with > pythonw.exe - without renaming them to .pyw. AFAIK there is no way to > do this

[issue32296] Implement asyncio._get_running_loop() and get_event_loop() in C

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: Hum, sometimes it's better to wait for AppVeyor :-) You broke all Windows buildbots! :-) Example: http://buildbot.python.org/all/#/builders/40/builds/278 == ERROR:

[issue32312] Create Py_AtExitRegister C API

2017-12-13 Thread Neil Schemenauer
New submission from Neil Schemenauer : It would be handy to have a C API that registered an atexit function, similar to what calling atexit.register does. This API could be used by C extension modules to register atexit functions. I think the implementation would be

[issue32309] Implement asyncio.run_in_executor shortcut

2017-12-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: https://bugs.python.org/issue32311 opened for create_task() -- ___ Python tracker ___

[issue32310] Remove _Py_PyAtExit from Python.h

2017-12-13 Thread Neil Schemenauer
Change by Neil Schemenauer : -- keywords: +patch pull_requests: +4738 ___ Python tracker ___

[issue32311] Implement asyncio.create_task() shortcut

2017-12-13 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +4737 stage: -> patch review ___ Python tracker ___

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Don't make KeysView.__repr__ and ValuesView.__repr__ containing the lists of all keys and values. This will make the repr of the view of a mapping which is a proxy of an external DB containing the full content of that DB, which

[issue32309] Implement asyncio.run_in_executor shortcut

2017-12-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: Removed create_task() from title -- title: Implement asyncio.create_task() and asyncio.run_in_executor shortcuts -> Implement asyncio.run_in_executor shortcut ___ Python tracker

[issue32311] Implement asyncio.create_task() shortcut

2017-12-13 Thread Andrew Svetlov
Change by Andrew Svetlov : -- components: Library (Lib), asyncio nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Implement asyncio.create_task() shortcut versions: Python 3.7 ___ Python

[issue32309] Implement asyncio.create_task() and asyncio.run_in_executor shortcuts

2017-12-13 Thread Andrew Svetlov
Change by Andrew Svetlov : -- assignee: docs@python -> nosy: -docs@python ___ Python tracker ___

[issue32310] Remove _Py_PyAtExit from Python.h

2017-12-13 Thread Neil Schemenauer
New submission from Neil Schemenauer : _Py_PyAtExit only supports on callback function. Its sole use it to be used by atexit. IMHO, it should be removed from Python.h to prevent misuse. -- components: Interpreter Core messages: 308242 nosy: nascheme priority:

[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 11a247df88f15b51feff8a3c46005676bb29b96e by Victor Stinner in branch 'master': bpo-32030: Add _PyPathConfig_ComputeArgv0() (#4845) https://github.com/python/cpython/commit/11a247df88f15b51feff8a3c46005676bb29b96e

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: Cheryl: would you like to work on a PR? If yes, tests are needed. -- ___ Python tracker ___

[issue32309] Implement asyncio.create_task() and asyncio.run_in_executor shortcuts

2017-12-13 Thread Yury Selivanov
Yury Selivanov added the comment: I don't like the low-level API of run_in_executor. "executor" being the first argument, the inability to pass **kwargs, etc. I'd expect to see a more high-level API, perhaps the one that supports 'async with': async with

[issue32309] Implement asyncio.create_task() and asyncio.run_in_executor shortcuts

2017-12-13 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +4736 stage: -> patch review ___ Python tracker ___

[issue32309] Implement asyncio.create_task() and asyncio.run_in_executor shortcuts

2017-12-13 Thread Andrew Svetlov
New submission from Andrew Svetlov : loop.create_task() and loop.run_in_executor are present very often in user code. But they are require a loop instance, actual call looks like loop = asyncio.get_running_loop() loop.create_task(coro()) The proposal adds

[issue32296] Implement asyncio._get_running_loop() and get_event_loop() in C

2017-12-13 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset a70232f28882d2fecb3ebe06643867701016070f by Yury Selivanov in branch 'master': bpo-32296: Implement asyncio.get_event_loop and _get_running_loop in C. (#4827)

[issue32296] Implement asyncio._get_running_loop() and get_event_loop() in C

2017-12-13 Thread Yury Selivanov
Change by Yury Selivanov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> performance ___ Python tracker

[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-13 Thread Neil Schemenauer
Neil Schemenauer added the comment: I created a new PR which uses the atexit module instead of using _Py_PyAtExit. I think registering in io.py is okay. I see that atexit is now implemented in C. Rather than registering in io.py, we could create a C API to register

[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-13 Thread Neil Schemenauer
Change by Neil Schemenauer : -- pull_requests: +4735 stage: needs patch -> patch review ___ Python tracker ___

[issue26259] Memleak when repeated calls to asyncio.queue.Queue.get is performed, without push to queue.

2017-12-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: Duplicate of https://bugs.python.org/issue31620 -- nosy: +asvetlov resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> asyncio.Queue leaks memory if the queue is empty and consumers poll it

[issue31620] asyncio.Queue leaks memory if the queue is empty and consumers poll it frequently

2017-12-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: Sorry for late closing the issue, PR was merged a month ago. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7 ___ Python tracker

[issue32302] test_distutils: test_get_exe_bytes() failure on AppVeyor

2017-12-13 Thread Steve Dower
Steve Dower added the comment: Happy for someone else to do it. I won't have time this week - too much going on at work. -- ___ Python tracker

[issue32104] add method throw() to asyncio.Task

2017-12-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: I think the ship has sailed. Now too many code is based on assumption that the only way to cancel a task from outer code is `task.cancel()`. Internally it is turned into try: await do_stuff() except asyncio.CancelledError:

[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: Let me try to explain better, I'm pretty sure there is just a misunderstanding from some of use in the vocabulary or presupposition we start from. I have the impression that you feel like the API will automatically make

[issue32292] Building fails on Windows

2017-12-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, I've decided to bite the bullet. I uninstalled VS 2015 and installed VS 2017 Community Edition. Things seem to work now. Thanks for the help! -- resolution: -> fixed stage: -> resolved status: open -> closed

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2017-12-13 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4734 stage: -> patch review ___ Python tracker ___

Re: Python homework

2017-12-13 Thread Chris Angelico
On Thu, Dec 14, 2017 at 3:23 AM, wrote: > from random import randint > > rolls = [randint(1, 6) for x in range(50)] > print("Average: %s" % (sum(rolls) / len(rolls))) > print("Most Common: %s" % max(rolls, key=rolls.count)) Great demo of a bad algorithm. :) ChrisA --

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2017-12-13 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently re.sub() replaces empty matches only when not adjacent to a previous match. This makes it inconsistent with re.findall() and re.finditer() which finds empty matches adjacent to a previous non-empty match and with

[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4733 ___ Python tracker ___ ___

[issue32307] Bad assumption on thread stack size makes python crash with musl libc

2017-12-13 Thread R. David Murray
R. David Murray added the comment: Well, from our point of view it isn't a bad assumption, it's that muslc needs to be added to the list of exceptions. (I know almost nothing about this...I assume there is some reason we can't determine the stack size programatically?)

[issue32236] open() shouldn't silently ignore buffering=1 in binary mode

2017-12-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: After looking at the PR, I think it would be a bit too strong to raise an error. Perhaps emit a warning instead? -- ___ Python tracker

[issue32307] Bad assumption on thread stack size makes python crash with musl libc

2017-12-13 Thread Natanael Copa
New submission from Natanael Copa : Python assumes that the system default thread stack size is big enough for python, except for OSX and FreeBSD where stack size is explicitly set. With musl libc the system thread stack size is only 80k, which leads to hard crash

[issue32004] Allow specifying code packing order in audioop adpcm functions

2017-12-13 Thread MosesofEgypt
MosesofEgypt added the comment: Added serhiy.storchaka to nosy list as the issue has been open for over a month without response(not sure if I should have done this in the first place). -- nosy: +serhiy.storchaka versions: +Python 2.7

[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Yury Selivanov
Yury Selivanov added the comment: > send_ping() # don't care about result, forgot await > # get collected > await something_that_will_trigger_check_coros_weakreaf() # oh no ! I don't understand what you are trying to say with this example. What is

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread R. David Murray
R. David Murray added the comment: Agreed about the other classes if we change this. Your solution looks reasonable to me. -- ___ Python tracker

[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: Your last description is about exactly what https://github.com/python-trio/trio/pull/176 is about (which I need to resurect) There are some issue with weakref some that I don't remember, but one of them is (IIRC): what if a

[issue32306] Clarify map API in concurrent.futures

2017-12-13 Thread David Lukeš
New submission from David Lukeš : The docstring for `concurrent.futures.Executor.map` starts by stating that it is "Equivalent to map(func, *iterables)". In the case of Python 3, I would argue this is true only superficially: with `map`, the user expects

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: If we decide to change abc.KeysView.__repr__, IMHO we should also modify abc.ValuesView.__repr__, and maybe also abc.ItemsView.__repr__. -- ___ Python tracker

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: Usually, I use print(sorted(os.environ)) since I prefer a sorted list and it prevents such issue :-) David: > I agree that the result is surprising, but there may not be a generic fix. What about something like: vstinner@apu$

[issue32302] test_distutils: test_get_exe_bytes() failure on AppVeyor

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: @Steve: do you want to work on a fix? -- ___ Python tracker ___

[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-13 Thread STINNER Victor
STINNER Victor added the comment: test_readline failed. It seems to be related to my commit: http://buildbot.python.org/all/#/builders/87/builds/360 == FAIL: test_nonascii

  1   2   >