[issue28865] [MinGW32-x64]-PyList_Check PyDict_Check does not work

2016-12-05 Thread Mikhail

Mikhail added the comment:

SOLVED:

I found a solution. It turned out that on the Windows x64 need to use 
'-DMS_WIN64' compiler option.

Three days wasted.

And although no one helped me, I felt that mentally you were with me, guys. 
Thank you! ;)

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

___
Python tracker 

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



[issue13886] readline-related test_builtin failure

2016-12-05 Thread Martin Panter

Martin Panter added the comment:

Since people keep coming upon this bug, perhaps we should inhibit push my fix 
without fixing that other prompt bug (now a feature change I think). Probably 
have to capture stderr to avoid it coming out in the test output.

--
versions: +Python 3.7

___
Python tracker 

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



[issue28875] test fails and freezes

2016-12-05 Thread Whitequill Riclo

Changes by Whitequill Riclo :


--
hgrepos:  -365

___
Python tracker 

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



[issue28875] test fails and freezes

2016-12-05 Thread Whitequill Riclo

Changes by Whitequill Riclo :


--
status: closed -> open

___
Python tracker 

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



[issue28875] test fails and freezes

2016-12-05 Thread Whitequill Riclo

Changes by Whitequill Riclo :


--
hgrepos: +366

___
Python tracker 

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



[issue27870] Left shift of zero allocates memory

2016-12-05 Thread Mark Dickinson

Mark Dickinson added the comment:

Gah. Sorry about that. Thanks for the refleak fix, Benjamin.

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-12-05 Thread Xiang Zhang

Xiang Zhang added the comment:

> However, consistency is a good thing, so allowing it seems reasonable.

The inconsistency also appears when "__classcell__" in slots with or without 
super().

v4 catches up with HEAD.

--
Added file: http://bugs.python.org/file45762/slots_special-v4.patch

___
Python tracker 

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



[issue28876] bool of large range raises OverflowError

2016-12-05 Thread Mark Dickinson

New submission from Mark Dickinson:

The bool of a large range raises OverflowError:

>>> bool(range(2**63))
Traceback (most recent call last):
  File "", line 1, in 
OverflowError: Python int too large to convert to C ssize_t

This is a side-effect of len raising OverflowError, which is a general problem 
that's nontrivial to fix (the sq_length slot is constrained to return a 
ssize_t). In theory, though, it would be possible to implement nb_bool for 
range objects to do the right thing.

In practice, this may well not be worth fixing, though I think it's at least 
worth reporting.

--
components: Interpreter Core
messages: 282402
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: bool of large range raises OverflowError
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue22107] tempfile module misinterprets access denied error on Windows

2016-12-05 Thread Paul Doom

Paul Doom added the comment:

Can the _mkstemp_inner portion of Billy McCulloch's patch be applied? Due to a 
large default os.TMP_MAX value (2147483647 - seems to be the current value on 
Win 7/8.1/10 I have access to), the following will push  the CPU to 100% for a 
very long time when run under a non-elevated shell:

--
import tempfile
tempfile.TemporaryFile(dir='C:\Windows')
... wait ...
--

In _mkstemp_inner() we should be testing for the filename, not parent directory 
here:

except PermissionError:
# This exception is thrown when a directory with the chosen name
# already exists on windows.
if (_os.name == 'nt' and _os.path.isdir(dir) and
_os.access(dir, _os.W_OK)):
continue

Changing the _os.path.isdir(dir) call to _os.path.isdir(filename) is all that 
is needed to prevent the death loop and function correctly in cases where 
Windows os.access(dir, _os.W_OK) claims we have write access when we do not.

--
nosy: +Paul Doom
type: behavior -> resource usage

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2016-12-05 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

I wrote a patch based on msg281227's idea.  I confirmed to pass related tests 
(test_capi, test_threading and test_tracemalloc) on Cygwin x86 and Ubuntu 16.04 
x86.

This patch adds to change CPython about:

1. Avoid compile error on Currently TLS API.
   With POSIX threads, configure script checks pthread_key_t type. And if the 
type is not integer, TLS API is implemented empty (do nothing or return fail).
2. Implement New TSS API based on C11 threads.
   Thread key type is changed wrapped native TLS key type by typedef instead of 
integer, and the key parameter on key create function is changed to calling by 
pointer.  Key create function doesn't support destructor because users have 
need to manage memory.  And this patch changes Currently TLS API to call New 
TSS API. Or does it need to keep implementation?
3. Move to TSS API.
   Py_DEPRECATED(3.7) is added to TLS API declaration, and 
Modules/_tracemalloc.c and Python/pystate.c are modified to use TSS API instead 
of TLS API.

--
Added file: http://bugs.python.org/file45763/pythread-tss.patch

___
Python tracker 

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



[issue28876] bool of large range raises OverflowError

2016-12-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

+1 for implementing nb_bool for range objects.

--
nosy: +rhettinger

___
Python tracker 

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



[issue28427] WeakValueDictionary next bug (with multithreading)

2016-12-05 Thread Armin Rigo

Armin Rigo added the comment:

