[issue26359] CPython build options for out-of-the box performance

2016-05-30 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

Hello Brett, I saw that there was no other activity on this issue so far. Can 
you please update this, as I do not have rights?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23459] Linux: expose the new execveat() syscall

2016-05-30 Thread Марк Коренберг

Марк Коренберг added the comment:

> we are already effectvely exposing fexecve

Did not found neither os.fexecve() nor os.execve() documentation about this. 
How I can use glibc's fexecve() ?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27161] Confusing exception in Path().with_name

2016-05-30 Thread R. David Murray

R. David Murray added the comment:

Again, I don't think so.  We don't generally wrap TypeErrors or ValueErrors.  
On the other hand, if the try/except can *add* additional contextual 
information about the error, it might be worthwhile.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27155] '-' sign typo in example

2016-05-30 Thread Ben Kane

Ben Kane added the comment:

https://docs.python.org/3/library/subprocess.html#subprocess.Popen.returncode

does mention the negativeness about returncode in conjunction with POSIX 
signals. It would be helpful to mention this Python-specific (I think) behavior 
in a comment. 
However, returncode can also be set by poll() and wait(), which can also return 
errors. In the more realistic example, I would appreciate code that handles 
those errors as well (a check for returncode > 0), or a comment detailing that 
other errors aren't handled. I copied that code into mine, and didn't consider 
those cases initially, because "realistic" was in the description.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27113] sqlite3 connect parameter "check_same_thread" not documented

2016-05-30 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for the review. Made it both singular in the updated patch.

* As for why the default value was chosen to be to True, I think, the reason is 
pysqlite, from sqlite3 module was derived, did not support this option when it 
was introduced. I still do not find that in pysqlite external library.

That being said, if we want to change the default to looking into multiple 
threads, we could attempt that change and introduce it. This will be a separate 
feature request ticket.

--
Added file: http://bugs.python.org/file43063/issue27113-rev2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27161] Confusing exception in Path().with_name

2016-05-30 Thread Ethan Furman

Ethan Furman added the comment:

I think the request is to raise a single PathlibError instead of the broad 
range of possible errors.  Something like:

try:
   blah blah
except TypeError as e:
   raise PathlibError(str(e))

Since pathlib is a high level library this seems appropriate.

--
nosy: +ethan.furman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Emanuel Barry

Emanuel Barry added the comment:

New patch with Berker's comments. I'm really not used to Sphinx markup so 
thanks for that!

> Is there any person who really thinks that their own patch is *not* ready for 
> commit review? :)

Partial patches aren't that uncommon in some projects. I also sometimes don't 
trust that I got everything right (especially if it's in a very large codebase 
like CPython), and having a few more pair of eyes taking a look at it helps.

--
Added file: http://bugs.python.org/file43062/type_one_argument_4.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Emanuel. I left some comments about Sphinx markup on 
Rietveld.

> Berker, I don't mind if people mark their own patches for commit review *when 
> they think it is ready for commit*.

Is there any person who really thinks that their own patch is *not* ready for 
commit review? :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22558] Missing doc links to source code

2016-05-30 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27161] Confusing exception in Path().with_name

2016-05-30 Thread R. David Murray

R. David Murray added the comment:

I don't think so.  Python uses duck typing, and one of the consequences of that 
is you can get weird errors if you pass in a type that sort-of-works but 
doesn't really.  Arbitrarily restricting the input type is not something we do 
(that's what the whole static type checking thing is about...doing that as an 
external lint process.)

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread R. David Murray

R. David Murray added the comment:

Berker, I don't mind if people mark their own patches for commit review *when 
they think it is ready for commit*.  (Just as with reviewers, if they start 
being consistently right, they are ready for commit privs :)  However, a 
non-committer setting a patch to commit review is waving a hand for attention 
from a core dev, and that should only be done *after* a patch has been 
*reviewed* and judged ready for final review before commit.

(I broke my own rule the other day and got in trouble, though...I set a patch 
to commit review to remind myself to review it rather than because I thought it 
was commit ready already, and it got committed...)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22331] test_io.test_interrupted_write_text() hangs on the buildbot FreeBSD 7.2

2016-05-30 Thread Martin Panter

Martin Panter added the comment:

Found the same hang on the 3.6 branch, which was definitely running separate 
processes:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.x/builds/4210/steps/test/logs/stdio
== CPython 3.6.0a0 (default:ed6345cb08ab, Apr 29 2016, 18:35:36) [GCC 4.2.1 
20070831 patched [FreeBSD]]
Run tests in parallel using 4 child processes

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27161] Confusing exception in Path().with_name

2016-05-30 Thread Antony Lee

New submission from Antony Lee:

`Path().with_name` can fail with a lot of different exceptions:

>>> Path("foo").with_name(0)
Traceback (most recent call last):
File "", line 1, in 
File "/usr/lib/python3.5/pathlib.py", line 800, in with_name
raise ValueError("Invalid name %r" % (name))
ValueError: Invalid name 0

