[issue33033] Clarify that the signed number convertors to PyArg_ParseTuple... *do* overflow checking

2018-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This doesn't look a good idea to me. It is implied that all checks are performed. For example it is implied that an error will be raised if the argument is of wrong type. I think that adding "with overflow checking" to every

Re: Unnoticed traceback in a thread

2018-03-08 Thread dieter
Skip Montanaro writes: > I have a program which is almost always running in a single thread. It > uses a daemon thread (via threading.Timer) to periodically checkpoint > some state. The program runs for days at a time. > > Over the past couple days, two instances of the

Re: socket: Did I find a bug?

2018-03-08 Thread dieter
Antoon Pardon writes: > This is on a debian 9 box python 2.7.13 > > My interpretation is that a timeout exception is thrown and that the > args attribute of such an exception is an empty tuple which then causes > an IndexError in line 482 of module

Re: Module Issue

2018-03-08 Thread dieter
Abdur-Rahmaan Janhangeer writes: > i have a project at > > https://github.com/Abdur-rahmaanJ/honeybot > > see https://github.com/Abdur-rahmaanJ/honeybot/tree/master/honeybot > > my question is : > > how to include a util file / module that can be imported in both >

[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-03-08 Thread Nathan Henrie
Nathan Henrie added the comment: It seems to work if you close proto.transport (as is done in `test_write_pty()`). -- ___ Python tracker

[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-03-08 Thread Nathan Henrie
Change by Nathan Henrie : -- keywords: +patch pull_requests: +5799 stage: needs patch -> patch review ___ Python tracker ___

Re: I found strange thing while studying through idle

2018-03-08 Thread Ben Finney
MRAB writes: > I think the line was actually […] > (I also think that "crystal" is […] Let's not get into the warrens of responding to what the OP *didn't* write. we're in no hurry. I'd like to wait for clarification from the original poster, and not guess what they

Re: Which part of the loop is it going through in this class frame?

2018-03-08 Thread Steven D'Aprano
On Thu, 08 Mar 2018 20:25:42 -0500, C W wrote: > Thank you guys, lots of great answers, very helpful. I got it! > > A follow-up question: > > How did the value of "object" get passed to "time"? Obviously, they have > different names. How did Python make that connection? It didn't. You have

Re: Spot the invalid syntax

2018-03-08 Thread Steven D'Aprano
On Fri, 09 Mar 2018 00:47:21 +, MRAB wrote: > On 2018-03-08 23:57, Ben Finney wrote: >> You mean the tool is not always looking for mistakes while you type? [...] >> Certainly it'd be good to always have a *perfect* overseer checking for >> mistakes . Until that happy day, though, let's use

Re: I found strange thing while studying through idle

2018-03-08 Thread MRAB
On 2018-03-09 03:57, Steven D'Aprano wrote: [snip] In IDLE 3.5 on Linux, I get this: print('hello\rpython') hello\rpython Curiously, that's not a backslash r, it's actually a carriage return: when I copy and paste it in this text, the editor treated it as a new line character: # direct

Re: I found strange thing while studying through idle

2018-03-08 Thread MRAB
On 2018-03-09 01:59, Ben Finney wrote: Welcome, and congratulations on beginning with Python. 노연수 writes: If you type print (" hello\ rpython ") into the python 3.7.0.b2 I am not using Python 3.7 (it isn't released yet); I recommend staying with the latest Python

Re: I found strange thing while studying through idle

2018-03-08 Thread Steven D'Aprano
I'm afraid the original post by 노연수 has not come through to me, so I will have to reply to Ben's reply. On Fri, 09 Mar 2018 12:59:52 +1100, Ben Finney wrote: > I am not using Python 3.7 (it isn't released yet); I recommend staying > with the latest Python release. Today,

[issue28626] Tutorial: rearrange discussion of output formatting to encourage f-strings

2018-03-08 Thread A.M. Kuchling
Change by A.M. Kuchling : -- pull_requests: +5798 ___ Python tracker ___ ___ Python-bugs-list

Re: Futurize maps StringIO.StringIO to io.StringIO

2018-03-08 Thread Skip Montanaro
Thanks. In one instance I used six.StringIO, which seems to work. The question I had was more why futurize makes a transformation which is an obvious semantic change. Skip On Thu, Mar 8, 2018, 7:55 PM Mark Lawrence wrote: > On 08/03/18 02:34, Skip Montanaro wrote: > > I

Re: I found strange thing while studying through idle

2018-03-08 Thread Ben Finney
Welcome, and congratulations on beginning with Python. 노연수 writes: > If you type print (" hello\ rpython ") into the python 3.7.0.b2 I am not using Python 3.7 (it isn't released yet); I recommend staying with the latest Python release. Today, that is version 3.6. That

Re: Futurize maps StringIO.StringIO to io.StringIO

2018-03-08 Thread Mark Lawrence
On 08/03/18 02:34, Skip Montanaro wrote: I had some deja vu recently, cuz of this old thread: https://mail.python.org/pipermail/python-list/2013-May/648245.html Today the context is different, but the problem remains the same. One of the futurize refactoring tools converts usage of

I am a student studying Python in Korea. I found strange thing while studying through idle

2018-03-08 Thread 노연수
If you type print (" hello\ rpython ") into the python 3.7.0.b2, only the python is printed and i learned it's a crystal. However, if you type print (" hello\ rpython ") in the python 3.7.0.b2 idle, it is output as hellopython. I wonder why it prints like this. I would appreciate your answer.

Relationship between ‘object’ and the name of an object (was: Which part of the loop is it going through in this class frame?)

2018-03-08 Thread Ben Finney
C W writes: > A follow-up question: (When you want to switch the discussion to a different subject, please indicate that by changing the Subject field in your message. I am not really clear on what you're asking, so I have guessed and made a subject that I think summarises

Re: Which part of the loop is it going through in this class frame?

2018-03-08 Thread C W
Thank you guys, lots of great answers, very helpful. I got it! A follow-up question: How did the value of "object" get passed to "time"? Obviously, they have different names. How did Python make that connection? Code is below for convenience. class Clock(object): def __init__(self, time):

Re: Unnoticed traceback in a thread (Posting On Python-List Prohibited)

2018-03-08 Thread Rob Gaddi
On 03/08/2018 05:06 PM, Lawrence D’Oliveiro wrote: On Friday, March 9, 2018 at 11:43:00 AM UTC+13, Paul Rubin wrote: That you're using threading.Lock for something like this is a borderline code smell. Any use of multithreading in non-CPU-intensive code is a code smell. But CPU intensive

[issue33033] Clarify that the signed number convertors to PyArg_ParseTuple... *do* overflow checking

2018-03-08 Thread Antony Lee
New submission from Antony Lee : At https://docs.python.org/3/c-api/arg.html#numbers, it is explicitly documented that the unsigned number convertors do not perform overflow checking. Implicitly, this suggests that the signed convertors *do* perform overflow checking,

Re: Spot the invalid syntax

2018-03-08 Thread MRAB
On 2018-03-08 23:57, Ben Finney wrote: Chris Angelico writes: On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney wrote: > In many cases, those eyes can be virtual and non-human. > > That's what syntax highlighting, and tools even more impressive > (e.g.

Re: Spot the invalid syntax

2018-03-08 Thread Ian Pilcher
On 03/08/2018 05:30 PM, Ben Finney wrote: Not sufficiently, it seems. Check the line preceding the ‘return’ statement. Indeed. :-/ Then, switch to using a programmer's text editor (I prefer Emacs) that can spot these syntax errors while you type. The sad thing is that I am. Just too

Re: Spot the invalid syntax

2018-03-08 Thread Ian Pilcher
On 03/08/2018 05:26 PM, Chris Angelico wrote: On Fri, Mar 9, 2018 at 10:23 AM, Ian Pilcher wrote: (Because I certainly can't.) ips.update(_san_dnsname_ips(cname, True) return ips I've checked for tabs and mismatched parentheses. Check the

Re: Spot the invalid syntax

2018-03-08 Thread Bob van der Poel
On Thu, Mar 8, 2018 at 4:23 PM, Ian Pilcher wrote: > (Because I certainly can't.) > > def _san_dnsname_ips(dnsname, dnsname_is_cname=False): >> """ >> Returns a set of IP addresses, managed by this IPa instance, >> that correspond to the DNS name (from the

Re: Spot the invalid syntax

2018-03-08 Thread Terry Reedy
On 3/8/2018 6:30 PM, Ben Finney wrote: Ian Pilcher writes: ips.update(_san_dnsname_ips(cname, True) | <= auto-indent If you type this code line in IDLE or other decent Python-aware code editor, the smart indent would put

Re: Spot the invalid syntax

2018-03-08 Thread MRAB
On 2018-03-08 23:23, Ian Pilcher wrote: (Because I certainly can't.) def _san_dnsname_ips(dnsname, dnsname_is_cname=False): """ Returns a set of IP addresses, managed by this IPa instance, that correspond to the DNS name (from the subjectAltName). """ fqdn =

Re: Spot the invalid syntax

2018-03-08 Thread Chris Angelico
On Fri, Mar 9, 2018 at 10:57 AM, Ben Finney wrote: > Chris Angelico writes: > >> On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney >> wrote: >> > In many cases, those eyes can be virtual and non-human. >> > >> > That's what

Re: Spot the invalid syntax

2018-03-08 Thread Ben Finney
Chris Angelico writes: > On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney > wrote: > > In many cases, those eyes can be virtual and non-human. > > > > That's what syntax highlighting, and tools even more impressive > > (e.g. linting tools that run

Re: Spot the invalid syntax

2018-03-08 Thread Chris Angelico
On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney wrote: > Chris Angelico writes: > >> (Sometimes, you just need another pair of eyes.) > > In many cases, those eyes can be virtual and non-human. > > That's what syntax highlighting, and tools even more

Re: Spot the invalid syntax

2018-03-08 Thread Ben Finney
Chris Angelico writes: > (Sometimes, you just need another pair of eyes.) In many cases, those eyes can be virtual and non-human. That's what syntax highlighting, and tools even more impressive (e.g. linting tools that run continually), offer in a programmer's text editor: a

Re: Spot the invalid syntax

2018-03-08 Thread Ben Finney
Ian Pilcher writes: > > ips.update(_san_dnsname_ips(cname, True) > > return ips > > 2.7 and 3.6 are both giving me: > > File "/tmp/test.py", line 32 > return ips > ^ > SyntaxError: invalid syntax > > I've checked for tabs and mismatched

Re: Spot the invalid syntax

2018-03-08 Thread Chris Angelico
On Fri, Mar 9, 2018 at 10:23 AM, Ian Pilcher wrote: > (Because I certainly can't.) > >> ips.update(_san_dnsname_ips(cname, True) >> return ips > > > 2.7 and 3.6 are both giving me: > > File "/tmp/test.py", line 32 > return ips > ^ >

[issue33032] Mention implicit cache in struct.Struct docs

2018-03-08 Thread Nick Coghlan
Nick Coghlan added the comment: The note on https://docs.python.org/3/library/re.html#re.compile provides a useful precedent for possible wording here, as the struct cache and the regex cache are quite similar. -- ___ Python

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > We know that the path is valid because we have a handle (in this case the > file system ensures that no parent directory in the path can be unlinked or > renamed). Thank you for pointing this out. I erroneously stated that the length

Spot the invalid syntax

2018-03-08 Thread Ian Pilcher
(Because I certainly can't.) def _san_dnsname_ips(dnsname, dnsname_is_cname=False): """ Returns a set of IP addresses, managed by this IPa instance, that correspond to the DNS name (from the subjectAltName). """ fqdn = dnsutil.DNSName(dnsname).make_absolute() if

[issue33032] Mention implicit cache in struct.Struct docs

2018-03-08 Thread Nick Coghlan
New submission from Nick Coghlan : The struct.Struct docs claim that creating and re-using a Struct object will be noticeably faster than calling the module level methods repeatedly with the same format string, as it will avoid parsing the format string multiple times:

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > unless users are not prepared to deal with it ARE prepared > What do you think about handling this failure by calling GetFullPathName > instead (e.g. "C:\Temp\NUL" => "\\.\NUL")? I think it would indeed be nice if pathlib handled such

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Because we only try VOLUME_NAME_DOS, this function always fails for a volume > that's not mounted as either a drive letter or a junction mount point. If a volume is not mounted, users have to use \\?\ or \\.\ either directly or

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Steve Dower
Steve Dower added the comment: Leaving this open for commit review (and buildbots) for a little while, but then I'll close it if we're all good. -- assignee: -> steve.dower stage: patch review -> commit review ___ Python

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Steve Dower
Steve Dower added the comment: New changeset 32efcd13069a89abf007373274ee1bc0909d1996 by Steve Dower in branch '3.6': bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (GH-6032)

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Copying the comment of @eryksun from PR 6010 for reference. Because we only try VOLUME_NAME_DOS, this function always fails for a volume that's not mounted as either a drive letter or a junction mount point. The error in this case is

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: @eryksun Very interesting! BTW, I looked at CreateFile docs, and the fact that it may set the last error to zero is even documented there. @steve.dower > maybe we don't have to preserve errno on Windows? There are still places where

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Eryk Sun
Eryk Sun added the comment: FYI, here's a sampling of successful calls that modify the last error value. Most Create- functions intentionally set the last error to 0 on success, such as CreateFile, CreateFileMapping, CreateSymbolicLink, CreateJobObject, CreateEvent,

[issue32642] add support for path-like objects in sys.path

2018-03-08 Thread Jay Yin
Jay Yin added the comment: The issue was resolved by updating my version of the rest of the package apparently and remaking the whole thing, must have been some outdated stuff on my end causing the issue -- ___ Python

[issue33023] Unable to copy ssl.SSLContext

2018-03-08 Thread Vitaly Kruglikov
Vitaly Kruglikov added the comment: Also, updating ssl.SSLContext documentation about intentional inability to copy generically and suggestion how to go about it if you need to obtain a clone or similar would be terrific and save developers time so they won't run into

[issue33023] Unable to copy ssl.SSLContext

2018-03-08 Thread Vitaly Kruglikov
Vitaly Kruglikov added the comment: Hi Christian, thank you for following up. Here is my use case, and perhaps you can suggest something else that will work: I am refactoring the transport layer in the Pika AMQP client library. The user provides an ssl.SSLContext

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Steve Dower
Steve Dower added the comment: > Before take_gil() knows whether it has to do any work I thought we had a check for when the GIL was not even initialized, but that doesn't seem to exist in master any more. Preserving GetLastError() at the same place we do errno is

Unnoticed traceback in a thread

2018-03-08 Thread Skip Montanaro
I have a program which is almost always running in a single thread. It uses a daemon thread (via threading.Timer) to periodically checkpoint some state. The program runs for days at a time. Over the past couple days, two instances of the subthread croaked with tracebacks because while they were

[issue32981] Catastrophic backtracking in poplib (CVE-2018-1060) and difflib (CVE-2018-1061)

2018-03-08 Thread Ned Deily
Change by Ned Deily : -- keywords: +security_issue nosy: +larry priority: normal -> critical title: Catastrophic backtracking in poplib and difflib -> Catastrophic backtracking in poplib (CVE-2018-1060) and difflib (CVE-2018-1061) versions: +Python 2.7, Python 3.4,

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about __floor__ and __ceil__? I think all these three method do not deserve separate paragraphs in Doc/reference/datamodel.rst, but they should be grouped together with __round__. -- nosy: +serhiy.storchaka

[issue32972] unittest.TestCase coroutine support

2018-03-08 Thread Nathaniel Smith
Nathaniel Smith added the comment: You should also think about loop lifecycle: right now it's using the same loop for all test cases, so callbacks can leak between tests. Twisted actually goes a step further and explicitly checks for left over callbacks and fails the test if

[issue32981] Catastrophic backtracking in poplib and difflib

2018-03-08 Thread Ned Deily
Change by Ned Deily : -- pull_requests: +5797 ___ Python tracker ___ ___ Python-bugs-list

[issue32981] Catastrophic backtracking in poplib and difflib

2018-03-08 Thread Ned Deily
Change by Ned Deily : -- pull_requests: +5796 ___ Python tracker ___ ___ Python-bugs-list

[issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions

2018-03-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka stage: -> needs patch versions: +Python 3.8 ___ Python tracker ___

[issue32972] unittest.TestCase coroutine support

2018-03-08 Thread Petter S
Petter S added the comment: > 1. Do we need support for async versions of setUp, setUpClass, etc? In my > opinion: yes. I completely agree. I would imagine many or most real-world tests requiring async setUp. There is also the question on how a custom loop etc.

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Ideally, if we don't have to do any work to reacquire the GIL, we shouldn't > do any work to preserve the error code either. Before take_gil() knows whether it has to do any work, it calls MUTEX_LOCK(_PyRuntime.ceval.gil.mutex), which

[issue33031] Questionable code in OrderedDict definition

2018-03-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The array of PyMethodDef for OrderedDict contains explicit definitions of methods like __delitem__, __eq__ and __init__. The purpose is aligning docstrings with Python implementation. But this doesn't work. Slot wrappers

Re: psychocomputational analysis toolkit in Python?

2018-03-08 Thread Etienne Robillard
OK I got it, thank you! :) Essentially, I want to develop a psychocomputational analysis toolkit in Python for studying real-time neuroimaging data (of cortical activity) from low-intensity, focused ultrasounds (LIFU) and possibly emulate a functional brain-to-brain coupling system on my

[issue29871] Enable optimized locks on Windows

2018-03-08 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- nosy: +izbyshev ___ Python tracker ___ ___

[issue32592] Drop support of Windows Vista in Python 3.7

2018-03-08 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- nosy: +izbyshev ___ Python tracker ___ ___

[issue32972] unittest.TestCase coroutine support

2018-03-08 Thread Yury Selivanov
Yury Selivanov added the comment: > That code does not seem to work for me: > https://gist.github.com/PetterS/f684095a09fd1d8164a4d8b28ce3932d > I get "RuntimeWarning: coroutine 'test_async_with_mock' was never awaited" > @mock.patch needs to work correctly for test

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Steve Dower
Steve Dower added the comment: > GetLastError() docs officially scare us I believe this is a case where the docs were updated from intended/correct behavior to actual behavior, which happens from time to time and is never clearly marked. As I say, they are _supposed_

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: FWIW, GetLastError() docs[1] officially scare us: Most functions that set the thread's last-error code set it when they fail. However, some functions also set the last-error code when they succeed. If the function is not documented to

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread miss-islington
miss-islington added the comment: New changeset 8c163bbf370f6f6cedd2c07f7d54c9b36c97d8f2 by Miss Islington (bot) in branch '3.7': bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (GH-6010)

[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2018-03-08 Thread Steve Dower
New submission from Steve Dower : Most Win32 API calls are made within Py_BEGIN_ALLOW_THREADS blocks, as they do not access Python objects and so we can release the GIL. However, in general, error handling occurs after the Py_END_ALLOW_THREADS line. Due to the design

[issue28113] Remove Py_CreateSymbolicLinkW

2018-03-08 Thread Steve Dower
Steve Dower added the comment: We should look at merging this, though we need a few things to be done first (anyone can jump in and do these, doesn't have to be Eryk): * patch needs to be converted to a GitHub PR * we should use unique names within %TEMP% to avoid

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Steve Dower
Change by Steve Dower : -- pull_requests: +5795 ___ Python tracker ___ ___

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread miss-islington
Change by miss-islington : -- pull_requests: +5794 ___ Python tracker ___

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Steve Dower
Steve Dower added the comment: New changeset 3b20d3454e8082e07dba93617793de5dc9237828 by Steve Dower (Alexey Izbyshev) in branch 'master': bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (#6010)

Re: psychocomputational analysis toolkit in Python?

2018-03-08 Thread Bob Gailer
On Mar 8, 2018 10:08 AM, "Etienne Robillard" wrote: > > Thanks for sharing this link. MNE looks pretty cool. :-) > > I'm mostly interested in mapping specific cortical pathways to brain-to-brain interfaces implicated in the ultrasonic neuromodulation of behavior. > > Would it

[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2018-03-08 Thread Ned Deily
Change by Ned Deily : -- resolution: -> fixed stage: backport needed -> resolved status: open -> closed versions: +Python 3.7 ___ Python tracker

Re: psychocomputational analysis toolkit in Python?

2018-03-08 Thread Christopher Mullins
> Would it be possible to emulate a minimally functional brain-to-brain coupling system entirely in Python? I don't know what that would entail, but the links I shared have a mailing list and a very responsive gitter, both of which would be great places to ask about that! (You're welcome to ask

[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2018-03-08 Thread Ned Deily
Ned Deily added the comment: New changeset 2f3ba27185a369bcb6b36b13aa3518ffcc970ffa by Ned Deily (Miss Islington (bot)) in branch '3.6': [3.6] bpo-30353: Fix pass by value for structs on 64-bit Cygwin/MinGW (GH-1559) (GH-5954)

[issue33028] tempfile.TemporaryDirectory incorrectly documented

2018-03-08 Thread Ned Deily
Change by Ned Deily : -- type: enhancement -> ___ Python tracker ___ ___ Python-bugs-list

[issue33028] tempfile.TemporaryDirectory incorrectly documented

2018-03-08 Thread Ned Deily
Change by Ned Deily : -- nosy: +lars.gustaebel versions: +Python 3.7, Python 3.8 ___ Python tracker ___

[issue33029] Invalid function cast warnings with gcc 8 for getter and setter functions

2018-03-08 Thread Siddhesh Poyarekar
New submission from Siddhesh Poyarekar : gcc 8 has added a new warning heuristic to detect invalid function casts and a stock python build seems to hit that warning quite often. bug 33012 fixes the most trivial case of METH_NOARGS, this bug is to track a

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-03-08 Thread Siddhesh Poyarekar
Change by Siddhesh Poyarekar : -- keywords: +patch pull_requests: +5792 stage: -> patch review ___ Python tracker ___

Re: psychocomputational analysis toolkit in Python?

2018-03-08 Thread Etienne Robillard
Thanks for sharing this link. MNE looks pretty cool. :-) I'm mostly interested in mapping specific cortical pathways to brain-to-brain interfaces implicated in the ultrasonic neuromodulation of behavior. Would it be possible to emulate a minimally functional brain-to-brain coupling system

Re: psychocomputational analysis toolkit in Python?

2018-03-08 Thread Christopher Mullins
You might find MNE useful, and if what you're doing happens to fit somewhere in their package you could contribute to it -- they're a good group to work with. https://www.martinos.org/mne/stable/index.html https://github.com/mne-tools/mne-python --

[issue33018] Improve issubclass() error checking and message

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: PR 5944 changes ABC.__subclasscheck__ (not issubclass) to check its first argument, so if it's merged there will be no crash even with the revert. -- ___ Python tracker

[issue33018] Improve issubclass() error checking and message

2018-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Can > https://github.com/python/cpython/commit/fc7df0e664198cb05cafd972f190a18ca422989c > be reverted? Even if subclass() will check explicitly that its first argument is a type, ABC.__subclasscheck__() can be called

psychocomputational analysis toolkit in Python?

2018-03-08 Thread Etienne Robillard
Hi i want to develop a psychocomputational analysis toolkit in python for studying real-time neuroimaging data from focused ultrasound/brain-to-brain interfaces. Any suggestions where to look for cool projects in github? :) Best regards, Etienne -- Etienne Robillard tkad...@yandex.com

[issue33018] Improve issubclass() error checking and message

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Isn't it just a limitation? > Most Python-implemented objects supports weakref. I don't think "requiring > weakref support implies it must be type object". Formally, there is no implication. It is the abc module authors who know the

[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2018-03-08 Thread Erik Bray
Erik Bray added the comment: This has a backport PR now for 3.6. Once that PR is merged I think we can close this as fixed. -- stage: patch review -> backport needed versions: +Python 3.6 ___ Python tracker

[issue32972] unittest.TestCase coroutine support

2018-03-08 Thread Petter S
Petter S added the comment: > No, it shouldn't break them if you wrap async methods carefully. > Here's a metaclass that I wrote recently doing just that That code does not seem to work for me: https://gist.github.com/PetterS/f684095a09fd1d8164a4d8b28ce3932d I get

EuroPython 2018: Hotel tips and general update

2018-03-08 Thread M.-A. Lemburg
As you may know, the Edinburgh Fringe Festival is starting one week after EuroPython 2018 in Edinburgh. Since this typically attracts many thousands of people and artists, the hotels are filling up quickly in Edinburgh. If you’re planning to attend EuroPython, please book your hotel early. Many

ANN: pygameweb 0.0.4 - Northern Rockhopper Penguin

2018-03-08 Thread René Dudfield
G'day. pygameweb is the source code for the pygame website at https://www.pygame.org/ [image: 6954251406_95ebe75f55_m] - #52

ANN: pygameweb 0.0.4 - Northern Rockhopper Penguin

2018-03-08 Thread René Dudfield
G'day. pygameweb is the source code for the pygame website at https://www.pygame.org/ [image: 6954251406_95ebe75f55_m] - #52

[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2018-03-08 Thread Christian Heimes
Change by Christian Heimes : -- assignee: christian.heimes -> ___ Python tracker ___ ___

[issue33023] Unable to copy ssl.SSLContext

2018-03-08 Thread Christian Heimes
Christian Heimes added the comment: This is rather a feature than a bug. It is not possible to make a copy of a SSLContext object because OpenSSL doesn't support the operation. A context contains elements that can't be cloned easily, e.g. session resumption tickets.

EuroPython 2018: Hotel tips and general update

2018-03-08 Thread M.-A. Lemburg
As you may know, the Edinburgh Fringe Festival is starting one week after EuroPython 2018 in Edinburgh. Since this typically attracts many thousands of people and artists, the hotels are filling up quickly in Edinburgh. If you’re planning to attend EuroPython, please book your hotel early. Many

[issue33018] Improve issubclass() error checking and message

2018-03-08 Thread INADA Naoki
INADA Naoki added the comment: > 1. ABCMeta.register() accepts types only. Yes. While ABC.register() and issubclass() have different users (e.g. ABC.register() will be used by framework author, and issubclass will be used by framework users), it's positive reason to

EuroPython 2018: Our conference logo

2018-03-08 Thread M.-A. Lemburg
After intense work with our designer, we are happy to present the logo for the EuroPython 2018 conference: https://blog.europython.eu/post/171656128512/europython-2018-our-conference-logo The colors and patterns are a play on Scottish kilts, referring to the location, and a theatre curtain,

Re: socket: Did I find a bug?

2018-03-08 Thread INADA Naoki
https://mail.python.org/pipermail/python-list/2016-February/703154.html On Thu, Mar 8, 2018 at 8:09 PM, Antoon Pardon wrote: > This is on a debian 9 box python 2.7.13 > > My interpretation is that a timeout exception is thrown and that the > args attribute of such an

[issue33024] asyncio.WriteTransport.set_write_buffer_limits orders its args unintuitively and inconsistently with its companion function's return value

2018-03-08 Thread Andrew Svetlov
Andrew Svetlov added the comment: We cannot change the method signature without breaking backward compatibility. I doubt if we should do something with the issue. -- ___ Python tracker

Re: Which part of the loop is it going through in this class frame?

2018-03-08 Thread Steven D'Aprano
On Wed, 07 Mar 2018 16:57:51 -0500, C W wrote: > Hello, > > I am new to OOP. I'm a bit confused about the following code. > > class Clock(object): > def __init__(self, time): > self.time = time Here you set the instance attribute "self.time". > def print_time(self): >

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-08 Thread Nir Soffer
Nir Soffer added the comment: Python cannot protect raw file descriptor from bad multi-threaded application. For example the application may close a file descriptor twice which may lead to closing unrelated file descriptor created by another thread just after it was closed,

[issue33018] Improve issubclass() error checking and message

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: I do not see any point in allowing non-types in ABCMeta.__subclasscheck__. Currently, ABCs are clearly not designed to support non-types: 1. ABCMeta.register() accepts types only. 2. ABCMeta.__subclasscheck__ implicitly requires its

socket: Did I find a bug?

2018-03-08 Thread Antoon Pardon
This is on a debian 9 box python 2.7.13 My interpretation is that a timeout exception is thrown and that the args attribute of such an exception is an empty tuple which then causes an IndexError in line 482 of module /usr/lib/python2.7/socket.py. Does that soundplausible? Here is the traceback:

  1   2   >