issue28427-atomic.patch: is it still necessary to modify weakref.py so much, 
then?

What I had in mind was a C function with Python signature "del_if_equal(dict, 
key, value)"; the C function doesn't need to know about weakrefs and checking 
if they are dead.  The C function would simply call PyObject_GetItem() and 
PyObject_DelItem()---without releasing the GIL in the middle.

--

___
Python tracker 

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



[issue28864] Add devnull file-like object

2016-12-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I had in mind a pre-opened file like sys.stderr or sys.stdout.

--

___
Python tracker 

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



[issue28877] Cannot compile _ssl.o on HP-UX

2016-12-05 Thread James Matthews

New submission from James Matthews:

Cannot build Python 2.7.12 on HP-UX due to the following error:

/opt/hp-gcc64-4.7.1/bin/gcc -pthread -shared 
build/temp.hp-ux-B.11.31-9000-800-2.7/root/build/Python-2.7.12/Modules/_ssl.o 
-L/usr/local/lib -lssl -lcrypto -o build/lib.hp-ux-B.11.31-9000-800-2.7/_ssl.sl
/usr/lib/pa20_64/dld.sl: Unsatisfied code symbol 'CRYPTO_THREADID_set_callback' 
in load module 'build/lib.hp-ux-B.11.31-9000-800-2.7/_ssl.sl'.
/bin/sh: 23510 Killed
gmake: *** [sharedmods] Error 137

--
components: Build
messages: 282406
nosy: James Matthews
priority: normal
severity: normal
status: open
title: Cannot compile _ssl.o on HP-UX
versions: Python 2.7

___
Python tracker 

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



[issue28427] WeakValueDictionary next bug (with multithreading)

2016-12-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Hi Armin,

> is it still necessary to modify weakref.py so much, then?

Not sure. I'll take a look again. Modifying __len__() at least is necessary, as 
the previous version took into account the length of _pending_removals (and 
could therefore return wrong results). I'm inclined to be a bit defensive here.

> The C function would simply call PyObject_GetItem() and 
> PyObject_DelItem()---without releasing the GIL in the middle.

If you implement it like that, and the dictionary has non-trivial keys with a 
user-defined __hash__, then the GIL can be released at the beginning of 
PyObject_DelItem().

--

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2016-12-05 Thread Erik Bray

Erik Bray added the comment:

I'm still pretty happy with the previous patch, personally, since I don't need 
the tracemalloc module.  But it seems like that should be fixed (or if nothing 
else that code in _tracemalloc.c should check Py_HAVE_NATIVE_TLS too).

I like the idea of the new PyThread_tss_ API.  At first I wasn't sure because I 
thought you implied that it would use tss_t and related APIs from C11 which was 
going to be a non-starter (as CPython has only just barely started using *some* 
features from C99, per the recent update to PEP 7).  But I see in your patch 
that the naming is only inspired by C11 (and could be consistent with it if 
CPython ever moves toward C11 support).

I imagine this will likely require a PEP though?  I would happy to help draft 
one.

--

___
Python tracker 

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



[issue25591] refactor imaplib tests

2016-12-05 Thread Maciej Szulik

Maciej Szulik added the comment:

Thank you David, of course I'll remind you :)

--

___
Python tracker 

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



[issue28876] bool of large range raises OverflowError

2016-12-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
stage:  -> needs patch

___
Python tracker 

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



[issue28638] Creating namedtuple is too slow to be used in common stdlib (e.g. functools)

2016-12-05 Thread INADA Naoki

INADA Naoki added the comment:

I think external cache system introduces more complexity and startup overhead 
than AC.

I think functools is the only "very common" module using namedtuple, because
`functools.wraps()` is used to create decorator functions.

But if general solution for all namedtuple is necessary to make agreement,
I think C implemented namedtuple may be better.
structseq is faster than namedtuple, not only when building type, but also
using instance.


$ ./python -m perf timeit -s 'import sys; vi = sys.version_info' -- 'vi.major, 
vi.minor, vi.micro'
.
Median +- std dev: 130 ns +- 2 ns

$ ./python -m perf timeit -s 'from collections import namedtuple; 
VersionInfo=namedtuple("VersionInfo", "major minor micro releaselevel serial"); 
vi=VersionInfo(3, 7, 0, "alpha", 0)' -- 'vi.major, vi.minor, vi.micro'
.
Median +- std dev: 212 ns +- 4 ns

--

___
Python tracker 

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



[issue28707] add 'directory' option to the http.server module

2016-12-05 Thread Julien Palard

Changes by Julien Palard :


Added file: http://bugs.python.org/file45764/issue28707.diff

___
Python tracker 

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



[issue28873] test_unittest failures when refleak hunting

2016-12-05 Thread Berker Peksag

Changes by Berker Peksag :


--
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



[issue28875] test fails and freezes

2016-12-05 Thread Berker Peksag

Berker Peksag added the comment:

Please do not reopen this one. You already opened issue 28874.

--
nosy: +berker.peksag
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



[issue28876] bool of large range raises OverflowError