>>> Path("foo").with_name(1)
Traceback (most recent call last):
File "", line 1, in 
File "/usr/lib/python3.5/pathlib.py", line 797, in with_name
drv, root, parts = self._flavour.parse_parts((name,))
File "/usr/lib/python3.5/pathlib.py", line 62, in parse_parts
drv, root, rel = self.splitroot(part)
File "/usr/lib/python3.5/pathlib.py", line 268, in splitroot
if part and part[0] == sep:
TypeError: 'int' object is not subscriptable

>>> Path("foo").with_name({})
Traceback (most recent call last):
File "", line 1, in 
File "/usr/lib/python3.5/pathlib.py", line 800, in with_name
raise ValueError("Invalid name %r" % (name))
ValueError: Invalid name {}

>>> Path("foo").with_name({0: 1})
Traceback (most recent call last):
File "", line 1, in 
File "/usr/lib/python3.5/pathlib.py", line 797, in with_name
drv, root, parts = self._flavour.parse_parts((name,))
File "/usr/lib/python3.5/pathlib.py", line 69, in parse_parts
parsed.append(sys.intern(rel))
TypeError: must be str, not dict

>>> Path("foo").with_name({"a": "b"})
Traceback (most recent call last):
File "", line 1, in 
File "/usr/lib/python3.5/pathlib.py", line 797, in with_name
drv, root, parts = self._flavour.parse_parts((name,))
File "/usr/lib/python3.5/pathlib.py", line 62, in parse_parts
drv, root, rel = self.splitroot(part)
File "/usr/lib/python3.5/pathlib.py", line 268, in splitroot
if part and part[0] == sep:
KeyError: 0

While most are fairly clear, the last one is particularly confusing IMO; 
additionally, looking at the implementation of `_Flavour.parse_parts` there 
seems to be room for even more confusion with a properly crafted dict.

Of course, with Python's dynamicity a lot of exceptions can be triggered at 
weird places using carefully crafted objects, but I think pathlib should at 
least raise a clear exception when passed an incorrect builtin type.

--
components: Library (Lib)
messages: 266724
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: Confusing exception in Path().with_name
versions: Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22331] test_io.test_interrupted_write_text() hangs on the buildbot FreeBSD 7.2

2016-05-30 Thread Martin Panter

Martin Panter added the comment:

Thanks, that is a very good point about threads. I remember that testing 
tkinter leaves an internal TK or TCL thread running in the background. And I 
understand Free BSD delivers process signals to arbitrary threads (not 
necessarily the main thread).

But the FreeBSD 3.5 buildbot looks like it ran test_io in a separate process 
(-j4 specified). Anyway it is another possible explanation of the hang (signal 
delivered to wrong thread, so write() call not interrupted).

Perhaps it is better to use signal.pthread_kill() instead of os.kill() in my 
proposal.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Berker Peksag

Berker Peksag added the comment:

Please don't mark your own patch as 'commit review'.

--
nosy: +berker.peksag
stage: commit review -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23459] Linux: expose the new execveat() syscall

2016-05-30 Thread R. David Murray

R. David Murray added the comment:

You can currently call os.execve with a file pointer.  How is that different 
from adding an execveat with AS_EMPTY_PATH, functionally?  I think we don't 
need to add this syscall, because it is intended to allow more robust 
implementation of fexecve, and we are already effectvely exposing fexecve.  We 
should be able to assume that glibc will switch to using execveat under the 
hood, and not worry about it ourselves.  If that's not true, then we can 
revisit this.

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23459] Linux: expose the new execveat() syscall

2016-05-30 Thread Марк Коренберг

Марк Коренберг added the comment:

It is actual to me due to it's AT_EMPTY_PATH feature (I download script, verify 
signature, and want to run it)

See also `man 3 fexecve`

Why not to add `dir_fd=None` ?  (as in `os.rmdir()` for example).

It should be very small patch, as I think.

Reopen please.

--
nosy: +mmarkk
type:  -> enhancement
versions: +Python 3.6 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26667] Update importlib to accept pathlib.Path objects

2016-05-30 Thread Brett Cannon

Brett Cannon added the comment:

It's informed. I need to go through the API and see what does or does not makes 
sense based on PEP 519.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-05-30 Thread aixtools

aixtools added the comment:

On 28-May-16 04:04, Martin Panter wrote:
> Martin Panter added the comment:
>
> Strictly speaking, Python 2.7 never had special support for RTLD_MEMBER or 
> find_library(). That is why I am unsure about many of these changes being 
> done in 2.7. They seem more like new features than bug fixes. Especially once 
> you start talking about a smart CDLL() that tests for a file and then falls 
> back to RTLD_MEMBER.
Well, actually, within AIX I was intending to "just use" RTLD_MEMBER 
when "the string" ended in a ")" as that is the correct additional mode 
bit for an established interface dlopen(). I perhaps do not understand 
(certainly did not) the goal of CDLL(), better Lib/ctypes

