[issue31969] re.groups() is not checking the arguments

2017-11-07 Thread Narendra
Narendra added the comment: Hi Storchaka, As per re.groups(), its should work as below: groups([default]) Return a tuple containing all the subgroups of the match, from 1 up to however many groups are in the pattern. The default argument is used for groups that did not

[issue31977] threading.Condition can not work with threading.Semaphore

2017-11-07 Thread 张晓林
Change by 张晓林 : -- type: resource usage -> behavior ___ Python tracker ___ ___

Re: python3 byte decode

2017-11-07 Thread Chris Angelico
On Wed, Nov 8, 2017 at 4:36 PM, Ali Rıza KELEŞ wrote: >> To be more clear here, usually when humans say "identical" they mean having >> exactly the same value or attributes. >> Here, Chris means that the two strings are actually the same object rather >> than two equivalent

[issue31834] BLAKE2: the (pure) SSE2 impl forced on x86_64 is slower than reference

2017-11-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: @tiran, can we close this again? -- ___ Python tracker ___

Re: python3 byte decode

2017-11-07 Thread Ali Rıza KELEŞ
Hi, On 5 November 2017 at 04:06, Cameron Simpson wrote: > On 04Nov2017 01:47, Chris Angelico wrote: >> >> On Fri, Nov 3, 2017 at 8:24 PM, Ali Rıza KELEŞ >> wrote: >>> >>> Yesterday, while working with redis, i encountered a strange

[issue31977] threading.Condition can not work with threading.Semaphore

2017-11-07 Thread 张晓林
New submission from 张晓林 : the python document say Condition work will Locks, like RLock... but i find it not work with Semaphore, because Condition._is_owned is like this def _is_owned(self): # Return True if lock is owned by current_thread. # This

[issue31971] idle_test: failures on x86 Windows7 3.x

2017-11-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: In build 129, which finished perhaps 3 hours ago, test_idle passed again. I think we should merge the fix anyway in case 'hover' appears again on some machine. A similar try:except is needed elsewhere. --

[issue31976] Segfault when closing BufferedWriter from a different thread

2017-11-07 Thread Benjamin Fogle
Change by Benjamin Fogle : -- type: -> crash ___ Python tracker ___ ___

[issue31971] idle_test: failures on x86 Windows7 3.x

2017-11-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: The failure in tearDownClass is a side-effect of the failure in test_set_keys causing 'p.set_keys_type = Func' being skipped. That could be prevented with 'try:finally: p.set_keys_type = Func'. I am completely puzzled at the sudden failure

[issue31976] Segfault when closing BufferedWriter from a different thread

2017-11-07 Thread Benjamin Fogle
Change by Benjamin Fogle : -- keywords: +patch pull_requests: +4287 stage: -> patch review ___ Python tracker ___