2016-12-05 Thread Akira Li

Akira Li added the comment:

Here's a patch with range_bool() implementation, tests and the docs update.

I'm not sure how it should be documented. I've specified it as 
versionchanged:: 3.6

--
keywords: +patch
nosy: +akira
Added file: http://bugs.python.org/file45765/range_bool.patch

___
Python tracker 

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



[issue28724] Add method send_io, recv_io to the socket module.

2016-12-05 Thread Christian Heimes

Christian Heimes added the comment:

Good idea! Initially I planned to add the functions and some other helpers 
around AF_UNIX to Python 3.6. You can directly copy the example functions from 
the documentation.

https://docs.python.org/3/library/socket.html#socket.socket.sendmsg
https://docs.python.org/3/library/socket.html#socket.socket.recvmsg

Please keep the names send_fds() and recv_fds(), and pass the message like in 
the examples. Some protocols use the payload to signal the count of fds. Your 
patch is also lacking unit tests and documentation update.

--
nosy: +christian.heimes
stage:  -> needs patch

___
Python tracker 

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



[issue28878] datetime should not be a subclass of date

2016-12-05 Thread sergem

New submission from sergem:

I have Python 3.5.2.

datetime is implemented as a subclass of date
(isinstance(datetime.datetime(2015,1,1), datetime.date) == True)

I suppose that violates Liskov substitution principle:

1. datetime and date cannot be compared via "<".
2. both of these classes have "isoformat()" method. And the meaning of these 
methods differ.

It means one cannot pass datetime to the function that expects date.

Also one cannot say that datetime "is a" date. 

I suppose datetime must not be a subclass of date.

--
messages: 282416
nosy: sergem
priority: normal
severity: normal
status: open
title: datetime should not be a subclass of date
versions: Python 3.5

___
Python tracker 

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



[issue28878] datetime should not be a subclass of date

2016-12-05 Thread R. David Murray

R. David Murray added the comment:

Right or wrong, this was a concious design choice.  If you wish to argue that 
it should be changed, you need to address it on the python-ideas mailing list 
(but look for previous threads about it there and on python-dev first).

--
nosy: +r.david.murray
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



[issue28876] bool of large range raises OverflowError

2016-12-05 Thread Mark Dickinson

Mark Dickinson added the comment:

> I'm not sure how it should be documented.

I think a change at this level probably isn't worth documenting in the official 
docs; it's enough that there's a Misc/NEWS entry for it.

--

___
Python tracker 

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



[issue28878] datetime should not be a subclass of date

2016-12-05 Thread sergem

sergem added the comment:

Would you be so kind to point to me to the discussion/arguments for that 
choice? 

Also 
http://www.gossamer-threads.com/lists/python/python/1114426

--
resolution: not a bug -> 

___
Python tracker 

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



[issue28866] Unexpected behavior resulting from mro() and __setattr__ in interactive mode

2016-12-05 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue28845] Clean up known issues for AIX

2016-12-05 Thread Eric N. Vander Weele

Eric N. Vander Weele added the comment:

I have been able to test the example without a segmentation fault.

$ python3.5
Python 3.5.2 (default, Nov 17 2016, 10:45:58) [C] on aix7
Type "help", "copyright", "credits" or "license" for more information.
>>> import curses
>>> from curses import panel
>>> def mkpanel(scr):
... win = curses.newwin(8,8,1,1)
... pan = panel.new_panel(win)
...
>>> curses.wrapper(mkpanel)
>>>

--

___
Python tracker 

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



[issue28878] datetime should not be a subclass of date

2016-12-05 Thread R. David Murray

R. David Murray added the comment:

Hmm.  I thought there was a PEP, but maybe datetime was from before PEPs 
because I did find a PEP when I searched.  I don't have specific pointers to 
discussion, that's why I suggested you search first.  I'm pretty sure I 
remember a discussion of this some time in the past five years, but I have no 
idea which list it took place on.  If you don't find any relevant thread, start 
one.  I'm going to nosy Tim Peters and Andrew Belopolsky; they may be able to 
save you some time by speaking directly to the issue.

However, changing this is probably ruled out by backward compatibility 
concerns, regardless of anyone's (modern) opinion on the design.

--
nosy: +belopolsky, tim.peters

___
Python tracker 

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



[issue28864] Add devnull file-like object

2016-12-05 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Didn't pre-opened (or lazily opened) file descriptors cause headaches with 
os.urandom? I'm not sure I'd want my programming environment eating file 
descriptors "just in case", even if it might make certain tasks trivially 
faster after startup.

--
nosy: +josh.r

___
Python tracker 

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



[issue28864] Add devnull file-like object

2016-12-05 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue28864] Add devnull file-like object

2016-12-05 Thread Christian Heimes

Christian Heimes added the comment:

It can be done with some extra effort. We have to get the st_dev and st_inode 
from os.fstat(fd), cache them together with the fd, and verify them every time 
we create a new DevNull object. That way we catch both closed fd and modified 
fd. We might have to add a lock around the check, too.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue28864] Add devnull file-like object