As far as Python-2.7 is concerned - I would like to see it "in" because 
there is a lot of Python-2(.7) code out there that will not work without 
manageling AIX at a low level (i.e., current practice is to extract .so 
members from archives so dlopen() will be able to open them.
>
> Whether you represent an archive member as an (archive, member) tuple, or as 
> an "archive(member)" string, or something else, it is still an extension of 
> the API of CDLL(), and arguably also of find_library().
I would want to disagree. A string is a string, regardless of the 
characters in it. And, I have verified - if a file 
/usr/lib/libFOO.a(libFoo.so.X) exists dlopen() will open it when 
RTLD_MEMBER is not ORed into the mode.
> I think I have already tried to explain that on Linux, 
> find_library("libm.so") is far from normal usage (although may be technically 
> legal if there was a library called liblibm.so.so).
find_library("libm.so") is far from normal usage: again, my 
misunderstanding - I was reading as much as possible from various 
sources - and my head was spinning.
In util.py there was no "libFOO.so", only "FOO" and "libFOO" - so my 
find_library() tests are not correct. Agreed.

>
> Also, on Linux I wouldn’t recommend CDLL("libcrypt.so"), which relies on a 
> file only intended for build time. On Debian, the glibc library 
>  has separate packages for 
> shared libraries (libc6) and development libraries (libc6-dev). It should be 
> possible to run programs with libc6 installed, but without libc6-dev. Looking 
> at the file lists for “i386” architecture, libc6-dev includes:
>
> /usr/lib/i386-linux-gnu/libcrypt.a
> /usr/lib/i386-linux-gnu/libcrypt.so
My expectation (misconception perhaps) is that Linux uses a .a archive 
for static linking, and .so shared-library for dynamic-loading. The AIX 
loader/linker looks first in .a archives for shared libraries (when 
static is not specified) and if no member is found (member name is not 
relevant for the search, only the symbol and the object size (32 or 64 
bit)). If not found in libFOO.a then a search for a specific file is 
done libFOO.so.

An assumption of mine is: if I specified (not usual on AIX, based on my 
experience) -lc.so.6 AIX would look for an archive named libc.so.6.a 
first. If found, would look for a member in that archive. If not found 
as a .a archive and/or not found as a file at all then it will look for 
a file libFOO.so.6

>
> It symbolically links to /lib/i386-linux-gnu/libcrypt.so.1, which is provided 
> by libc6:
>
> /lib/i386-linux-gnu/libcrypt-2.19.so
> /lib/i386-linux-gnu/libcrypt.so.1
>
> So on Debian (and with Linux in general), CDLL("libcrypt.so") may work in 
> some cases, but you should normally use CDLL("libcrypt.so.1") instead.
Agreed - CDLL("libFOO.so") is not preferred. But, should it be refused? 
Or, if it is accepted on Linux - and works when the (symbolic) file 
exists - must it be refused on AIX? If refusing it on AIX is what it 
takes to make the patch acceptable - then code it to refuse it is.
>
> Usually people just upload a new version of the original patch (original 
> changes, plus new changes, in one file). I think it would be too confusing 
> looking at differences between two patches.
So, just provide the new delta between "2.7.11(.0) and what I have, not 
the changes between patches. Coming up tomorrow.

In short, my head was spinning and I thought I saw problems that are not 
meant to exist, in particular find_library("libFOO.so") - that should be 
coded to reject I guess. I would still like to let something like 
"libc.so" be creative, as libc.so will never exist, by default, on AIX. 
My guess is that is a legacy thing from AIX4. (and I think the default 
name is shr.o when using the ld flag -G to create a shared object aka 
shared library)
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

___
___
Python-bugs-list mailing 

[issue18117] Missing symlink:Current after Mac OS X 3.3.2 package installation

2016-05-30 Thread R. David Murray

R. David Murray added the comment:

Ned, can this issue be closed or is there still something to discuss here?

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers

2016-05-30 Thread Torsten Landschoff

Torsten Landschoff added the comment:

For demonstration purposes, here is a small example specifically for Linux 
which shows how each request starts a new thread even though the client blocks 
for each result.

--
nosy: +torsten
Added file: http://bugs.python.org/file43061/many_threads.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12691] tokenize.untokenize is broken

2016-05-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If there are, I can't remember.  This was one or 7 or 8 untokenize issues with 
about 5 separate bugs between them.  If there are any current untokenize issues 
not covered by some other open issue, then a new issue should be opened.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12691] tokenize.untokenize is broken

2016-05-30 Thread R. David Murray

R. David Murray added the comment:

Is there anything left to do here?

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27159] Python 3.5.1's websocket's lib crashes in event that internet connection stops.

2016-05-30 Thread R. David Murray

R. David Murray added the comment:

Yes, please open only single focus issues.  