[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-07 Thread Éric Araujo
Éric Araujo added the comment: This can’t be backported, but could the docs of 2.7 and stable 3.x version gain an example of equivalent PYTHONWARNINGS envvar? -- nosy: +eric.araujo ___ Python tracker

[issue31976] Segfault when closing BufferedWriter from a different thread

2017-11-07 Thread Benjamin Fogle
New submission from Benjamin Fogle : To reproduce: ``` import threading import io import time import _pyio class MyFileIO(io.FileIO): def flush(self): # Simulate a slow flush. Slow disk, etc. time.sleep(0.25) super().flush() raw =

[issue31971] idle_test: failures on x86 Windows7 3.x

2017-11-07 Thread Terry J. Reedy
Change by Terry J. Reedy : -- keywords: +patch pull_requests: +4286 stage: -> patch review ___ Python tracker ___

[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2017-11-07 Thread Anders Lorentsen
Anders Lorentsen added the comment: While researching this, I discovered that on MS Windows >>> subprocess.run([pathlike_object, additional_arguments]) did not run like it did on Posix. My PR includes this problem and it's fix. --

[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2017-11-07 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +4285 stage: -> patch review ___ Python tracker ___

[issue31975] Add a default filter for DeprecationWarning in __main__

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

[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-07 Thread Nick Coghlan
New submission from Nick Coghlan : As per the post at https://mail.python.org/pipermail/python-dev/2017-November/150366.html, this is an RFE to cover adding a new warning filter to the default set: once::DeprecationWarning:__main__ This means that all deprecation

[issue31974] Cursor misbahavior with Tkinter 3.6.1/tk 8.5 Text on Mac Sierra

2017-11-07 Thread Terry J. Reedy
New submission from Terry J. Reedy : MacOS Sierra 10.12.6, Python 3.6.1, tk 8.5.15 or .18. Consider this code with arbitrary compound statements and therefore indented lines. for i in range(10): if i%2: print(f(i)) Irv Kalb on idle-dev thread 'Bug in cursor

[issue24132] Direct sub-classing of pathlib.Path

2017-11-07 Thread Stephen M. Gava
Stephen M. Gava added the comment: Using a set of paths with special properties and formats in a project, thought "the cleanest oop way to do this is try out python's oop paths in pathlib". Subclassed Path to implement my extra (non platfor specific) properties and fell

[issue25862] TextIOWrapper assertion failure after read() and SEEK_CUR

2017-11-07 Thread Zackery Spytz
Change by Zackery Spytz : -- nosy: +ZackerySpytz versions: +Python 3.6, Python 3.7 -Python 3.5 ___ Python tracker ___

Re: Ideas about how software should behave (was: replacing `else` with `then` in `for` and `try`)

2017-11-07 Thread Ian Kelly
On Tue, Nov 7, 2017 at 4:28 PM, Steve D'Aprano wrote: > On Wed, 8 Nov 2017 04:28 am, Ian Kelly wrote: > >> Steve's manufactured interactive example ("manufactured" because >> who really uses for-else interactively? If I really care that much >> about output formatting

Re: Ideas about how software should behave (was: replacing `else` with `then` in `for` and `try`)

2017-11-07 Thread Steve D'Aprano
On Wed, 8 Nov 2017 04:28 am, Ian Kelly wrote: > Steve's manufactured interactive example ("manufactured" because > who really uses for-else interactively? If I really care that much > about output formatting I'm going to put it in a script). Me. As I have said. I really don't appreciate you

[issue31973] Incomplete DeprecationWarning for async/await keywords

2017-11-07 Thread Jakub Wilk
Change by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing

[issue31973] Incomplete DeprecationWarning for async/await keywords

2017-11-07 Thread Barry A. Warsaw
New submission from Barry A. Warsaw : Issue bpo-26182 added DeprecationWarnings for "import async" and "import await" since both of those pseudo-keywords were to become actual reserved keywords in Python 3.7. This latter has now happened, but the fix in bpo-26182 is

Re: Ideas about how software should behave

2017-11-07 Thread Ned Batchelder
On 11/7/17 5:48 PM, Ben Finney wrote: Ian Kelly writes: Nowadays I realize and accept that this is preposterous. You cannot criticize an idea without also criticizing the people who are attached to that idea. Maybe so. Does that mean we must not criticise ideas? Later

[issue26692] cgroups support in multiprocessing

2017-11-07 Thread Mihai Capotă
Change by Mihai Capotă : -- nosy: +mihaic ___ Python tracker ___ ___ Python-bugs-list

[issue31957] [Windows] PCbuild error: A numeric comparison was attempted

2017-11-07 Thread STINNER Victor
STINNER Victor added the comment: Thank you Steve for the quick fix! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

Re: Ideas about how software should behave

2017-11-07 Thread Ben Finney
Ian Kelly writes: > Nowadays I realize and accept that this is preposterous. You cannot > criticize an idea without also criticizing the people who are attached > to that idea. Maybe so. Does that mean we must not criticise ideas? Later in your message you say no, but

[issue31824] Missing default argument detail in documentation of StreamReaderWriter

2017-11-07 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +4284 stage: needs patch -> patch review ___ Python tracker

[issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple

2017-11-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: bpo-28280 fixed this issue only in the master branch. I had left this issue open for fixing 3.6. -- resolution: out of date -> stage: resolved -> needs patch status: closed -> open

[issue28791] update sqlite to latest version before beta 1

2017-11-07 Thread Zachary Ware
Zachary Ware added the comment: I'd say that's up to Ned and Benjamin. It's a very simple backport at this point. -- nosy: +benjamin.peterson ___ Python tracker

[issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple

2017-11-07 Thread Berker Peksag
Berker Peksag added the comment: PR 3840 has been merged and it looks like Oren was correct. I'm getting the following output with current master: >>> encoder(obj=BadDict({'spam': 42}), _current_indent_level=4) ['{}'] -- nosy: +berker.peksag resolution: ->

[issue31824] Missing default argument detail in documentation of StreamReaderWriter

2017-11-07 Thread Berker Peksag
Berker Peksag added the comment: For those who want to work on this issue: codecs.StreamReaderWriter documentation is located at Doc/library/codecs.rst. -- keywords: +easy nosy: +berker.peksag stage: -> needs patch versions: +Python 3.7

Re: Ideas about how software should behave (was: replacing `else` with `then` in `for` and `try`)

2017-11-07 Thread Chris Angelico
On Wed, Nov 8, 2017 at 8:16 AM, Ian Kelly wrote: > All of these are things that a linter should probably catch and warn > about. If you had said that the break syntax suggestion was a good > idea but probably better suited as a linter warning than as a > SyntaxError

Re: Easiest way to access C module in Python

2017-11-07 Thread Gisle Vanem
bartc wrote:  From inside python 2.7:    Python 2.7.13rc1 (v2.7.13rc1:4d6fd49eeb14, Dec  3 2016, 21:49:42) [MSC v.1500 32 bit (Intel)] on win32    Type "help", "copyright", "credits" or "license" for more information.    >>> import life    >>> dir(life)    ['__builtins__', '__doc__',

Re: Ideas about how software should behave (was: replacing `else` with `then` in `for` and `try`)

2017-11-07 Thread Ian Kelly
On Tue, Nov 7, 2017 at 12:10 PM, Chris Angelico wrote: > On Wed, Nov 8, 2017 at 4:28 AM, Ian Kelly wrote: >> On Sat, Nov 4, 2017 at 6:40 AM, Chris Angelico wrote: >>> Maybe we're not defending the abuse of other contributors. Maybe

Re: Easiest way to access C module in Python

2017-11-07 Thread bartc
On 07/11/2017 20:08, Gisle Vanem wrote: Lele Gaifax wrote: On my PC, I get the following, using the "-v" option to verbosely see the imported modules: $ $ python -v # installing zipimport hook import zipimport # builtin # installed zipimport hook ... import life dlopen("./life.so", 2);

[issue31937] Add the term "dunder" to the glossary

2017-11-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I never seen terms like "stir" or "inker", but the term "dunder" is used pretty widely. The glossary already contains abbreviations and Python folk terminology like EAFP and BDFL. --

Re: Ideas about how software should behave

2017-11-07 Thread Grant Edwards
On 2017-11-07, Chris Angelico wrote: > On Wed, Nov 8, 2017 at 6:44 AM, Stefan Ram wrote: >> Chris Angelico writes: >>>sure what your point is. None, False, and True are all keywords, not >>>built-ins, so you can't assign to them (any

[issue31937] Add the term "dunder" to the glossary

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Agreed with Raymond that Python folk terminology should not go into the glossary. I don't think I ever say "dunder" myself. -- nosy: +pitrou ___ Python tracker

[issue31951] import curses is broken on windows

2017-11-07 Thread joe m
joe m added the comment: I would much prefer the curses module to be supported in newer versions since I believe that curses is installed as a built in module (not sure about that). Anyhow, thank you for your help but I have found a replacement module called

Re: Easiest way to access C module in Python

2017-11-07 Thread Gisle Vanem
Lele Gaifax wrote: On my PC, I get the following, using the "-v" option to verbosely see the imported modules: $ $ python -v # installing zipimport hook import zipimport # builtin # installed zipimport hook ... import life dlopen("./life.so", 2); import life # dynamically loaded from life.so

ANN: Wing Python IDE v. 6.0.8 released

2017-11-07 Thread Wingware
Hi, We've just released Wing 6.0.8, a minor release that improves display of PEP 287 docstrings, fixes stability problems seen on Linux, fixes remote debugging of Django code, further improves remote development, adds some missing vi bindings, and makes about 30 other improvements. For

Re: Ideas about how software should behave

2017-11-07 Thread Chris Angelico
On Wed, Nov 8, 2017 at 6:44 AM, Stefan Ram wrote: > Chris Angelico writes: >>sure what your point is. None, False, and True are all keywords, not >>built-ins, so you can't assign to them (any more than you could assign >>to a literal integer). > >

Re: Ideas about how software should behave

2017-11-07 Thread Grant Edwards
On 2017-11-07, Stefan Ram wrote: > Chris Angelico writes: >>sure what your point is. None, False, and True are all keywords, not >>built-ins, so you can't assign to them (any more than you could assign >>to a literal integer). > >|Python 2.6.6

Re: Ideas about how software should behave (was: replacing `else` with `then` in `for` and `try`)

2017-11-07 Thread Chris Angelico
On Wed, Nov 8, 2017 at 4:28 AM, Ian Kelly wrote: > On Sat, Nov 4, 2017 at 6:40 AM, Chris Angelico wrote: >> On Sat, Nov 4, 2017 at 11:25 PM, Jon Ribbens >> wrote: >>> On 2017-11-04, Ben Finney

Re: Easiest way to access C module in Python

2017-11-07 Thread Lele Gaifax
Gisle Vanem writes: > python.exe -c "import life; print(life.life())" > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'module' object has no attribute 'life' > > Can you give a hint? I tried with Python 2, and the same recipe works for me,

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

2017-11-07 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset ac4f6d4448fb6f9affb817bafb8357450fe43349 by Andrew Svetlov (Miss Islington (bot)) in branch '3.6': bpo-31620: have asyncio/queues not leak memory when you've exceptions during waiting (GH-3813) (#4326)

[issue31972] Inherited docstrings for pathlib classes are confusing

2017-11-07 Thread Éric Araujo
New submission from Éric Araujo : pydoc pathlib.Path shows the docstring of PurePath: | PurePath represents a filesystem path and offers operations which | don't imply any actual filesystem I/O. But immediately after we see methods like chmod, exists and co which

[issue31425] Expose AF_QIPCRTR in socket module

2017-11-07 Thread Christian Heimes
Change by Christian Heimes : -- assignee: -> christian.heimes nosy: +christian.heimes ___ Python tracker ___

Re: Easiest way to access C module in Python

2017-11-07 Thread Gisle Vanem
Lele Gaifax wrote: $ python setup.py build_ext --inplace Compiling life.pyx because it changed. [1/1] Cythonizing life.pyx running build_ext building 'life' extension creating build creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall

Re: Easiest way to access C module in Python

2017-11-07 Thread Rob Gaddi
On 11/06/2017 05:59 PM, Grant Edwards wrote: On 2017-11-06, John Pote wrote: I have successfully used Python to perform unit and integration tests in the past and I'd like to do the same for some C modules I'm working with at work. There seem to be a number of ways

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

2017-11-07 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4283 ___ Python tracker ___

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

2017-11-07 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset c62f0cb3b1f6f9ca4ce463b1c99b0543bdfa38d6 by Andrew Svetlov (Suren Nihalani) in branch 'master': bpo-31620: have asyncio/queues not leak memory when you've exceptions during waiting (#3813)

Re: Ideas about how software should behave (was: replacing `else` with `then` in `for` and `try`)

2017-11-07 Thread Ian Kelly
On Sat, Nov 4, 2017 at 6:40 AM, Chris Angelico wrote: > On Sat, Nov 4, 2017 at 11:25 PM, Jon Ribbens > wrote: >> On 2017-11-04, Ben Finney wrote: >>> To respond to the criticism of an idea – criticism containing no

[issue31937] Add the term "dunder" to the glossary

2017-11-07 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks Raymond. +1 for adding the above list. I don't think FAQ is the right place either, I prefer we don't have to add the entries in the form of questions & answers. -- ___ Python

Re: Ideas about how software should behave (was: replacing `else` with `then` in `for` and `try`)

2017-11-07 Thread Ian Kelly
On Fri, Nov 3, 2017 at 11:55 PM, Ben Finney wrote: > Ian Kelly writes: > >> Please stop defending the use of incivility on this list. > > Please stop conflating people, who deserve civility, with ideas. We must > not allow the civility deserved

[issue31793] Allow to specialize smart quotes in documentation translations

2017-11-07 Thread INADA Naoki
INADA Naoki added the comment: Thanks, Julien. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7 ___ Python tracker

[issue31970] asyncio debug mode is very slow

2017-11-07 Thread Yury Selivanov
Yury Selivanov added the comment: Thank you for helping with asyncio! I'll try to get to that transport performance issues you found sometime this week. I've a few ideas how to add 0-copy support to protocols. -- ___ Python

[issue31793] Allow to specialize smart quotes in documentation translations

2017-11-07 Thread INADA Naoki
INADA Naoki added the comment: New changeset 64f10492dcda4117ac06399ae46ab645cb09b19e by INADA Naoki (Miss Islington (bot)) in branch '3.6': bpo-31793: Doc: Specialize smart-quotes for Japanese (GH-4006)

[issue31793] Allow to specialize smart quotes in documentation translations

2017-11-07 Thread INADA Naoki
INADA Naoki added the comment: New changeset 47eaaa55247b6ad8ae507c0048509c2e3db79bf0 by INADA Naoki (Miss Islington (bot)) in branch '2.7': bpo-31793: Doc: Specialize smart-quotes for Japanese (GH-4006)

[issue31970] asyncio debug mode is very slow

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset d8d218ffda6b7569625ff9edadbbc9a2b1055e32 by Antoine Pitrou in branch '3.6': [3.6] bpo-31970: Reduce performance overhead of asyncio debug mode. (GH-4314) (#4322)

[issue31970] asyncio debug mode is very slow

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you for the quick reviews! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue31793] Allow to specialize smart quotes in documentation translations

2017-11-07 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4282 ___ Python tracker ___

[issue31793] Allow to specialize smart quotes in documentation translations

2017-11-07 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4281 ___ Python tracker ___

[issue31793] Allow to specialize smart quotes in documentation translations

2017-11-07 Thread INADA Naoki
INADA Naoki added the comment: New changeset 5a66c8a64d180b5f3c80307924adaec53cc8faa3 by INADA Naoki (Julien Palard) in branch 'master': bpo-31793: Doc: Specialize smart-quotes for Japanese (GH-4006)

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> postponed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Yury Selivanov
Yury Selivanov added the comment: I guess you can set Resolution to "postponed", Stage to "Resolved". -- ___ Python tracker ___

[issue31970] asyncio debug mode is very slow

2017-11-07 Thread Antoine Pitrou
Change by Antoine Pitrou : -- pull_requests: +4280 ___ Python tracker ___ ___

[issue31970] asyncio debug mode is very slow

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 921e9432a1461bbf312c9c6dcc2b916be6c05fa0 by Antoine Pitrou in branch 'master': bpo-31970: Reduce performance overhead of asyncio debug mode. (#4314)

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: The documentation has been fixed. Should we close this now? Ideally I'd rather have asyncio warn me in such situations, but I feel this won't be doable. -- ___ Python tracker

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 518c6b97868d9c665475a40567b0aa417afad607 by Antoine Pitrou (Miss Islington (bot)) in branch '3.6': bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (GH-4319) (#4320)

[issue31965] Incorrect documentation for multiprocessing.connection.{Client, Listener}

2017-11-07 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 ___ Python tracker

[issue31965] Incorrect documentation for multiprocessing.connection.{Client, Listener}

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset d9c61c2a2662761dc89e0be14ceb7ea57531c836 by Antoine Pitrou (Miss Islington (bot)) in branch '3.6': bpo-31965: fix doc for multiprocessing.connection.Client and Listener (GH-4304) (#4321)

[issue31965] Incorrect documentation for multiprocessing.connection.{Client, Listener}

2017-11-07 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +4279 stage: -> patch review ___ Python tracker ___

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Maybe the solution is to fix Tornado? That's a possibility. I have to convince Ben Darnell that it deserves fixing :-) Another possibility is to use the asyncio concurrency primitives on Python 3, though that slightly complicates things,

[issue31965] Incorrect documentation for multiprocessing.connection.{Client, Listener}

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 1e5d54cfa031f1de9ee2d2e968e0551b6e2397b7 by Antoine Pitrou (Jelle Zijlstra) in branch 'master': bpo-31965: fix doc for multiprocessing.connection.Client and Listener (#4304)

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4278 stage: -> patch review ___ Python tracker ___

Re: What happens to module's variables after a "from module import" ?

2017-11-07 Thread ast
"Paul Moore" a écrit dans le message de news:mailman.53.1510069830.2819.python-l...@python.org... On 7 November 2017 at 15:39, ast wrote: It's in the "tmp" module, where you defined it. But because you didn't ask for a reference to it in your

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 22b1128559bdeb96907da5840960691bb050d11a by Antoine Pitrou in branch 'master': bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (#4319)

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Yury Selivanov
Yury Selivanov added the comment: > Just try the snippet :-) If you want to see it finish in a finite time, move > the future instantiation inside the coroutine. Yeah, I see the problem. OTOH your proposed change to lazily attach a loop to the future isn't fully

Re: What happens to module's variables after a "from module import" ?

2017-11-07 Thread Peter Otten
ast wrote: > Hello > > Here is my module tmp.py: > > a=0 > > def test(): > global a > print(a) > a+=1 > > If I import function "test" from module "tmp" with: > from tmp import test > > it works > test() > 0 test() > 1 > > But where variable "a" is located ? I

Re: Incomplete description using sqlite3

2017-11-07 Thread Sibylle Koczian
Am 06.11.2017 um 23:40 schrieb Skip Montanaro: I'm using sqlite3 (2.6.0, SQLite version 3.13.0, Python 2.7.13) and was hoping to introspect the types of a table using the cursor's description attribute. PEP 249 states: "The first two items (name and type_code) are mandatory..." I tried this

Re: What happens to module's variables after a "from module import" ?

2017-11-07 Thread Paul Moore
On 7 November 2017 at 15:39, ast wrote: > Hello > > Here is my module tmp.py: > > a=0 > > def test(): >global a >print(a) >a+=1 > > If I import function "test" from module "tmp" with: > from tmp import test > > > it works > test() > > 0 test() >

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > So imagine a Future `fut` is completed. And we call `fut.add_done_callback()` > in different contexts with different active event loops. With your > suggestion we'll schedule our callbacks in different loops. I'm wondering: does this

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Yury Selivanov
Yury Selivanov added the comment: > My underlying question is why the Future has to set its loop in its > constructor, instead of simply using get_event_loop() inside > _schedule_callbacks(). This would always work. So imagine a Future `fut` is completed. And we call

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: The call_soon / call_soon_threadsafe distinction is not relevant to the problem I posted. The problem is that the Future is registered with the event loop for the thread it was created in, even though it is only ever used in another thread

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Yury Selivanov
Yury Selivanov added the comment: >> I think we should update `Future._schedule_callbacks` to check if the loop >> is in debug mode. > Unfortunately this is not sufficient for the snippet I posted. The loop's > thread_id is only set when the loop runs, but the main

What happens to module's variables after a "from module import" ?

2017-11-07 Thread ast
Hello Here is my module tmp.py: a=0 def test(): global a print(a) a+=1 If I import function "test" from module "tmp" with: from tmp import test it works test() 0 test() 1 But where variable "a" is located ? I can't find it anywhere Regards --

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Antoine Pitrou
Change by Antoine Pitrou : -- keywords: +patch pull_requests: +4277 stage: -> patch review ___ Python tracker ___

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: My underlying question is why the Future has to set its loop in its constructor, instead of simply using get_event_loop() inside _schedule_callbacks(). This would always work. -- ___ Python

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > My opinion on this: update documentation for all Python versions to reflect > that Future uses call_soon. Agreed. > I think we should update `Future._schedule_callbacks` to check if the loop is > in debug mode. Unfortunately this is not

[issue31971] idle_test: failures on x86 Windows7 3.x

2017-11-07 Thread STINNER Victor
New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/58/builds/122 == ERROR: tearDownClass (idlelib.idle_test.test_configdialog.KeysPageTest)

Re: Easiest way to access C module in Python

2017-11-07 Thread bartc
On 07/11/2017 14:33, Tim Golden wrote: On 07/11/2017 14:20, bartc wrote: You've lost me. I had to look up pyPI and it's something to do with a Package Index. But I don't know how that relates to installing Cython. Can I just step in now with my Moderator hat on and ask: please avoid a

[issue31966] [EASY C][Windows] print('hello\n', end='', flush=True) raises OSError when ran with py -u

2017-11-07 Thread STINNER Victor
STINNER Victor added the comment: The _io__WindowsConsoleIO_write_impl() function should be fixed to not call MultiByteToWideChar() but use 0 if the input string is zero. Ok, it makes sense. In that case, I agree to call it a simple issue ;-) -- title:

Re: Easiest way to access C module in Python

2017-11-07 Thread Tim Golden
On 07/11/2017 14:20, bartc wrote: On 07/11/2017 13:30, Thomas Jollans wrote: On 2017-11-07 12:53, bartc wrote: Having said that, I located pip.exe, trying typing 'pip install cffi' and it seemed to be doing something but then failed with a bunch of errors.) So you're missing out on all of

[issue31960] Protection against using a Future with another loop only works with await

2017-11-07 Thread Yury Selivanov
Yury Selivanov added the comment: > On the other hand, the Future implementation is entirely not thread-safe > (btw, the constructor optimistically claims the done callbacks are scheduled > using call_soon_threadsafe(), but the implementation actually calls >

Re: Easiest way to access C module in Python

2017-11-07 Thread bartc
On 07/11/2017 13:30, Thomas Jollans wrote: On 2017-11-07 12:53, bartc wrote: Having said that, I located pip.exe, trying typing 'pip install cffi' and it seemed to be doing something but then failed with a bunch of errors.) So you're missing out on all of PyPI? That's tragic. You should

[issue31955] distutils C compiler: set_executables() incorrectly parse values with spaces

2017-11-07 Thread Dee Mee
Dee Mee added the comment: I agree, that this fix is necessary only for Python 2. Submitted new PR 4316 -- versions: -Python 3.6, Python 3.7 ___ Python tracker

  1   2   >