2016-12-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Which begs the question: what's the point? As David said, `open(os.devnull)` is 
a reasonably obvious way to do it. Is there a use case that it doesn't satisfy?

--

___
Python tracker 

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



[issue28879] smtplib RFC 5322 date header missing

2016-12-05 Thread Henning von Bargen

New submission from Henning von Bargen:

I'm using CPython 2.7 with the smtplib and email modules to send emails with 
SMTP.
Today, one of our clients complained that the email sent is not RFC 5322 
compliant because the required Date header is missing. The RFC states in 
section 3.6.:

"The only required header fields are the origination date field and
 the originator address field(s).  All other header fields are
  syntactically optional."

Our program has been sending millions of email message this way and this is the 
first complaint.

I guess that the library doesn't add the header field automatically.

--
components: Library (Lib)
messages: 282425
nosy: Henning.von.Bargen
priority: normal
severity: normal
status: open
title: smtplib RFC 5322 date header missing
versions: Python 2.7

___
Python tracker 

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



[issue28858] Fastcall uses more C stack

2016-12-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4171cc26272c by Victor Stinner in branch 'default':
Issue #28858: Remove _PyObject_CallArg1() macro
https://hg.python.org/cpython/rev/4171cc26272c

--

___
Python tracker 

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



[issue15812] inspect.getframeinfo() cannot show first line

2016-12-05 Thread Peter Waller

Peter Waller added the comment:

I have just hit this bug and independently invented the exact fix of changing 
the zero for a one. Any chance of getting this merged?

--
nosy: +Peter.Waller

___
Python tracker 

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



[issue28427] WeakValueDictionary next bug (with multithreading)

2016-12-05 Thread Armin Rigo

Armin Rigo added the comment:

I think the issue of __len__() is a different matter.  More below.

>> The C function would simply call PyObject_GetItem() and
>> PyObject_DelItem()---without releasing the GIL in the middle.
>
> If you implement it like that, and the dictionary has non-trivial
> keys with a user-defined __hash__, then the GIL can be released
> at the beginning of PyObject_DelItem().

Right, I see your point: your version will, in any case, remove only a dead 
weakref as a dictionary value.  +1

Now about __len__() returning a wrong result: it is a more complicated issue, I 
fear.  I already patched weakref.py inside PyPy in order to pass a unit test 
inside CPython's test suite.  This patch is to change __len__ to look like this:

def __len__(self):
# PyPy change: we can't rely on len(self.data) at all, because
# the weakref callbacks may be called at an unknown later time.
result = 0
for wr in self.data.values():
result += (wr() is not None)
return result

The problem is the delay between the death of a weakref and the actual 
invocation of the callback, which is systematic on PyPy but can be observed on 
CPython in some cases too.  It means that code like this may fail:

 if list(d) == []:
 assert len(d) == 0

because list(d) might indeed be empty, but some callbacks have not been called 
so far and so any simple formula in __len__() will fail to account for that.  
('issue28427-atomic.patch' does not help for that, but I might have missed a 
different case where it does help.)

--

___
Python tracker 

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



[issue28879] smtplib RFC 5322 date header missing

2016-12-05 Thread R. David Murray

R. David Murray added the comment:

That is correct.  Most SMTP gateways add the header on submission if it is 
missing.  At least a few other MUA programs do not automatically add the Date 
header, they let the SMTP server do it.  I have one person who sends me email 
that saw this same problem (I had my server set to reject messages without the 
date header), and they weren't using smtplib to send.  (I think the sender used 
Exchange, though I don't remember for sure.)

--
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



[issue28866] Unexpected behavior resulting from mro() and __setattr__ in interactive mode

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

If you call sys._clear_type_cache() after the setattr(), 
weird_without_interactive.py doesn't crash anymore.

--

___
Python tracker 

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



[issue28852] sorted(range(1000)) is slower in Python 3.7 than in 3.5

2016-12-05 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue28838] Uniformize argument names of "call" functions (C API)

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

So, what do you think of renaming argument like:

* Replace "callable_object" and "func" with "callable"
* Replace "method" with "name"
* Rename "o" to "obj" (ex: in "PyCallable_Check(PyObject *o)")

I prefer "callable_object" over "callable" because it's shorter. Some functions 
already use "callable" (and so others use "callable_object").


Eric: ""Isn't this just a lot of churn for not a lot of benefit? I'm all for 
consistency, but you'll break patches on the bug tracker and externally 
maintained patches."

I'm not aware of any pending patch on "call" functions like PyObject_Call. I 
think that I am the latest who modified these functions. I'm working on a new 
patch serie to add support for fast calls in tp_call. That's why I would prefer 
to uniformize argument names first, before rebasing my large patch.

--

___
Python tracker 

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



[issue28427] WeakValueDictionary next bug (with multithreading)

2016-12-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Now about __len__() returning a wrong result: it is a more complicated issue, 
> I fear.  I already patched weakref.py inside PyPy in order to pass a unit 
> test inside CPython's test suite.  This patch is to change __len__ to look 
> like this: [...]