websockets is not part of the standard library, so that's not appropriate for 
this tracker ((unless you've found an underlying bug in python, in which case 
report that please).

For the bytecode questions you should ask on the python-list mailing list for 
help.  If there actually is a feature missing in python (from what you said I 
don't think there is), they could help you formulate an enhancement request to 
file here.

I believe there's an open issue about the reload question...if not, you can 
open one.

--
nosy: +r.david.murray
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Emanuel Barry

Changes by Emanuel Barry :


Added file: http://bugs.python.org/file43060/type_one_argument_3.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Emanuel Barry

Emanuel Barry added the comment:

New patch with tests and documentation. I didn't really know where to put the 
tests; test_types seemed reasonable to me (other option was test_metaclass).

--
stage: test needed -> commit review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Emanuel Barry

Changes by Emanuel Barry :


--
Removed message: http://bugs.python.org/msg266711

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Eryk Sun

Changes by Eryk Sun :


--
Removed message: http://bugs.python.org/msg266710

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Emanuel Barry

Emanuel Barry added the comment:

Let me just make sure I got you right - you're fine with `type` and only `type` 
being able to use the one-argument form in 3.6, but prefer 3.5 and 2.7 to be 
even more permissive than they currently are? Regardless, I don't think this 
should go into a bugfix release.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Eryk Sun

Eryk Sun added the comment:

> Please treat this as a new feature (just in case) and only 
> apply it to 3.6.

How about changing PyType_CheckExact to PyType_Check for 2.7 and 3.5? It solves 
the original problem by expanding the single-argument case to metaclasses that 
aren't an exact instance of `type`. I think that's unlikely to break existing 
code. It also shouldn't cause a performance problem since the PyType_Check 
macro uses the Py_TPFLAGS_TYPE_SUBCLASS flag.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27160] str.format: Silent truncation of kwargs when passing keywords containing colons

2016-05-30 Thread Kenneth Lim

Kenneth Lim added the comment:

Ah, so the truncation is fully intended behavior.

As for the name, a touch too many comic-books in the past might be the
reason I latched onto "Barry" as a first name.

Thanks for the clarification.

On Tue, May 31, 2016 at 12:37 AM, Emanuel Barry 
wrote:

>
> Emanuel Barry added the comment:
>
> The behaviour is correct, it's your assumptions that aren't :)
>
> The code for str.format only checks for what's before the colon (here,
> "HGNC") and checks if that's part of the dict provided. It isn't, so it
> raises a KeyError. It doesn't even get to the format spec part (which is a
> perfectly valid format specifier). Your dict can contain anything or be
> empty, str.format only checks for the existence of the key you asked for
> ("HGNC"). "{HGNC:11892}" is also a perfectly valid Python string.
>
> P.S.: While I'm fine with people calling me by my last name, there's
> another developer whose name is Barry Warsaw, so let's try to avoid
> confusion here ;-)
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25566] asyncio reference cycles after ConnectionResetError

2016-05-30 Thread Guido van Rossum

Guido van Rossum added the comment:

Please submit a patch to the upstream asyncio repo,
github.com/Python/asyncio.

--Guido (mobile)
On May 30, 2016 3:46 AM, "Sean Hunt"  wrote:

>
> Sean Hunt added the comment:
>
> I am 1 of those people who want to handle the error with reconnect code as
> it happens when using discord.py when the stupid connection is aborted due
> to Cloudflare being stupid and them thinking a bot made in python is a DDoS
> like litterally. So, I know of this error as well.
>
> --
> nosy: +Sean Hunt
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27160] str.format: Silent truncation of kwargs when passing keywords containing colons

2016-05-30 Thread Emanuel Barry

Emanuel Barry added the comment:

The behaviour is correct, it's your assumptions that aren't :)

The code for str.format only checks for what's before the colon (here, "HGNC") 
and checks if that's part of the dict provided. It isn't, so it raises a 
KeyError. It doesn't even get to the format spec part (which is a perfectly 
valid format specifier). Your dict can contain anything or be empty, str.format 
only checks for the existence of the key you asked for ("HGNC"). "{HGNC:11892}" 
is also a perfectly valid Python string.

P.S.: While I'm fine with people calling me by my last name, there's another 
developer whose name is Barry Warsaw, so let's try to avoid confusion here ;-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Needed tests and updating the documentation.

--
nosy: +serhiy.storchaka
stage: commit review -> test needed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Guido van Rossum

Guido van Rossum added the comment:

No, just an entry in Misc/NEWS.

--Guido (mobile)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5996] abstract class instantiable when subclassing dict

2016-05-30 Thread Xiang Zhang

Xiang Zhang added the comment:

I think subclassing builtin types and making it abstract is rare. And when 
there is a need, we can mimic this in application level (this may also apply to 
types having custom __new__):

