[issue32381] Python 3.6 cannot reopen .pyc file with non-ASCII path

2017-12-19 Thread Eryk Sun
Eryk Sun added the comment: run_file encodes the file path via PyUnicode_EncodeFSDefault, which encodes as UTF-8 in Windows, starting with 3.6. PyRun_SimpleFileExFlags subsequently tries to open this encoded path via _Py_fopen, which calls fopen. The CRT expects an ANSI

[issue27456] asyncio: set TCP_NODELAY flag by default

2017-12-19 Thread Марк Коренберг
Марк Коренберг added the comment: Note, TCP_NODELAY can not be set on UNIX streaming socket. Do you have corresponding tests for UNIX sockets ? -- ___ Python tracker

[issue32381] python3.6 can not reopen .pyc file with Chinese path

2017-12-19 Thread tianjg
New submission from tianjg : have a problem that python3.6 can not reopen .pyc file with Chinese path, and python3.5 can reopen the same pyc file. As shown in the picture -- components: Windows files: 20171218111240.jpg messages: 308705 nosy: paul.moore,

[META] Are the list admins honouring Posting Prohibited demands?

2017-12-19 Thread Steve D'Aprano
This is possibly a question for the list admins... I notice that Lawrence D’Oliveiro has taken up labelling his posts with a demand that his posts are not to be posted to the Python-List mailing list. I also see that his posts are not showing up on the mailing list archive. Is this a coincidence

[issue32204] async/await performance is very low

2017-12-19 Thread Liran Nuna
Liran Nuna added the comment: Yuri, Those speed improvements are awesome and I'm really excited about them, performance is slowly starting to match asynq and would make us migrating our code to async/await more feasable! Today, python3.6.4 was released and these

[issue32361] global / nonlocal interference : is this a bug, a feature or a design hole ?

2017-12-19 Thread Camion
Camion added the comment: What I mean is that we need to clarify (by giving examples ?) what make the scope for the new binding "not be unambiguously decidable", because, for an example : My example is totaly unambiguously decidable for an interpreter. It's for

[issue32268] quopri.decode(): string argument expected, got 'bytes'

2017-12-19 Thread R. David Murray
R. David Murray added the comment: Yes, if that protocol existed the errors would be clearer. But it doesn't, for historical reasons, and that is unlikely to change. You are welcome to submit an enhancement request to make quopri accept string as an argument when

[issue32030] PEP 432: Rewrite Py_Main()

2017-12-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4828 ___ Python tracker ___ ___

[issue32361] global / nonlocal interference : is this a bug, a feature or a design hole ?

2017-12-19 Thread Camion
Camion added the comment: Ivan, I believe, this sentence : "(the scope in which a new binding should be created cannot be determined unambiguously)" in https://docs.python.org/fr/3/reference/simple_stmts.html#nonlocal, is the one which should be clarified

[issue32030] PEP 432: Rewrite Py_Main()

2017-12-19 Thread STINNER Victor
STINNER Victor added the comment: I like the new shape of Py_Main(). The main parts of Py_Main() are now well identified: * init "cmdline" * init "python core" * init "python main" * run python * cleanup -- ___ Python

Re: [OT] Python and Excel

2017-12-19 Thread Thomas Jollans
On 2017-12-18 20:16, MRAB wrote: > Those who use Excel might find this interesting: > > Microsoft Considers Adding Python as an Official Scripting Language to > Excel > https://www.bleepingcomputer.com/news/microsoft/microsoft-considers-adding-python-as-an-official-scripting-language-to-excel/ >

[issue32268] quopri.decode(): string argument expected, got 'bytes'

2017-12-19 Thread Alexey Luchko
Alexey Luchko added the comment: 1. On quopri. It is counter-intuitive despite the clear statement in the doc-string. Quoted-printable is used mostly for text encoding. (It would be quite awkward and inefficient to use it for binary data.) My case: I have a text and I