Thanks for the explanation. Yes, you are right on the principle. But there is 
also a general expectation that len() on an in-memory container is a O(1) 
operation, not O(n) - this change would break that expectation quite heavily.

I don't know how to fix len() without losing O(1) performance. It seems we're 
in a bit of a quandary on this topic. However, we can still fix the other 
issues.

--

___
Python tracker 

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



[issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

sre-concrete-2.patch LGTM, so do you want to push it Serhiy?

--

___
Python tracker 

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



[issue28427] WeakValueDictionary next bug (with multithreading)

2016-12-05 Thread Armin Rigo

Armin Rigo added the comment:

Agreed about fixing the other issues.  I'm still unclear that we need anything 
more than just the _remove_dead_weakref function to do that, but also, I don't 
see a particular problem with adding self._commit_removals() a bit everywhere.

About the O(1) expectation for len(): it's still unclear if it is better to 
give a precise answer or if an over-estimate is usually enough.  I can see of 
no reasonable use for a precise answer---e.g. code like this

while len(d) > 0:
do_stuff(d.popitem())

is broken anyway, because a weakref might really die between len(d) and 
d.popitem().  But on the other hand it makes tests behave strangely.  Maybe the 
correct answer is that such tests are wrong---then I'd be happy to revert the 
PyPy-specific change to __len__() and fix the test instead.  Or maybe weakdicts 
should always raise in __len__(), and instead have a method 
.length_upper_bound().

--

___
Python tracker 

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



[issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex

2016-12-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
superseder:  -> _sre.compile(): be more strict on types of indexgroup and 
groupindex

___
Python tracker 

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



[issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex

2016-12-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
superseder: _sre.compile(): be more strict on types of indexgroup and 
groupindex -> 

___
Python tracker 

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



[issue28152] Clang warnings: code will never be executed

2016-12-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b3f1210d098d by Victor Stinner in branch 'default':
Issue #28152: Fix -Wunreachable-code warnings on Clang
https://hg.python.org/cpython/rev/b3f1210d098d

New changeset 390fbb9c5e59 by Victor Stinner in branch 'default':
Issue #28152: Fix -Wunreachable-code warning on clang
https://hg.python.org/cpython/rev/390fbb9c5e59

--
nosy: +python-dev

___
Python tracker 

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



[issue28152] Clang warnings: code will never be executed

2016-12-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7c7055305f69 by Victor Stinner in branch 'default':
Issue #28152: Fix -Wunreachable-code warning on clang
https://hg.python.org/cpython/rev/7c7055305f69

--

___
Python tracker 

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



[issue28152] Clang warnings: code will never be executed

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

My commits fixed all warnings using clang 3.8.0 on Fedora 25.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue28050] test_traceback is broken by new CALL_FUNCTION* opcodes

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

Oh, this issue was already fixed, thanks Serhiy :-)

changeset:   103659:51b635e81958
user:Serhiy Storchaka 
date:Mon Sep 12 00:52:40 2016 +0300
files:   Include/abstract.h Lib/dis.py Lib/test/test_extcall.py 
Lib/test/test_traceback.py Objects/abstract.c Objects/methodobject.c 
Python/ceval.c Python/compile.c Python/importlib.h Python/imp
description:
Issue #27213: Fixed different issues with reworked CALL_FUNCTION* opcodes.

* BUILD_TUPLE_UNPACK and BUILD_MAP_UNPACK_WITH_CALL no longer generated with
  single tuple or dict.
* Restored more informative error messages for incorrect var-positional and
  var-keyword arguments.
* Removed code duplications in _PyEval_EvalCodeWithName().
* Removed redundant runtime checks and parameters in _PyStack_AsDict().
* Added a workaround and enabled previously disabled test in test_traceback.
* Removed dead code from the dis module.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue28152] Clang warnings: code will never be executed

2016-12-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Victor.

--

___
Python tracker 

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



[issue28050] test_traceback is broken by new CALL_FUNCTION* opcodes

2016-12-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It is rather worked around.

--

___
Python tracker 

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



[issue28050] test_traceback is broken by new CALL_FUNCTION* opcodes

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka added the comment:
> It is rather worked around.

The test pass, the change looks good to me. I don't think that it's
still worth it to keep the issue open ;-)

--

___
Python tracker 

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



[issue27829] test.regrtest: changed environment variables are not logged

2016-12-05 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue27864] test_socket: unknown thread blocks forever on "AMD64 FreeBSD 9.x 3.x"

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

Sadly, such bug is hard to reproduce. I didn't look at buildbots recently, and 
I don't have access to FreeBSD 9, so I just close the issue :-/

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue27791] test_threading: test_threads_join_2() failed with "Fatal Python error: Py_EndInterpreter: not the last thread"

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

Sadly, such bug is hard to reproduce. I didn't look at buildbots recently, and 
I don't have access to FreeBSD, so I just close the issue :-/

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue27367] Windows buildbot: random timeout failure on test_threading

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