In [2]: class CustomDict(dict, metaclass=abc.ABCMeta):
   ...: def __new__(cls, *args, **kwargs):
   ...: if getattr(cls, '__abstractmethods__', None):
   ...: raise TypeError
   ...: return super().__new__(cls, *args, **kwargs)
   ...: @abc.abstractmethod
   ...: def f(self):
   ...: pass

Adding the abstract class checking in tp_alloc or builtin types' tp_new maybe 
degrade performance.

Is it necessary to add this support?

--
nosy: +gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27160] str.format: Silent truncation of kwargs when passing keywords containing colons

2016-05-30 Thread Kenneth Lim

Kenneth Lim added the comment:

Hi Barry,

I was aware of that. However, I was alluding to the KeyError produced, and
the silent truncation of the text. Rather than failing at the colon step
(SyntaxError when on run), truncated arguments pass this step, causing
errors downstream.

On Mon, May 30, 2016 at 11:02 PM, Emanuel Barry 
wrote:

>
> Emanuel Barry added the comment:
>
> In other words, you cannot use keys containing a colon in str.format -
> you'll need to replace the colons by something else (for example an
> underscore, that works fine).
>
> --
> nosy: +ebarry
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Emanuel Barry

Emanuel Barry added the comment:

Fair enough. Should this get a note in What's new? Possibly in the "Changes in 
Python API" section.

--
stage: patch review -> commit review
versions: +Python 3.6 -Python 2.7, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Guido van Rossum

Guido van Rossum added the comment:

OK, the patch looks fine. Please treat this as a new feature (just in case) and 
only apply it to 3.6.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27137] Python implementation of `functools.partial` is not a class

2016-05-30 Thread Emanuel Barry

Emanuel Barry added the comment:

New patch after Serhiy's comments. I kept the __dict__ in pickling to properly 
pickle attributes that aren't defined by 'partial' itself; but if 'func', 
'args' or 'keywords' are present and don't match the provided arguments, an 
error will be raised, as it should not be partial's responsibility to handle 
this; this is for the caller to do.

--
Added file: http://bugs.python.org/file43059/functools_partial_2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22558] Missing doc links to source code

2016-05-30 Thread Yoni Lavi

Yoni Lavi added the comment:

Ping. Please advise on next step to get this submitted.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27160] str.format: Silent truncation of kwargs when passing keywords containing colons

2016-05-30 Thread Emanuel Barry

Emanuel Barry added the comment:

In other words, you cannot use keys containing a colon in str.format - you'll 
need to replace the colons by something else (for example an underscore, that 
works fine).

--
nosy: +ebarry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27160] str.format: Silent truncation of kwargs when passing keywords containing colons

2016-05-30 Thread Emanuel Barry

Changes by Emanuel Barry :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27160] str.format: Silent truncation of kwargs when passing keywords containing colons

2016-05-30 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Silent truncation of kwargs when passing keywords containing colons -> 
str.format: Silent truncation of kwargs when passing keywords containing colons

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27160] Silent truncation of kwargs when passing keywords containing colons

2016-05-30 Thread STINNER Victor

STINNER Victor added the comment:

IMHO the error is very explicit:

Traceback (most recent call last):
  File "poc.py", line 6, in 
print(a.format(**r))
KeyError: 'HGNC'

Your "r" directory has no "HGNC" key. I think that you misunderstood the 
formatting of str.format:
https://docs.python.org/dev/library/string.html#formatstrings

The format string "{HGNC:11892}" is parsed as key="HGNC", format="11892".

--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27160] Silent truncation of kwargs when passing keywords containing colons

2016-05-30 Thread Kenneth Lim

New submission from Kenneth Lim:

Passing a dict with colon-containing keys as kwargs to a function results in a 
KeyError stemming from a silent truncation of the keys.

Error does not clearly describe the issue in this case.

--
components: Interpreter Core
files: poc.py
messages: 266696
nosy: Kenneth Lim
priority: normal
severity: normal
status: open
title: Silent truncation of kwargs when passing keywords containing colons
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file43058/poc.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27159] Python 3.5.1's websocket's lib crashes in event that internet connection stops.

2016-05-30 Thread ppperry

ppperry added the comment:

This issue should really be split into (at least) four seperate issues.

The third problem (reloading relatively imported modules), can be done by doing 
`someclass = 
getattr(importlib.reload(sys.modules[someclass.__module__]),someclass.__name__)`.
 It also has nothing to do with relative imports, instead involving reloading 
the modules of classes imported using the `from ... import ...` statement.

--
nosy: +ppperry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27140] Opcode for creating dict with constant keys

2016-05-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Perhaps BUILD_CONST_KEY_MAP?

LGTM.

> Ideally the opcode could ellide the LOAD_CONST for the tuple. ie have 
> LOAD_CONST 2 (1, 2, 3), BUILD_CONST_KEY_MAP 3 be BUILD_CONST_KEY_MAP 2 (1, 2, 
> 3). However that'd require stack_effect to somehow lookup the const tuple