[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2017-12-19 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___

[issue32030] PEP 432: Rewrite Py_Main()

2017-12-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset 19760863623b636a63ccf649107d9504c6465a92 by Victor Stinner in branch 'master': bpo-32030: Cleanup pymain_main() (#4935) https://github.com/python/cpython/commit/19760863623b636a63ccf649107d9504c6465a92 --

[issue31489] Signal delivered to a subprocess triggers parent's handler

2017-12-19 Thread Nathaniel Smith
Nathaniel Smith added the comment: It might be possible to create ProcessPoolExecutor and get it to spawn all the workers *before* you start the asyncio loop. It looks like ProcessPoolExecutor delays spawning workers until the first piece of work is submitted, but at that

[issue32375] Compilation warnings with gcc

2017-12-19 Thread STINNER Victor
STINNER Victor added the comment: In function ‘wcsncpy’, inlined from ‘calculate_zip_path’ at ./Modules/getpath.c:797:5: /usr/include/x86_64-linux-gnu/bits/wchar2.h:200:9: warning: call to ‘__wcsncpy_chk_warn’ declared with attribute warning: wcsncpy called with

Re: adding elif to for

2017-12-19 Thread Skip Montanaro
Has any thought been given to adding elif to the for statement? Time machine at work I think: https://docs.python.org/3/reference/compound_stmts.html#the-if-statement Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: adding elif to for

2017-12-19 Thread Skip Montanaro
Apologies. Misread your question. Skip On Dec 19, 2017 6:16 PM, "Skip Montanaro" wrote: > > Has any thought been given to adding elif to the for statement? > > > Time machine at work I think: > > https://docs.python.org/3/reference/compound_stmts.html#the-if-statement

Re: adding elif to for

2017-12-19 Thread Bill
bob gailer wrote: Has any thought been given to adding elif to the for statement? I don't think it is a good idea because it needlessly, from my point of view, embeds too much complexity into a single construct (making it more difficult to maintain, for instance). That's what language

[issue32030] PEP 432: Rewrite Py_Main()

2017-12-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4827 ___ Python tracker ___ ___

adding elif to for

2017-12-19 Thread bob gailer
Has any thought been given to adding elif to the for statement? for x in foo:     if y: break elif a==b:     something else:     something else as a shortcut to: for x in foo:     if y: break else:     if a==b:     something else:     something else bob gailer --

[issue32361] global / nonlocal interference : is this a bug, a feature or a design hole ?

2017-12-19 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Stefan, your last example is formally speaking OK, if one reads the "Execution model" literally. The original example is however too ambiguous, so it is good that it triggers an error. I think there is a chance to improve the error

[issue32268] quopri.decode(): string argument expected, got 'bytes'

2017-12-19 Thread R. David Murray
R. David Murray added the comment: That's type checking. Not type checking is to call the method that writes the data, expecting the object to handle the bytes it is passed, and then that object raises an error to indicate that it cannot. There is no protocol that

[issue32373] Add socket.getblocking() method

2017-12-19 Thread Yury Selivanov
Yury Selivanov added the comment: It appears the the timeouts situation is a bit more complex. It's perfectly normal for a Python socket object to be in a "blocking" mode and for its FD to be in a non-blocking mode. Read more about this in the latest docs update to

[issue32268] quopri.decode(): string argument expected, got 'bytes'

2017-12-19 Thread Alexey Luchko
Alexey Luchko added the comment: I didn't mean type checking. The point is that since string and bytes are different types, then binary and text files are actually much more different than before python 3. Therefore they better be of different protocols. Then inside

Re: correctness proof for alpha-beta algorithm

2017-12-19 Thread Steve D'Aprano
On Wed, 20 Dec 2017 07:23 am, namenobodywa...@gmail.com wrote: > On Monday, December 18, 2017 at 10:16:07 PM UTC-8, Terry Reedy wrote: > >> Where or how have you looked so far? How formal do you want? > > i want full-on formal with lots of rigor and every possible detail spelled > out; i've

[issue32304] Upload failed (400): Digests do not match on .tar.gz ending with x0d binary code

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I agree with the suggested fix. Do you want to submit a PR? -- nosy: +pitrou -llecaroz stage: -> needs patch versions: +Python 3.6 -Python 3.5, Python 3.8 ___ Python tracker

[issue32345] EIO from write() is only fatal if print() contains a newline

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Python 2 doesn't call write(), it calls fwrite() and friends (i.e. it uses the libc's buffered I/O API). Also we don't do anything special if the printed string has a newline in it. So my guess is that it's a bug in the libc. --

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

2017-12-19 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> not a bug stage: test needed -> resolved status: open -> closed ___ Python tracker ___

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

2017-12-19 Thread STINNER Victor
STINNER Victor added the comment: In kernel logs (look at dmesg), I found two messages: vstinner@apu$ journalctl -k|grep random déc. 14 23:10:28 apu kernel: random: fast init done déc. 14 23:10:32 apu kernel: random: crng init done Sadly, I don't know which one means

[issue32030] PEP 432: Rewrite Py_Main()

2017-12-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset c4bca951065f4b2b6833f6ce7a0721e863e2343e by Victor Stinner in branch 'master': bpo-32030: Add _PyCoreConfig.argv (#4934) https://github.com/python/cpython/commit/c4bca951065f4b2b6833f6ce7a0721e863e2343e --

Re: What is wrong with this regex for matching emails?

2017-12-19 Thread Random832
On Mon, Dec 18, 2017, at 02:01, Chris Angelico wrote: > Hmm, is that true? I was under the impression that the quoting rules > were impossible to match with a regex. Or maybe it's just that they're > impossible to match with a *standard* regex, but the extended > implementations (including

[issue32030] PEP 432: Rewrite Py_Main()

2017-12-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4826 ___ Python tracker ___ ___

[issue32380] functools.singledispatch interacts poorly with methods

2017-12-19 Thread Ethan Smith
New submission from Ethan Smith : Consider the following: from functools import singledispatch class Dispatch: @singledispatch def foo(self, a): return a @foo.register(int) def _(self, a): return "int" @foo.register(str) def _(self,

Re: What is wrong with this regex for matching emails?

2017-12-19 Thread alister via Python-list
On Wed, 20 Dec 2017 08:21:02 +1100, Chris Angelico wrote: > On Wed, Dec 20, 2017 at 7:21 AM, alister via Python-list > wrote: >> On Mon, 18 Dec 2017 07:57:27 +1100, Ben Finney wrote: >>> A more correct match would boil down to: >>> >>> * Match any printable Unicode

[issue30697] segfault in PyErr_NormalizeException() after memory exhaustion

2017-12-19 Thread Brett Cannon
Brett Cannon added the comment: Re-opened as a release blocker to make sure we're okay with the potential ABI breakage. -- nosy: +ned.deily priority: normal -> release blocker status: closed -> open ___ Python tracker

Re: What is wrong with this regex for matching emails?

2017-12-19 Thread Chris Angelico
On Wed, Dec 20, 2017 at 7:21 AM, alister via Python-list wrote: > On Mon, 18 Dec 2017 07:57:27 +1100, Ben Finney wrote: >> A more correct match would boil down to: >> >> * Match any printable Unicode characters (not just ASCII). >> >> * Locate the *last* ‘@’ character. (An

[issue29051] Improve error reporting involving f-strings (PEP 498)

2017-12-19 Thread Eric V. Smith
Eric V. Smith added the comment: The example above (msg289501) has been fixed. I think it was in #30465. It also fixes some of these other cases, but I haven't reviewed them all. -- ___ Python tracker

Re: [Python-Dev] [RELEASE] Python 3.6.4 is now available

2017-12-19 Thread Hasan Diwan
Grats to all! On 19 December 2017 at 00:42, Ned Deily wrote: > On behalf of the Python development community and the Python 3.6 > release team, I am happy to announce the availability of Python 3.6.4, > the fourth maintenance release of Python 3.6. Detailed information > about

[issue32376] Unusable syntax error reported when Python keyword in a f-string

2017-12-19 Thread R. David Murray
R. David Murray added the comment: The existing issue is #29051. -- nosy: +r.david.murray resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Improve error reporting involving f-strings (PEP 498)

[issue32361] global / nonlocal interference : is this a bug, a feature or a design hole ?

2017-12-19 Thread Stefan Krah
Stefan Krah added the comment: Okay, I have never used something like that. Personally, I'd disallow the global statement in g() if 'a' is local in f(). >>> a = 10 >>> def f(): ... a = 20 ... def g(): ... global a ... print(a) ... g() ... >>>

[issue32361] global / nonlocal interference : is this a bug, a feature or a design hole ?

2017-12-19 Thread Camion
Camion added the comment: My interrogation is about the fact that this doesn't seem to have been a collective decision and I'm not even sure it WAS anyone decision : it might as well have been an unintentional consequence of an implementation choice. So, in the

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

2017-12-19 Thread Neil Schemenauer
Neil Schemenauer added the comment: Yeah, I think you are correct. Currently files not part of reference cycles get properly flushed and closed by the reference counter. Implementing my "buffer_register_flush" patch would cause files to be closed only by the cyclic

[issue32361] global / nonlocal interference : is this a bug, a feature or a design hole ?

2017-12-19 Thread R. David Murray
R. David Murray added the comment: Hmm. I suppose that could be clarified in the docs. I would find it very counter-intuitive for the grandparent 'a' to be accessible, which is probably why I did not consider that an issue. --

Re: correctness proof for alpha-beta algorithm

2017-12-19 Thread namenobodywants
On Monday, December 18, 2017 at 10:16:07 PM UTC-8, Terry Reedy wrote: > Where or how have you looked so far? How formal do you want? i want full-on formal with lots of rigor and every possible detail spelled out; i've looked in a couple of books but my best lead so far is a paper by knuth

Re: What is wrong with this regex for matching emails?

2017-12-19 Thread alister via Python-list
On Mon, 18 Dec 2017 07:57:27 +1100, Ben Finney wrote: > Peng Yu writes: > >> Hi, >> >> I would like to extract "a...@efg.hij.xyz". But it only shows ".hij". > > Others have address this question. I'll answer a separate one: > >> Does anybody see what is wrong with it?

[issue32361] global / nonlocal interference : is this a bug, a feature or a design hole ?

2017-12-19 Thread Camion
Camion added the comment: David and Stefan, you're both missing my main point which is the fact that the presence of the global declaration in the parent (g) **blocks the access to the grand parent context**, which would be accessible without this global

[issue31489] Signal delivered to a subprocess triggers parent's handler

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: You may switch to multiprocessing.Pool (with the "forkserver" method). Otherwise, you could workaround it by executing a function on all workers that will reset the signal configuration. To maximize the chances that it does get executed on

[issue31489] Signal delivered to a subprocess triggers parent's handler

2017-12-19 Thread Ilya Kulakov
Ilya Kulakov added the comment: Can you suggest an alternative to ProcessPoolExecutor for 3.6? -- ___ Python tracker ___

[issue29970] Severe open file leakage running asyncio SSL server

2017-12-19 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.5, Python 3.6 ___ Python tracker

[issue29970] Severe open file leakage running asyncio SSL server

2017-12-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: Fixed in 3.7 -- ___ Python tracker ___ ___

[issue32379] MRO computation could be faster

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Benchmarks: * before: $ ./env-orig/bin/pyperf timeit "class Test: pass" . Mean +- std dev: 9.51 us +- 0.17 us * after: $ ./env/bin/pyperf timeit "class Test: pass" . Mean +- std dev: 8.89 us +- 0.09 us

[issue32379] MRO computation could be faster

2017-12-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- keywords: +patch pull_requests: +4825 stage: -> patch review ___ Python tracker ___

[issue32379] MRO computation could be faster

2017-12-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +inada.naoki, serhiy.storchaka, vstinner ___ Python tracker ___

[issue32379] MRO computation could be faster

2017-12-19 Thread Antoine Pitrou
New submission from Antoine Pitrou : MRO computation involves a complicated merge calculation over several lists. But, for the simple (common) case where a class has a single base, the computation could be much simpler: take the base's MRO and prepend the derived class.

[issue29970] Severe open file leakage running asyncio SSL server

2017-12-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset f7686c1f5553b24e3307506a18e18f6544de94d3 by Andrew Svetlov (Neil Aspinall) in branch 'master': bpo-29970: Add timeout for SSL handshake in asyncio

[issue30697] segfault in PyErr_NormalizeException() after memory exhaustion

2017-12-19 Thread Anthony Sottile
Anthony Sottile added the comment: Should this have landed in python3.6? It removes a public symbol `PyExc_RecursionErrorInst` (abi break?) -- nosy: +Anthony Sottile ___ Python tracker

Re: Tkinter,show pictures from the list of files in catalog-problem

2017-12-19 Thread MRAB
On 2017-12-19 18:33, Ziggy wrote: I have a problem with this code, it seems to work but first it shows the picture then supposed to iterate through file list and shows them each changed after 3seconds however show just the last one from list.

[issue32378] test_npn_protocols broken with LibreSSL 2.6.1+

2017-12-19 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +4824 stage: -> patch review ___ Python tracker ___

[issue32377] Difference in ressurrection behavior with __del__ in py2 vs. py3

2017-12-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32377] Difference in ressurrection behavior with __del__ in py2 vs. py3

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset dc5770b161a5e28eeff73a406cd4eddb0676c5b5 by Antoine Pitrou (Miss Islington (bot)) in branch '3.6': bpo-32377: improve __del__ docs and fix mention about resurrection (GH-4927) (#4929)

[issue31489] Signal delivered to a subprocess triggers parent's handler

2017-12-19 Thread Nathaniel Smith
Nathaniel Smith added the comment: Ouch, yes, that's a tricky bug. This is definitely caused by the way that asyncio internally converts signals into messages along a pipe (well, socket, but same thing), and then after a fork-without-exec the child keeps writing into that

[issue32378] test_npn_protocols broken with LibreSSL 2.6.1+

2017-12-19 Thread Christian Heimes
New submission from Christian Heimes : LibreSSL 2.6.1 to 2.6.4 have a broken implementation of NPN protocol. 2.6.0 and earlier are fine. == FAIL: test_npn_protocols (test.test_ssl.ThreadedTests)

Re: Tkinter,show pictures from the list of files in catalog-problem

2017-12-19 Thread Rhodri James
On 19/12/17 18:33, Ziggy wrote: I have a problem with this code, it seems to work but first it shows the picture then supposed to iterate through file list and shows them each changed after 3seconds however show just the last one from list.

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

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think it would be quite disruptive to create a reference cycle each time open() is called. It may also break user scripts. -- ___ Python tracker

[issue32377] Difference in ressurrection behavior with __del__ in py2 vs. py3

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 4b965930e8625f77cb0e821daf5cc40e85b45f84 by Antoine Pitrou in branch 'master': bpo-32377: improve __del__ docs and fix mention about resurrection (#4927)

[issue32377] Difference in ressurrection behavior with __del__ in py2 vs. py3

2017-12-19 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4823 ___ Python tracker ___

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

2017-12-19 Thread Neil Schemenauer
Neil Schemenauer added the comment: Welp, another day another attempt. As mentioned in the PR 4847, atexit is not the answer. If the raw/buffered file pair are part of a reference cycle and the GC cleans it before atexit runs, then the buffered data can get lost. I

Tkinter,show pictures from the list of files in catalog-problem

2017-12-19 Thread Ziggy
I have a problem with this code, it seems to work but first it shows the picture then supposed to iterate through file list and shows them each changed after 3seconds however show just the last one from list. https://paste.pound-python.org/show/txvB4IBtlUrn3TuB0rtu/ --

[issue32377] Difference in ressurrection behavior with __del__ in py2 vs. py3

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've proposed a documentation improvement in https://github.com/python/cpython/pull/4927 . Please chime in if you see have issues with it. -- ___ Python tracker

[issue32377] Difference in ressurrection behavior with __del__ in py2 vs. py3

2017-12-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- keywords: +patch pull_requests: +4822 stage: needs patch -> patch review ___ Python tracker ___

[issue32377] Difference in ressurrection behavior with __del__ in py2 vs. py3

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 19/12/2017 à 17:46, Eric Cousineau a écrit : > > My current hack is to call `_PyGC_SET_FINALIZED(self, 0)` - may I ask if > there is a simpler way to do this? Well... perhaps you could create another PyObject (it's just a wrapper, right?)

[issue31113] Stack overflow with large program

2017-12-19 Thread Stefan Nordhausen
Change by Stefan Nordhausen : -- nosy: +snordhausen ___ Python tracker ___

[issue32373] Add socket.getblocking() method

2017-12-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: Agree, it's a bug. +1 for getblocking() -- ___ Python tracker ___

[issue32377] Difference in ressurrection behavior with __del__ in py2 vs. py3

2017-12-19 Thread Eric Cousineau
Eric Cousineau added the comment: You're welcome, and thank you for the prompt response! I will say that it feels a tad odd to only have `tp_finalize` be called once for the entire lifetime of the object, while still having the option of it being resurrected. Is

[issue32377] Difference in ressurrection behavior with __del__ in py2 vs. py3

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the report. Apparently I forgot to update that piece of documentation when PEP 442 was implemented. -- nosy: +pitrou stage: -> needs patch versions: +Python 3.7 -Python 3.4, Python 3.5

[issue32377] Difference in ressurrection behavior with __del__ in py2 vs. py3

2017-12-19 Thread Eric Cousineau
New submission from Eric Cousineau : Due to how `PyObject_CallFinalizer` is written in python3, `__del__` will only *ever* be called once. In my use case, I am experimenting with a feature in `pybind11` to prevent slicing with Python class instances that inherit

[issue32376] Unusable syntax error reported when Python keyword in a f-string

2017-12-19 Thread Eric V. Smith
Eric V. Smith added the comment: Yes, this is a real problem. I think there's already an issue for this, but I can't find it. Unfortunately, to fix it requires a bit of refactoring on how line numbers and errors are tracked. It's on my list of things to do. --

[issue32373] Add socket.getblocking() method

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Now is having a timeout and blocking send/recv methods on a non-blocking > socket a feature? Or is this a bug? I agree it's a bug (but should only be fixed in 3.7). Also I agree with adding a socket.getblocking() method. --

[issue32376] Unusable syntax error reported when Python keyword in a f-string

2017-12-19 Thread Dmitry sky
New submission from Dmitry sky : def get_search_url(from_, to): return f"http://thesite.com/Search?SO0={from_}={to}={from}=false; # pls note `from_` vs `from` ^^ $ python fstring.py File "", line 1 (from) ^

[issue32373] Add socket.getblocking() method

2017-12-19 Thread Yury Selivanov
Yury Selivanov added the comment: It looks like we have a bug with 'sock.settimeout()' and non-blocking/blocking modes (or maybe this is a feature?) Currently: * to make a socket non-blocking, we call 'sock.settimeout(0)'. * to make a socket blocking, we call

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

2017-12-19 Thread Dustin Spicuzza
Dustin Spicuzza added the comment: I'm sure that the platform (a RT linux customized by National Instruments) has issues related to urandom, as this has reared it's ugly head with other PEP 525 related issues also: https://bugs.python.org/issue29208 I'll have to

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

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 19/12/2017 à 15:50, STINNER Victor a écrit : > > Hum, it looks like an "embedded device", likely with no entropy source. If it does I/O (which it probably does, being used for robotics), it should certainly be able to extract entropy from

[issue32375] Compilation warnings with gcc

2017-12-19 Thread Antoine Pitrou
New submission from Antoine Pitrou : On Ubuntu 16.04: $ gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for

[issue31489] Signal delivered to a subprocess triggers parent's handler

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I get the feeling (without actually investigating) that this is because a fork()-created process inherits all the parent's configuration, including (in this case) signal handlers and whatever file descriptor was configured to receive signal

Re: [OT] Python and Excel

2017-12-19 Thread Rustom Mody
On Tuesday, December 19, 2017 at 4:38:17 AM UTC+5:30, Les Cargill wrote: > oliver wrote: > > That would be amazing. I still have nightmares of when I had to create this > > big options analysis VBA program in Excel 2007. > > > > > Odd - I haven't found VBA itself to be all that horrible. Yeah,

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

2017-12-19 Thread STINNER Victor
STINNER Victor added the comment: > Found on Python 3.6 on a low-resource platform (NI RoboRIO), ... Hum, it looks like an "embedded device", likely with no entropy source. To check if os.urandom() will block, try to call the following function in your main script:

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2017-12-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- versions: +Python 3.6 ___ Python tracker ___ ___

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2017-12-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- assignee: -> docs@python components: +Documentation nosy: +docs@python type: -> behavior ___ Python tracker

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: By the way, I think you forgot to answer my question on python-dev: > can you get multi-interpreter support *without* PEP 489? That is, using > single-phase initialization and PyModule_GetState(). The doc currently isn't very clear about

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2017-12-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +scoder ___ Python tracker ___ ___ Python-bugs-list

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2017-12-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list

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

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: So calling urandom() hangs on your device because there's not enough entropy? What OS is this running? Modern Linux, at least, should never block in urandom() (AFAIK). -- nosy: +christian.heimes, pitrou type: behavior -> resource

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2017-12-19 Thread Marcel Plch
Change by Marcel Plch : -- keywords: +patch pull_requests: +4821 stage: -> patch review ___ Python tracker ___

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2017-12-19 Thread Petr Viktorin
Petr Viktorin added the comment: Marcel, could you look into this? -- nosy: +Dormouse759 ___ Python tracker ___

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2017-12-19 Thread Petr Viktorin
New submission from Petr Viktorin : After the create phase of multiphase initialization, the per-module state is NULL and the module object is reachable by the garbage collector. Between the create and exec phases, Python code is run and garbage collection can be triggered.

[issue32306] Clarify map API in concurrent.futures

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hi David, > what happens behind the scenes is that the call blocks until all results are > computed and only then starts yielding them. The current implementation of the Executor.map() generator is: def result_iterator():

[issue32373] Add socket.getblocking() method

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

[issue32373] Add socket.getblocking() method

2017-12-19 Thread Yury Selivanov
Change by Yury Selivanov : -- nosy: +asvetlov, vstinner ___ Python tracker ___ ___

[issue32373] Add socket.getblocking() method

2017-12-19 Thread Yury Selivanov
New submission from Yury Selivanov : Currently we have the following methods: * socket.settimeout(t) -- can set the socket in blocking mode, when t==0. * socket.setblocking(flag) -- sets in blocking or non-blocking mode. * socket.gettimeout() -- returns 0 when socket is in

  1   2   >