Such bug is random. It's hard to reproduce. I don't have access to Windows 
right now, so I just close the issue.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue27784] Random failure of test_TCPServer() of test.test_socketserver.SocketServerTest and test_handle_accept() of test.test_asyncore.TestAPI_UseIPv6Select on FreeBSD buildbots

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

I didn't look at buildbots recently, and I don't have access to FreeBSD, so I 
just close the issue :-/

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue26769] Python 2.7: make private file descriptors non inheritable

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

Sorry, I loose interest on this backport. The patch is large, the risk of 
regression is high, the goal is non-obvious. I'm not sure that such bugfix is 
still useful since Python 2.7 is old and developers know how to workaround 
Python 2.7 limitations.

The problem of non-inheritable file descriptors is that it requires to modify a 
lot of code, not only a few functions.

For all these reasons, I prefer to close the issue as WONTFIX.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue28858] Fastcall uses more C stack

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

The changeset 4171cc26272c "Remove _PyObject_CallArg1() macro" fixed the 
initial bug report, so I now close the issue.

Serhiy: If you see further enhancements, please open a new issue. Your second 
stack_overflow.py script is interesting, but I don't see any obvious possible 
changes to enhance results.

Thanks Serhiy for digging into this issue ;-)

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26566] Failures on FreeBSD CURRENT buildbot

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

This random failure is just too old, I close the issue.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue28880] range(i, j) doesn't work

2016-12-05 Thread John Henning

New submission from John Henning:

When attempting to use range(I, j) command in Windows 10 command prompt, the 
latest version of Python would simply echo what was typed.  See below:

>>> range(7)
range(0, 7)
>>> range(0, 9)
range(0, 9)
>>> range(1, 10, 3)
range(1, 10, 3)
>>>

--
components: Regular Expressions
messages: 282449
nosy: ezio.melotti, genetics_jo, mrabarnett
priority: normal
severity: normal
status: open
title: range(i, j) doesn't work
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue28880] range(i, j) doesn't work

2016-12-05 Thread Matthew Barnett

Matthew Barnett added the comment:

Not a bug.

Python 2 had 'range', which returned a list, and 'xrange', which returned an 
xrange object which was iterable:

>>> range(7)
[0, 1, 2, 3, 4, 5, 6]
>>> xrange(7)
xrange(7)
>>> list(xrange(7))
[0, 1, 2, 3, 4, 5, 6]

In Python 3, 'range' was dropped and 'xrange' was renamed to 'range':

>>> range(7)
range(0, 7)
>>> list(range(7))
[0, 1, 2, 3, 4, 5, 6]

BTW, that's not the Windows command prompt, that's the Python prompt.

--
components: +Interpreter Core -Regular Expressions

___
Python tracker 

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



[issue28880] range(i, j) doesn't work

2016-12-05 Thread John Henning

John Henning added the comment:

Right about the command prompt!  My bad.  However, the new language you 
provided gives me the following:

>>> list(range(9))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'list' object is not callable
>>> list(range(0, 10))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'list' object is not callable
>>> list(range(0, 10, 2))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'list' object is not callable
>>>

--

___
Python tracker 

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



[issue28880] range(i, j) doesn't work

2016-12-05 Thread R. David Murray

R. David Murray added the comment:

Presumably you use 'list' as a variable name earlier in your interactive 
session.  Try restarting your python shell.

--
nosy: +r.david.murray
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



[issue28880] range(i, j) doesn't work

2016-12-05 Thread John Henning

John Henning added the comment:

Ha!  Thanks!  Restarted python and now that works.  Sorry for the trouble!  
Trying to teach myself python working through the python tutorial and hit this 
problem.

--

___
Python tracker 

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



[issue28881] int no attribute 'lower'

2016-12-05 Thread Vitold S

New submission from Vitold S:

I have MIME message and parse content. Later I walk on message headers by call 
for and receive follow traceback:

Traceback (most recent call last):
...
for m in msg:  (msg is email.message.Message instance)
  File "C:\Python27\lib\email\message.py", line 294, in __getitem__
return self.get(name)
  File "C:\Python27\lib\email\message.py", line 360, in get
name = name.lower()
AttributeError: 'int' object has no attribute 'lower'

But with items() all work properly.

--
components: email
messages: 282454
nosy: Vitold S, barry, r.david.murray
priority: normal
severity: normal
status: open
title: int no attribute 'lower'
versions: Python 2.7

___
Python tracker 

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



[issue28881] int no attribute 'lower'

2016-12-05 Thread R. David Murray

R. David Murray added the comment:

Oh, I think I misread your traceback.

Can you provide the actual code you are running, please?  And probably the 
message you are parsing, as well.

--

___
Python tracker 

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



[issue28881] int no attribute 'lower'

2016-12-05 Thread R. David Murray

R. David Murray added the comment:

It looks like your 'name' variable holds an integer, not a string giving a 
header name.

--

___
Python tracker 

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



[issue28873] test_unittest failures when refleak hunting

2016-12-05 Thread Ned Deily

Changes by Ned Deily :


--
assignee: ned.deily -> 

___
Python tracker 

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-05 Thread Ned Deily

Changes by Ned Deily :