I like this idea. But PyCompile_OpcodeStackEffect() doesn't have an access to 
the consts dict.

> Relying on the peepholer seems unideal; it does more work than generating the 
> tuple the first time & doing it eagerly will produce a more compact stack 
> depth & co_consts

I thought that this would be not easy. But thanks to your encouraging I have 
tried to do this and the result is pretty simple.

In updated patch the opcode name was changed to BUILD_CONST_KEY_MAP, and the 
compiler no longer depends on the peephole optimizer for generating constant 
keys tuple. Thank you Demur.

--
Added file: http://bugs.python.org/file43057/BUILD_CONST_KEY_MAP.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Emanuel Barry

Emanuel Barry added the comment:

Yes, `metatype == _Type` makes sure that only `type` itself is valid for 
the one-argument part, whereas subclasses can also do so right now. I clarified 
that in a comment in the new patch, so that someone doesn't accidentally revert 
this, thinking PyType_CheckExact is fine.

Before the patch:

>>> type(1, 2, 3)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: type() argument 1 must be str, not int

After the patch:

>>> type(1, 2, 3)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: type.__new__() argument 1 must be str, not int
>>> class X(type): pass
...
>>> X(1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: type.__new__() argument 1 must be str, not int

--
Added file: http://bugs.python.org/file43056/type_one_argument_2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27137] Python implementation of `functools.partial` is not a class

2016-05-30 Thread ppperry

Changes by ppperry :


--
title: functools.partial: Inconsistency between Python and C implementations -> 
Python implementation of `functools.partial` is not a class

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22331] test_io.test_interrupted_write_text() hangs on the buildbot FreeBSD 7.2

2016-05-30 Thread STINNER Victor

STINNER Victor added the comment:

I also modified Python 3.6 to run each test file in a fresh process to avoid 
leaking too much things between tests, to isolate them better.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22331] test_io.test_interrupted_write_text() hangs on the buildbot FreeBSD 7.2

2016-05-30 Thread STINNER Victor

STINNER Victor added the comment:

When we talk about signals, we must always be careful of threads. Python unit 
tests are known (at least by me ;-)) to "leak" threads. IMO the first step to 
make the test more reliable is to start it in a fresh process to control 
exactly the number of threads.

A fresh process avoids also to inherit an expected signal and/or signal handler.

I modified test_eintr recently to do something similar.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23680] Sporadic freeze in test_interrupted_write_retry_text

2016-05-30 Thread Martin Panter

Martin Panter added the comment:

I found a relatively recent case of this failing on a buildbot:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.x/builds/4339/steps/test/logs/stdio
== CPython 3.6.0a1+ (default:eaee5aed6fbc, May 27 2016, 05:52:21) [GCC 4.2.1 
20070831 patched [FreeBSD]]
0:19:34 [401/401/1] test_io crashed
Timeout (0:15:00)!
Thread 0x000801807400 (most recent call first):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/test_io.py", line 
3808 in check_interrupted_write_retry
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/test_io.py", line 
3834 in test_interrupted_write_retry_text

Line 3808 is the write() call, so it could be hanging if the second signal is 
delivered just before Python makes the write() syscall. Perhaps it might help 
to use setitimer() so that even if a signal is delivered at an inconvenient 
moment, the write() call will still be interrupted by a later signal, and read 
thread will still be spawned.

Also see Issue 22331 for an idea to avoid the EBADF hack.

--
keywords: +buildbot
nosy: +martin.panter
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27140] Opcode for creating dict with constant keys

2016-05-30 Thread Demur Rumed

Demur Rumed added the comment:

Perhaps BUILD_CONST_KEY_MAP?

Ideally the opcode could ellide the LOAD_CONST for the tuple. ie have 
LOAD_CONST 2 (1, 2, 3), BUILD_CONST_KEY_MAP 3 be BUILD_CONST_KEY_MAP 2 (1, 2, 
3). However that'd require stack_effect to somehow lookup the const tuple

Thinking to in the context of MAKE_FUNCTION, I'd like to create a function for 
ceval which takes stack_pointer & returns stack_pointer at new offset with dict 
at top of stack. Then use this both for this opcode & have MAKE_FUNCTION call 
it directly (ie, don't have to emit BUILD_MAP_EX). This too makes for a need to 
do some backtracking to figure out stack effect

Relying on the peepholer seems unideal; it does more work than generating the 
tuple the first time & doing it eagerly will produce a more compact stack depth 
& co_consts

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22331] test_io.test_interrupted_write_text() hangs on the buildbot FreeBSD 7.2

2016-05-30 Thread Martin Panter

Martin Panter added the comment:

This recently hung AMD64 FreeBSD 9.x 3.5. The stack trace was different, and 
there is only one thread:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.5/builds/828/steps/test/logs/stdio
[398/398] test_io
Timeout (0:15:00)!
Thread 0x000801807400 (most recent call first):
  File 
"/usr/home/buildbot/python/3.5.koobs-freebsd9/build/Lib/unittest/case.py", line 
176 in handle
  File 
"/usr/home/buildbot/python/3.5.koobs-freebsd9/build/Lib/unittest/case.py", line 
727 in assertRaises
  File 
"/usr/home/buildbot/python/3.5.koobs-freebsd9/build/Lib/test/test_io.py", line 
3714 in check_interrupted_write
  File 
"/usr/home/buildbot/python/3.5.koobs-freebsd9/build/Lib/test/test_io.py", line 
3743 in test_interrupted_write_text

Also, x86 Ubuntu Shared 2.7 hung, but the only information I have is it was 
running test_io.

In my Free BSD case, the write() call is stuck, but in Victor’s original case, 
the background read() call is stuck. I could explain both cases as a race 
condition with the alarm signal being delivered:

Victor’s case: SIGALRM delivered somewhere inside assertRaises(), but before 
the write() system call, and Python has a chance to call the Python signal 
handler. No data is ever written, so the background read() hangs.

My case: SIGALRM delivered just before or as write() starts, so Python has no 
chance to interrupt the system call and call its own Python handler.

I wonder if we can change the test to only deliver a signal after first reading 
one byte, i.e. send the signal directly from the background thread. I think 
that should cover 99% of cases, though in theory it is possible for something 
else to interrupt write(), and our signal to be delivered while write() was 
restarting, causing it to hang. But the combination of those two events would 
be so unlikely it may not be worth worrying about.

Also, if you close the read end of the pipe before the write end, it should 
protect against flush() hanging without the EBADF hack by raising EPIPE instead.

I suggest rewriting the background thread like:

def _read():
s = os.read(r, 1)
read_results.append(s)
# The main thread is very likely to be inside the write() syscall now, so 
interrupt it
os.kill(os.getpid(), SIGALRM)

and cleaning up the pipe like:

finally:
os.close(r)
try:
wio.close()
except BrokenPipeError:
pass

--
nosy: +martin.panter
status: closed -> open
versions: +Python 2.7, Python 3.6 -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25566] asyncio reference cycles after ConnectionResetError

2016-05-30 Thread Sean Hunt

Sean Hunt added the comment:

I am 1 of those people who want to handle the error with reconnect code as it 
happens when using discord.py when the stupid connection is aborted due to 
Cloudflare being stupid and them thinking a bot made in python is a DDoS like 
litterally. So, I know of this error as well.

--
nosy: +Sean Hunt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27159] Python 3.5.1's websocket's lib crashes in event that internet connection stops.

2016-05-30 Thread Sean Hunt

New submission from Sean Hunt:

I know that websockets has a issue with when a internet connection is dropped 
and prints a bad traceback. However I have to manually recreate it when the 
exception happens which is a pain as when it does it crashes aiohttp sessions 
as well.

Also I wonder how I can bytecompile some dependencies that would normally be in 
site-packages to install manually to the embed version of python so that way I 
do not have to append to sys.path?

And 1 more thing why does importlib fail when you try to reload a relativly 
imported module. Do you guys plan to add support for it someday? I hope so as 
it sucks that I cant do such thing as ```py
from .somefile import someclass``` and be able to reload it by only knowing 
``someclass``

Also it would be nice if there was a mode in python 3.5.1 that allows you to 
generate bytecode that you can use in the embed copy of the same version. Or to 
allow the embed version to generate bytecode that you can use to add to 
``python35.zip`` eaily using WinRAR.

--
messages: 266686
nosy: Sean Hunt
priority: normal
severity: normal
status: open
title: Python 3.5.1's websocket's lib crashes in event that internet connection 
stops.

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27140] Opcode for creating dict with constant keys

2016-05-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch adds the BUILD_MAP_EX opcode (maybe somebody propose better 
name?). It takes values from the stack and keys from the tuple on the top of 
the stack. Currently it affects only creating a dict with const keys and 
calling a function with keywords after the var-keyword argument.

$ echo "{'a': 1, 'b': 2, 'c': 3}" | ./python -m dis

Unpatched:

  1   0 LOAD_CONST   0 ('a')
  2 LOAD_CONST   1 (1)
  4 LOAD_CONST   2 ('b')
  6 LOAD_CONST   3 (2)
  8 LOAD_CONST   4 ('c')
 10 LOAD_CONST   5 (3)
 12 BUILD_MAP3
 14 POP_TOP
 16 LOAD_CONST   6 (None)
 18 RETURN_VALUE

Patched:

  1   0 LOAD_CONST   0 (1)
  2 LOAD_CONST   1 (2)
  4 LOAD_CONST   2 (3)
  6 LOAD_CONST   7 (('a', 'b', 'c'))
  8 BUILD_MAP_EX 3
 10 POP_TOP
 12 LOAD_CONST   6 (None)
 14 RETURN_VALUE