--
assignee: ned.deily -> 
priority: release blocker -> 

___
Python tracker 

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



[issue28872] test_builtin failures when refleak hunting

2016-12-05 Thread Ned Deily

Changes by Ned Deily :


--
assignee: ned.deily -> 
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



[issue28797] Modifying class __dict__ inside __set_name__

2016-12-05 Thread Ned Deily

Changes by Ned Deily :


--
priority: release blocker -> 

___
Python tracker 

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



[issue28808] Make PyUnicode_CompareWithASCIIString() never failing

2016-12-05 Thread Ned Deily

Ned Deily added the comment:

This is currently blocking 360rc1.  Victor, Serhiy, we either need to get this 
in now or wait until 3.6.1.  I am leaning towards pushing the latest patch for 
3.6 without having a decision about 3.5 yet.

--

___
Python tracker 

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



[issue28835] Change in behavior when overriding warnings.showwarning and with catch_warnings(record=True)

2016-12-05 Thread Ned Deily

Ned Deily added the comment:

What's the status of this issue?  It's currently blocking 360rc1.  We either 
need a resolution now or defer it to 3.6.1.

--

___
Python tracker 

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



[issue28089] Document TCP_NODELAY by default

2016-12-05 Thread Ned Deily

New submission from Ned Deily:

This is marked as a release blocker but, since it's just a doc change, I'm not 
going to hold 3.6.0 for it.  It would be nice to get it in, though.

--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue28091] Document PEP 525

2016-12-05 Thread Ned Deily

New submission from Ned Deily:

Yuri, are you planning to do more for this for 3.6.0?  This is marked as a 
release blocker but, since it's just a doc change, I'm not going to hold 3.6.0 
for it.

--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue28091] Document PEP 525

2016-12-05 Thread Ned Deily

Ned Deily added the comment:

Yury, are you planning to do more for this for 3.6.0?  This is marked as a 
release blocker but, since it's just a doc change, I'm not going to hold 3.6.0 
for it.

--

___
Python tracker 

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



[issue28091] Document PEP 525

2016-12-05 Thread Ned Deily

Changes by Ned Deily :


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

___
Python tracker 

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



[issue28090] Document PEP 530

2016-12-05 Thread Ned Deily

New submission from Ned Deily:

Yury, are you planning to do more for this for 3.6.0?  This is marked as a 
release blocker but, since it's just a doc change, I'm not going to hold 3.6.0 
for it.

--
priority: release blocker -> deferred blocker
versions: +Python 3.7

___
Python tracker 

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



[issue28091] Document PEP 525

2016-12-05 Thread Ned Deily

Changes by Ned Deily :


--
versions: +Python 3.7

___
Python tracker 

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



[issue28518] execute("begin immediate") throwing OperationalError

2016-12-05 Thread Ned Deily

Ned Deily added the comment:

Thanks everyone for investigating this, in particular Big Stone for the 
reference to the SQLite project and especially Richard Hipp for once again 
responding quickly to issues we've brought up.  While it would be good to get 
this resolved soon one way or another (doc and/or code changes), it doesn't 
sound like it needs to be a release blocker for 3.6.0 so I'm lowering its 
priority.

--
priority: release blocker -> high
stage:  -> patch review

___
Python tracker 

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



[issue28880] range(i, j) doesn't work

2016-12-05 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Hi John, and thanks for the bug report. If only they were all as easily 
resolved as this one :-)

With respect, if you're just getting started with Python, you shouldn't get 
into the habit of hitting the bug tracker every time you find something that 
surprises you. If you're new to programming in general as well as Python, you 
might find the python tutor mailing list helpful; otherwise the main python 
discussion list can be helpful (although it is fairly high volume and often 
goes into long off-topic discussions).

https://mail.python.org/mailman/listinfo/tutor
https://mail.python.org/mailman/listinfo/python-list

--
nosy: +steven.daprano

___
Python tracker 

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



[issue28881] int no attribute 'lower' iterating email.Messasge

2016-12-05 Thread Martin Panter

Martin Panter added the comment:

You just need a messsage object with one or more header fields:

>>> msg = message_from_string("Name: value\r\n\r\n")
>>> for m in msg:
... pass
... 
AttributeError: 'int' object has no attribute 'lower'

Python 2 does not implement __iter__(), so it is the default sequence iteration 
protocol causing this behaviour. The documentation does not mention iteration 
either: 
.
 It mentions a “mapping-like interface”, but since it explicitly lists 
__len__(), __contains__(), etc, and not __iter__(), I would say you should not 
assume iteration is supported.

Python 3 does implement Message.__iter__(), but it does not seem to be 
documented. The method seems to be added as a side effect of Guido removing and 
restoring the email package:

https://github.com/python/cpython/commit/1058618#diff-92a78c52ebc0a8908cbd06c8155f8bdb
 (removed without __iter__)
https://hg.python.org/cpython/file/d5f3c2f416f2/Lib/email/message.py (added 
back including __iter__)

--
nosy: +martin.panter
title: int no attribute 'lower' -> int no attribute 'lower' iterating 
email.Messasge