$ echo "f(**kw, a=1, b=2, c=3)" | ./python -m dis

Unpatched:

  1   0 LOAD_NAME0 (f)
  2 LOAD_NAME1 (kw)
  4 LOAD_CONST   0 ('a')
  6 LOAD_CONST   1 (1)
  8 LOAD_CONST   2 ('b')
 10 LOAD_CONST   3 (2)
 12 LOAD_CONST   4 ('c')
 14 LOAD_CONST   5 (3)
 16 BUILD_MAP3
 18 EXTENDED_ARG 1
 20 BUILD_MAP_UNPACK_WITH_CALL   258
 22 CALL_FUNCTION_KW 0 (0 positional, 0 keyword pair)
 24 POP_TOP
 26 LOAD_CONST   6 (None)
 28 RETURN_VALUE

Patched:

  1   0 LOAD_NAME0 (f)
  2 LOAD_NAME1 (kw)
  4 LOAD_CONST   0 (1)
  6 LOAD_CONST   1 (2)
  8 LOAD_CONST   2 (3)
 10 LOAD_CONST   7 (('a', 'b', 'c'))
 12 BUILD_MAP_EX 3
 14 EXTENDED_ARG 1
 16 BUILD_MAP_UNPACK_WITH_CALL   258
 18 CALL_FUNCTION_KW 0 (0 positional, 0 keyword pair)
 20 POP_TOP
 22 LOAD_CONST   6 (None)
 24 RETURN_VALUE

It could be more useful for new MAKE_FUNCTION opcode (issue27095) and maybe for 
new CALL_FUNCTION* opcodes.

The benefit of BUILD_MAP_EX is less LOAD_CONST instructions and less stack 
consuming.

--
keywords: +patch
nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, yselivanov
stage: needs patch -> patch review
Added file: http://bugs.python.org/file43055/BUILD_MAP_EX.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-30 Thread Eryk Sun

Eryk Sun added the comment:

> why write `metatype == _Type` rather than 
> PyType_CheckExact(metatype)`?

If only `type` should implement this special case, then it needs to be 
`metatype == _Type`. This was actually how it was implemented in 2.2a3:

https://hg.python.org/cpython/file/v2.2a3/Objects/typeobject.c#l631

I don't know why the final release of 2.2 switched to using PyType_CheckExact, 
which is true for most metaclasses. That's why I feel like I'm missing 
something here.

Probably it used PyType_CheckExact instead of PyType_Check to ensure 
PyType_IsSubtype wouldn't be called. Nowadays that's optimized away via 
PyType_FastSubclass and the Py_TPFLAGS_TYPE_SUBCLASS flag (set up in 
inherit_special). If it's decided to retain this special case for metaclasses 
other than `type`, then I think it should use PyType_Check to consistently 
implement it for all metaclasses. Also, the error message should be more 
generic, e.g. maybe "__new__() takes 1 or 3 arguments".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10908] Improvements to trace._Ignore

2016-05-30 Thread SilentGhost

SilentGhost added the comment:

I closed the issue because it's outdated: i) patch no longer applies cleanly; 
ii) changes to cmd line parsing where done in issue 22642; iii) remaining 
changes are largely cosmetic.

As for issue 10896, a much more trivial patch would have to be produced against 
the current tip.  And someone would have to test it on Windows.  But that's 
only if any of the committers are interested in committing it within the next 
few years.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27152] Additional assert methods for unittest

2016-05-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Changes in tests are provided as a demonstration that these methods are useful. 
I propose to commit only the unittest part, and use new methods on a 
case-by-case basis. For example some tests already define methods like 
assertHasAttr or assertIsSubclass, They can now use standard methods.

assertEndsWith() can be used 73 times in 36 files. It produces more useful 
error report than assertTrue(a.endswith(b)).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27125] Typo in Python 2 multiprocessing documentation

2016-05-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm impressed by the number of duplicates left after all past cleanups.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24671] idlelib 2.7: finish converting print statements

2016-05-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I no longer plan to backport enough patches to make further fixes worthwhile in 
the absence of otherwise working on a file.  In the absence of adequate tests, 
there is also the non-0 chance of introducing bugs.

--
assignee:  -> terry.reedy
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27113] sqlite3 connect parameter "check_same_thread" not documented

2016-05-30 Thread Dave Sawyer

Dave Sawyer added the comment:

The revised patch says "connections" plural for true and "connection" singular 
for false. How about "the connection" since the method returns a connection. 
I'm wondering though about the lack of explanation or WHY for this parameter. 
As written it seems like the default value was poorly chosen and everyone 
should just set it to true. Likewise, if everyone should set it to true, why is 
it even provided as an option?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27156] IDLE: remove unused code

2016-05-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0945b9729734 by Terry Jan Reedy in branch 'default':
Issue #27156: Remove obsolete code not used by IDLE.
https://hg.python.org/cpython/rev/0945b9729734

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com