___
Python tracker 

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



[issue28881] int no attribute 'lower' iterating email.Message

2016-12-05 Thread Martin Panter

Changes by Martin Panter :


--
title: int no attribute 'lower' iterating email.Messasge -> int no attribute 
'lower' iterating email.Message

___
Python tracker 

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



[issue28089] Document TCP_NODELAY by default

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

Yury: I don't understand your issue, can you please elaborate? Do you mean that 
the default value of the TCP_NODELAY changed in Python 3.6? Otherwise, why do 
you consider it as a release blocker?

The Python 3.6 release must be blocked by a TCP flag? Really?

--

___
Python tracker 

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



[issue28866] Unexpected behavior resulting from mro() and __setattr__ in interactive mode

2016-12-05 Thread Julien Palard

Julien Palard added the comment:

I found a way to fix it, but as I'm just discovering cpython internals, I'm not 
sure it's the right way, review are very welcome.

I fixed it this way because:

The bytecode generated for "proxy.x = 0" (a STORE_ATTR) will call a
PyObject_SetAttr with FooProxy which will soon execute the __setattr__ of Meta, 
itself calling a PyObject_SetAttr with Foo.

The actual attribute setting is done from the PyObject_SetAttr with Foo 
(calling in turn type_setattro, and so on), but it's already too late to 
invalidate the FooProxy type: we no longer have a reference on it and can't 
guess that FooProxy delegated __setattr__ to Foo.

So the only place when we can invalidate correctly is in the first call of 
PyObject_SetAttr when we know on which type the attribute will be set, and it 
make sense: It does not matter what a __setattr__ does and how it does it: 
invalidation should happen for this attribute on the current type, so 
invalidating here seems logic.

I did not yet took the time to measure performance loss induced with this patch.

With the patch:

./python -i weird.py
>>> proxy.x
0
>>> proxy.x
0

--
keywords: +patch
Added file: http://bugs.python.org/file45766/issue28866.diff

___
Python tracker 

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



[issue28881] int no attribute 'lower' iterating email.Message

2016-12-05 Thread Martin Panter

Martin Panter added the comment:

The __iter__() method was added by Barry in 
:
“Added an __iter__() to email.message.Message for iterating over the message’s 
headers.”

On the other hand, earlier he said it was ambiguous what the behaviour should 
be: Issue 1017329.

--

___
Python tracker 

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



[issue28808] Make PyUnicode_CompareWithASCIIString() never failing

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

PyUnicode_CompareWithASCIIString-no-errors-2.patch LGTM. Go ahead Serhiy.

--

___
Python tracker 

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



[issue28808] Make PyUnicode_CompareWithASCIIString() never failing

2016-12-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue28089] Document TCP_NODELAY by default

2016-12-05 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

The change is that TCP_NODELAY option is set by default in 3.6. It was not the 
case in 3.5.

--

___
Python tracker 

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



[issue28089] asyncio: Document that TCP_NODELAY is now used by default

2016-12-05 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Document TCP_NODELAY by default -> asyncio: Document that TCP_NODELAY is 
now used by default

___
Python tracker 

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



[issue28089] asyncio: Document that TCP_NODELAY is now used by default

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

> The change is that TCP_NODELAY option is set by default in 3.6. It was not 
> the case in 3.5.

Ah, it's a change in _asyncio_, ok. I missed that from the issue title, so I 
changed the title.

--

___
Python tracker 

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



[issue28617] Why isn't "in" called a comparison operation?

2016-12-05 Thread wim glenn

wim glenn added the comment:

1 month later.. is newpatch.diff OK to merge or any further improvements 
needed?  thanks

--

___
Python tracker 

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



[issue28808] Make PyUnicode_CompareWithASCIIString() never failing

2016-12-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b431d39da67f by Serhiy Storchaka in branch '3.5':
Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.
https://hg.python.org/cpython/rev/b431d39da67f

New changeset 5bdc8e1a50c8 by Serhiy Storchaka in branch '3.6':
Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.
https://hg.python.org/cpython/rev/5bdc8e1a50c8

New changeset db56e39ea067 by Serhiy Storchaka in branch 'default':
Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.
https://hg.python.org/cpython/rev/db56e39ea067

--
nosy: +python-dev

___
Python tracker 

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



[issue23722] During metaclass.__init__, super() of the constructed class does not work

2016-12-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fa4d8276d0fb by Serhiy Storchaka in branch 'default':
Fixed merge error in Misc/NEWS for issue #23722.
https://hg.python.org/cpython/rev/fa4d8276d0fb

--

___
Python tracker 

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



[issue28808] Make PyUnicode_CompareWithASCIIString() never failing

2016-12-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Ned and Victor.

--
priority: release blocker -> normal
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



[issue28835] Change in behavior when overriding warnings.showwarning and with catch_warnings(record=True)

2016-12-05 Thread STINNER Victor

STINNER Victor added the comment:

Ok, here is a fix.

--
keywords: +patch
Added file: http://bugs.python.org/file45767/warnings_fix.patch

___
Python tracker 

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



  1   2   >