[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-25 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> fixed
stage: commit 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



[issue4347] Circular dependency causes SystemError when adding new syntax

2016-10-25 Thread Martin Panter

Martin Panter added the comment:

I occasionally get the following error, due to Parser/parsetok.o being older 
than Include/graminit.h.

./python -E -S -m sysconfig --generate-posix-vars ; if test $? -ne 0 ; then  
echo "generate-posix-vars failed" ;  rm -f ./pybuilddir.txt ;  exit 1 ;  fi
Could not import runpy module
Traceback (most recent call last):
  File "/home/proj/python/cpython/Lib/runpy.py", line 14, in 
import importlib.machinery # importlib first so we can test #15386 via -m
  File "/home/proj/python/cpython/Lib/importlib/__init__.py", line 57, in 

import types
  File "/home/proj/python/cpython/Lib/types.py", line 166, in 
import functools as _functools
  File "/home/proj/python/cpython/Lib/functools.py", line 345, in 
_CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", 
"currsize"])
  File "/home/proj/python/cpython/Lib/collections/__init__.py", line 428, in 
namedtuple
exec(class_definition, namespace)
SystemError: invalid node 339 for PyAST_FromNode
generate-posix-vars failed
*** Error code 1

The best workaround for me (less brute force than removing the whole build 
tree) seems to be to add Parser/parsetok.c to the list of files to “touch” the 
timestamps of before building.

The dependency in Parser/parsetok.c on Include/graminit.h was added by 
, presumably 
to support encoding declarations in Python source files. I haven’t tried, but 
perhaps to avoid pgen depending on its output, a quick fix would be to add 
#ifndef PGEN around the offending code. For Python 2, a Parser/parsetok_pgen.c 
wrapper file would have to added, like in revision 6e9dc970ac0e.

--
nosy: +martin.panter

___
Python tracker 

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



[issue28509] dict.update allocates too much

2016-10-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, I prefer the existing code be left as is.   We've already greatly 
compacted the dictionaries.  There is no need to be ultra-aggressive in shaving 
off every little corner.  There is some advantage to having the dict be more 
sparse (fewer collisions, quicker insertion time for the update, quicker 
lookups etc).

--

___
Python tracker 

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-25 Thread Eryk Sun

Eryk Sun added the comment:

I installed "WinPython-64bit-3.6.0.0Zerorc2.exe" on Windows 10. As you can see 
below, the included version of IDLEX depends on idlelib implementation details 
that have changed between 3.5 and 3.6:

C:\WinPython36\python-3.6.0b2.amd64>.\python
Python 3.6.0b2 (default, Oct 10 2016, 21:15:32) [MSC v.1900 64 bit (AMD64)] 
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>  import idlexlib
Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\WinPython36\python-3.6.0b2.amd64\Lib\site-packages\idlexlib\__init__.py", 
line 10, in 
from .idlexMain import version as __version__
  File 
"C:\WinPython36\python-3.6.0b2.amd64\Lib\site-packages\idlexlib\idlexMain.py", 
line 46, in 
from idlexlib.extensionManager import extensionManager
  File 
"C:\WinPython36\python-3.6.0b2.amd64\Lib\site-packages\idlexlib\extensionManager.py",
 line 60, in 
from idlelib.configHandler import idleConf, IdleConfParser
ModuleNotFoundError: No module named 'idlelib.configHandler'

The "Unable to located" [sic] error is from the idlex.py script due to the 
above import error.

I couldn't reproduce the crash due to python._pth. Your Windows application log 
should provide the DLL (module) and exception code for the crash, but a dump 
file would be even better. With the error reporting dialog still open, look for 
the crashed python.exe in the task manager details tab (the working set of the 
crashed process should be small -- about 100K). Right-click it and select the 
option to create a dump file. Zip the dump file and upload it here.

--
nosy: +eryksun

___
Python tracker 

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



[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2016-10-25 Thread Walker Hale IV

Walker Hale IV added the comment:

Clarifying the documentation regarding the __enter__ method eliminates the need 
for further discussion on this point regarding pop_all(), which was really just 
the motivating use case.

That leaves the question of the most readable documentation change that 
accomplishes the result — some point between verbose and terse that minimizes 
the time required to comprehend the material.

My problem with the language "ExitStack instances return themselves when used 
in a with statement" is that it only specifies the return value of the 
__enter__ method but leaves open the question of whether the __enter__ method 
is doing anything else, particularly in the case of an ExitStack that is 
already loaded with context managers. How does a reader know that the __enter__ 
method of a loaded ExitStack doesn't call the __enter__ method of the the 
context managers inside? The documentation elsewhere provides strong evidence 
against this, but nothing that makes the point explicit. The reader is left 
with an exercise in deduction.

How about replacing my previous wording with: "The __enter__ method has no 
behavior besides returning the ExitStack instance?"

(I feel a little dirty using that language, since it might tie the hands of 
future developers. The truly correct wording would be "The __enter__ method is 
idempotent and behaves as if the only thing it does is return the ExitStack 
instance." That more verbose description gives future developers the freedom to 
do weird JIT optimizations and caching as needed, but who has the patience for 
such legally exhaustive specification?)

Placing the wording where I did — at the end of the class discussion and prior 
to the new methods — prevents this point from obscuring the main purpose of 
ExitStack while still leaving a place for such messy but important details. 
(Amazing the thought that goes into documenting a two-line method.)

--

___
Python tracker 

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



[issue28530] Howto detect if an object is of type os.DirEntry

2016-10-25 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Eryk: With the fixes for issue25994 and issue26603, you'd want to use a with 
statement for the scandir; the use pattern in that example is guaranteed to 
cause a ResourceWarning on any directory with more than one entry.

--
nosy: +josh.r

___
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-10-25 Thread Guido van Rossum

Guido van Rossum added the comment:

Oh sorry. I received the emails in a strange order. I guess it can stay open.

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

___
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-10-25 Thread Guido van Rossum

Guido van Rossum added the comment:

Where did you report that? I don't see your name on this bug -- it has a patch 
that's been unapplied for 5 years, so I doubt it's very important.

--

___
Python tracker 

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



[issue18235] _sysconfigdata.py wrong on AIX installations

2016-10-25 Thread Martin Panter

Martin Panter added the comment:

Regarding out-of-tree builds (Problem 3), see Issue 10656, which already has a 
potential patch.

--

___
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-10-25 Thread Nathaniel Manista

Nathaniel Manista added the comment:

Wait, really? My report came out of a real bug that I had in my system and 
shipped to my users; it wasn't academic or contrived at all.

--

___
Python tracker 

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



[issue28509] dict.update allocates too much

2016-10-25 Thread INADA Naoki

INADA Naoki added the comment:

I feel that accept one resize while merging is better.
How about this?

/* Do one big resize at the start, rather than incrementally
 * resizing.  At most one resize happen while merging.
 */
if (USABLE_FRACTION(mp->ma_keys->dk_size) < other->ma_used) {
assert(mp->ma_used < other->ma_used);
if (dictresize(mp, ESTIMATE_SIZE(other->ma_used))) {
   return -1;
}
}

--

___
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-10-25 Thread Guido van Rossum

Guido van Rossum added the comment:

Honestly let's just forget about this.

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Guido van Rossum

Guido van Rossum added the comment:

OK, backed out the code changes, kept the docs.

--

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6eb3312a9a16 by Guido van Rossum in branch '3.6':
Issue #25002: Back out asyncore/asynchat deprecation.
https://hg.python.org/cpython/rev/6eb3312a9a16

New changeset 2879185bc511 by Guido van Rossum in branch 'default':
Issue #25002: Back out asyncore/asynchat deprecation. (3.6->3.7)
https://hg.python.org/cpython/rev/2879185bc511

--

___
Python tracker 

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



[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 720865fa61a4 by Martin Panter in branch '3.5':
Issue #26240: Clean up the subprocess module doc string
https://hg.python.org/cpython/rev/720865fa61a4

New changeset 8358c68579e9 by Martin Panter in branch '3.6':
Issue #26240: Merge subprocess doc string from 3.5 into 3.6
https://hg.python.org/cpython/rev/8358c68579e9

New changeset 0dd8b3f133f9 by Martin Panter in branch 'default':
Issue #26240: Merge subprocess doc string from 3.6
https://hg.python.org/cpython/rev/0dd8b3f133f9

New changeset 5a1edf5701f1 by Martin Panter in branch '2.7':
Issue #26240: Clean up the subprocess module doc string
https://hg.python.org/cpython/rev/5a1edf5701f1

--
nosy: +python-dev

___
Python tracker 

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



[issue10656] "Out of tree" build fails on AIX

2016-10-25 Thread Martin Panter

Martin Panter added the comment:

Actually, why do you remove $(srcdir) for Modules/python.exp? This code was 
added in r88426; see .

--

___
Python tracker 

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



[issue10656] "Out of tree" build fails on AIX

2016-10-25 Thread Martin Panter

Martin Panter added the comment:

The idea of the patches makes sense to me.

Embedding the name of whatever directory Python was built in into the installed 
version of Modules/ld_so_aix.in does not seem very clean to me. Is there 
another way of doing this? Perhaps a file copy or symlink?

--
nosy: +martin.panter
stage:  -> patch review
versions: +Python 3.6, Python 3.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



[issue2506] Add mechanism to disable optimizations

2016-10-25 Thread irdb

Changes by irdb :


--
nosy: +irdb

___
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-10-25 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +Nathaniel Manista, aleax, cvrebert

___
Python tracker 

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



[issue28537] abc module fails to reject instantiation of some multiply-inheriting classes that fail to implement abstract methods

2016-10-25 Thread R. David Murray

R. David Murray added the comment:

Thanks for the report, but this is a duplicate of issue 5996.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> abstract class instantiable when subclassing dict

___
Python tracker 

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



[issue18235] _sysconfigdata.py wrong on AIX installations

2016-10-25 Thread Martin Panter

Martin Panter added the comment:

Michael F.: It sounds like you have three separate but related problems:

1. Confusion between LDSHARED and BLDSHARED referring to the in-source build 
tree vs final installed files. I think this is what David and Michael H. were 
originally trying to fix here.

2. Only BLDSHARED has an extra -L flag. Where is the code that adds it? I can’t 
find it in configure.ac in either Python 3 or 2 versions.

3. BLDSHARED also fails to work for out-of-tree builds, because it refers to 
the build tree (.) rather than the source tree. This sounds like another bug to 
me; do you want to make a patch?

--

___
Python tracker 

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



[issue28014] Strange interaction between methods in subclass of C OrderedDict

2016-10-25 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Note: This class doesn't actually work on 3.4 in other ways (because 
__getitem__ is not idempotent, while OrderedDict assumes it is):

>>> s = SimpleLRUCache(2)
>>> s['t1'] = 1
>>> s
SimpleLRUCache([('t1', 1)])
>>> s['t2'] = 2
>>> s
SimpleLRUCache([('t1', 1)])
>>> s
SimpleLRUCache([('t2', 2)])  # <-- No changes, repr different

If your __getitem__ isn't idempotent, you've broken a basic assumption built 
into the logic of the other methods you inherited, and you're going to need to 
override other methods to avoid misbehavior.

--
nosy: +josh.r

___
Python tracker 

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



[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2016-10-25 Thread Josh Rosenberg

Josh Rosenberg added the comment:

The Python implementation of OrderedDict breaks for issue28014, at least on 
3.4.3 (it doesn't raise KeyError, but if you check the repr, it's only showing 
one of the two entries, because calling __getitem__ is rearranging the 
OrderedDict).

>>> s = SimpleLRUCache(2)
>>> s['t1'] = 1
>>> s
SimpleLRUCache([('t1', 1)])
>>> s['t2'] = 2
>>> s
SimpleLRUCache([('t1', 1)])
>>> s
SimpleLRUCache([('t2', 2)])

Again, the OrderedDict code (in the Python case, __repr__, in the C case, 
popitem) assumes __getitem__ is idempotent, and again, the violation of that 
constraint makes things break. They break differently in the Python 
implementation and the C implementation, but they still break, because people 
are trying to force OrderedDict to do unnatural things without implementing 
their own logic to ensure their violations of the dict pseudo-contract actually 
works.

popitem happens to be a common cause of problems because it's logically a get 
and delete combined. People aren't using it for the get feature, it's just a 
convenient way to remove items from the end; if they bypassed getting and just 
deleted it would work, but it's a more awkward construction, so they don't. If 
they implemented their own popitem that avoided their own non-idempotent 
__getitem__, that would also work.

I'd be perfectly happy with making popitem implemented in terms of pop on 
subclasses when pop is overridden (if pop isn't overridden though, that's 
effectively what popitem already does).

I just don't think we should be making the decision that popitem *requires* 
inheritance for all dict subclasses that have (normal) idempotent __contains__ 
and __getitem__ because classes that violate the usual expectations of 
__contains__ and __getitem__ have (non-segfaulting) problems.

Note: In the expiring case, the fix is still "wrong" if someone used popitem 
for the intended purpose (to get and delete). The item popped might have 
expired an hour ago, but because the fixed code bypasses __getitem__, it will 
happily return the expired a long expired item (having bypassed expiration 
checking). It also breaks encapsulation, returning the expiry time that is 
supposed to be stripped on pop. By fixing one logic flaw on behalf of a 
fundamentally broken subclass, we introduced another.

--

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Martin Panter

Martin Panter added the comment:

Perhaps it is okay to keep the documentation changes, but I think either the 
library changes should be reverted or worked around where the modules are still 
in use.

I normally run the tests with -Werror, and the failures I get are:

* test_ssl, test_smtplib, test_poplib, test_logging, test_ftplib, test_support: 
tests use asyncore
* test_os: test uses asynchat (When you import asynchat, the first error 
complains about importing asyncore, there are actually two warnings)
* test_all: This seems to ignore DeprecationWarning; perhaps an exception for 
PendingDeprecationWarning should also be added?
* test_asyncore and test_asynchat: Obviously these have to still test the 
modules, so they should anticipate the warnings, perhaps using Serhiy’s code
* test_smtpd: smtpd module itself uses asyncore; see Issue 25008

--
nosy: +martin.panter

___
Python tracker 

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-25 Thread Steve Dower

Steve Dower added the comment:

If you right-click the Start button, Event Viewer is near the top.

--

___
Python tracker 

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



[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2016-10-25 Thread R. David Murray

R. David Murray added the comment:

Actually, the __enter__ method is looked up on the class, so saying "the 
__enter__ method of the instance" could be a bit confusing.  Also, many context 
managers return self, so 'trivially' isn't really necessary as a modifier.

What if we added a sentence to the first paragraph that said "ExitStack 
instances return themselves when used in a with statement."  Since that is 
immediately followed by an example of doing that, it seems like the best place 
to put it.

--

___
Python tracker 

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



[issue28537] abc module fails to reject instantiation of some multiply-inheriting classes that fail to implement abstract methods

2016-10-25 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue28535] round seems to provide floor, not proper rounding

2016-10-25 Thread Steven D'Aprano

Steven D'Aprano added the comment:

To be clear, let's look at the first failed assertion:

AssertionError: 32.78 != 32.775 within 2 places

It sure *looks* like 32.775 ought to round to 32.78. And indeed it would, if it 
actually was 32.775. But despite appearances, it isn't. Sure, the number prints 
as 32.775, but that's a recent feature (and a mixed blessing at that). That's a 
side-effect of a clever (perhaps too clever) change to the way floats are 
printed, to prefer neat, friendly numbers over accuracy.

Before Python 2.7, the exact same float would have been printed as 
32.774, and now its obvious why it rounds down to 32.77 rather than 
up to 32.78: 32.774 is *less* than 32.775.

To be precise, printing the old way:

32.774 rounds down to 32.773 rather than up to 
32.781, exactly as promised.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue28537] abc module fails to reject instantiation of some multiply-inheriting classes that fail to implement abstract methods

2016-10-25 Thread Nathaniel Manista

New submission from Nathaniel Manista:

The attached file when executed should fail (raise an exception) one line above 
where it actually does. Right?

I discovered this in 2.7 but have confirmed that it's still a problem in 
3.6.0b2.

--
components: Library (Lib)
files: abc_what.py
messages: 279465
nosy: Nathaniel Manista, aleax
priority: normal
severity: normal
status: open
title: abc module fails to reject instantiation of some multiply-inheriting 
classes that fail to implement abstract methods
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45226/abc_what.py

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread STINNER Victor

STINNER Victor added the comment:

R. David Murray added the comment:
> The alternative has already been written: aiosmtpd, in the aiolibs
project.  The question is should it be added to the stdlib...

I suggest to keep it on PyPI to keep fast releases.

--

___
Python tracker 

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



[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2016-10-25 Thread Martin Panter

Martin Panter added the comment:

I agree it is good to explicitly document the __enter__() result, rather than 
relying on assumptions and example code. The patch looks good to me.

I don’t understand the problem with pop_all() though. Is there still a problem 
if we apply your patch?

--
nosy: +martin.panter
stage:  -> patch review
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue2786] Names in function call exception should have class names, if they're methods

2016-10-25 Thread Ryan Gonzalez

Changes by Ryan Gonzalez :


--
nosy: +Ryan.Gonzalez

___
Python tracker 

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



[issue28536] Show the qualified name when a call fails

2016-10-25 Thread Martin Panter

Martin Panter added the comment:

Perhaps you should merge your work with Issue 2786. With a very brief look, the 
patches seem to take a similar approach.

--
nosy: +martin.panter
resolution:  -> duplicate
superseder:  -> Names in function call exception should have class names, if 
they're methods

___
Python tracker 

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



[issue28536] Show the qualified name when a call fails

2016-10-25 Thread Ryan Gonzalez

Ryan Gonzalez added the comment:

HAHA, I lied. :D Attached is what I have so far.

--
keywords: +patch
Added file: 
http://bugs.python.org/file45225/0001-Make-failed-calls-to-methods-show-the-fully-qualifie.patch

___
Python tracker 

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



[issue28536] Show the qualified name when a call fails

2016-10-25 Thread Ryan Gonzalez

New submission from Ryan Gonzalez:

e.g. make this:


class X:
def __init__(self): pass

X(1)


print something like this:


TypeError: X.__init__() takes 1 positional argument but 2 were given


instead of:


TypeError: __init__() takes 1 positional argument but 2 were given


I'm trying to see if I can create a patch right now, though it probably won't 
be ready until Thursday.

--
components: Interpreter Core
messages: 279460
nosy: Ryan.Gonzalez
priority: normal
severity: normal
status: open
title: Show the qualified name when a call fails
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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-25 Thread Big Stone

Big Stone added the comment:

possible particularities of my PC vs yours:
- I have no python entry at all in the regex
- I have no py.exe,
- I have no Visual Studio (but the compiler)

with Windows 10, I don't know where is the even viewer.

--

___
Python tracker 

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



[issue19542] WeakValueDictionary bug in setdefault()()

2016-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28509] dict.update allocates too much

2016-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

Here is a script that produces more compact output. The first column is a size 
after which the dict is resized.

import sys
p = 1
b = {}
for i in range(1):
a = {}
b[i] = i
a.update(b)
s = sys.getsizeof(a)
if s > p:
print(i, p)
p = s

Unpatched:
5 128
7 196
15 344
31 628
63 1208
127 2612
255 5176
511 10292
1023 20536
2047 41012
4095 81976
8191 163892

Patched:
5 128
10 196
21 344
42 628
85 1208
170 2612
341 5176
682 10292
1365 20536
2730 41012
5461 81976

But I suggest instead the condition

mp->ma_keys->dk_usable < other->ma_used

use the condition

mp->ma_used + mp->ma_keys->dk_usable < other->ma_used

If there are overlapping keys this can allow to avoid resizing. In worst keys 
one resizing will be happened in dictinsert().

Yes one estimation is:

USABLE_FRACTION(2 * mp->ma_keys->dk_size) < mp->ma_used + other->ma_used

Dict size is at least doubled after resizing. No need to make preliminary 
resizing if the final result is the same. The benefit is that if there are many 
overlapping keys the final size can be ESTIMATE_SIZE(other->ma_used) instead of 
ESTIMATE_SIZE(mp->ma_used + other->ma_used).

All this conditions can be combined (because they have different computational 
cost):

mp->ma_keys->dk_usable < other->ma_used &&
mp->ma_used + mp->ma_keys->dk_usable < other->ma_used &&
USABLE_FRACTION(2 * mp->ma_keys->dk_size) < mp->ma_used + other->ma_used

--

___
Python tracker 

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



[issue28535] round seems to provide floor, not proper rounding

2016-10-25 Thread R. David Murray

R. David Murray added the comment:

You must have missed the note about floating point (in the grey box).

assertAlmostEqual is a bit of problem child in any case.  There are open issues 
about improved functionality for the use case it tries to address.

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



[issue28535] round seems to provide floor, not proper rounding

2016-10-25 Thread Mike Williamson

New submission from Mike Williamson:

Ran a test that I expected to pass.  When the test failed, I was struck by the 
strange (incorrect) assertion claim when using unittest.assertAlmostEqual:


AssertionError: 32.78 != 32.775 within 2 places


Uhmm... yes it does!
I delved in, discovering that assertAlmostEquals simply calls round.  So, I 
tried it with round, shown below:


>>> round(32.775, 2)
32.77
>>> round(32.785, 2)
32.78
>>> round(32.745, 2)
32.74
>>> round(32.746, 2)
32.75


I then looked at the documentation, to understand whether this odd behavior is 
indeed expected.  I saw (on 
https://docs.python.org/3/library/functions.html#round ):

---

If two multiples are equally close, rounding is done toward the even choice 
(so, for example, both round(0.5) and round(-0.5) are 0, and round(1.5) is 2).

---

However, as you can see, this is not the behavior I'm experiencing. So, it 
looks like a real bug.

I am attaching the two files where I was running the unit tests, but I'm not 
sure you really need them.


Thank you!

--
components: Library (Lib)
files: bad_tests.py
messages: 279456
nosy: lazarillo
priority: normal
severity: normal
status: open
title: round seems to provide floor, not proper rounding
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file45224/bad_tests.py

___
Python tracker 

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



[issue19542] WeakValueDictionary bug in setdefault()()

2016-10-25 Thread Armin Rigo

Armin Rigo added the comment:

ping

--

___
Python tracker 

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



[issue25166] Windows AllUsers installation places uninstaller in user profile

2016-10-25 Thread Steve Dower

Steve Dower added the comment:

I won't be changing the official releases to be a single MSI again - the 
experience is too hostile towards regular users.

As my (volunteer) time allows, I've been working on resolving the issue in WiX 
and we are totally capable of moving to a private build of WiX that includes a 
fix. There is no need to wait for 4.0.

If you would like a single MSI installer, I'd suggest offering some time (or 
paying someone to spend their time) to develop one and distribute it 
independently. The old installer might be a good starting point, but it had a 
range of issues that have been resolved by the new installer. There are also a 
number of features available in the new installer that are not available under 
a single MSI (such as per-user installs, installing/skipping the CRT, and 
disabling MAX_PATH limitations). However, if your installer becomes more 
popular than the official one, it will be strong evidence that people would 
rather have one monolithic installer with less reliable options, and we can 
consider switching back to that format.

--

___
Python tracker 

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



[issue25166] Windows AllUsers installation places uninstaller in user profile

2016-10-25 Thread Zachary Ware

Zachary Ware added the comment:

Christian, your desire for a single MSI is well known, and repeatedly stating 
that desire is far more likely to raise ire rather than spur change.  No, you 
did not need to include "ceterum censeo".

The installer system that Steve created for us has many features that I and 
many others would be very sad to see disappear again, and which cannot be 
supported by a single MSI distribution.  In particular, selecting which 
components to install and only downloading those components is a wonderful 
feature for anyone with a low-bandwidth or metered internet connection.

If the current installer is unusable to you, feel free to forward-port the old 
3.4 installer system and create your own installers.  Alternately, feel free to 
provide patches to resolve this or any other issues you have with the current 
installer.

--

___
Python tracker 

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



[issue27122] Hang with contextlib.ExitStack and subprocess.Popen (regression)

2016-10-25 Thread Gregory P. Smith

Gregory P. Smith added the comment:

we talented!

--

___
Python tracker 

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



[issue25166] Windows AllUsers installation places uninstaller in user profile

2016-10-25 Thread Christian Ullrich

Christian Ullrich added the comment:

This bug has been open for over a year and two subsequent releases, and its 
planned resolution depends on a change to WiX. The related WiX bug (see comment 
above) is scheduled to be implemented in WiX 4.0, which has no prospective 
release date. According to , 
only 27 percent of the issues currently planned for this release are resolved.

In my opinion, this is an important bug that cannot wait indefinitely.

Ceterum censeo (yes, there had to be one): This is particularly true when 
considering that a (relatively) simple fix exists that can be done by the 
Python project alone, with no external dependencies. I am referring, of course, 
to dropping the burn bundle entirely and shipping a single MSI package again, 
rather than 43 (!) of them (across x86 and amd64) with an average of ~190 and a 
median of 8 (eight) installed files per package in 3.5.2, counting pip.

--

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Guido van Rossum

Guido van Rossum added the comment:

Serhiy, so should I revert this patch for now? Or are the silent
deprecation warnings outside the test suite okay? (In that case, maybe
Mariatta can upload a patch?)

--

___
Python tracker 

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



[issue27122] Hang with contextlib.ExitStack and subprocess.Popen (regression)

2016-10-25 Thread Carl Meyer

Carl Meyer added the comment:

Greg, there was also a (different!) typo of the issue number in the code 
comment committed with this fix; that typo hasn't been fixed. Sent me on quite 
the chase looking for this bug. (I tracked down the bug independently, then 
wasn't able to repro it on trunk and found your fix and code comment). It's an 
impressive achievement to typo the same bug ID two different ways within the 
same twelve-line patch! ;-)

--
nosy: +carljm

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue28509] dict.update allocates too much

2016-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue28387] double free in io.TextIOWrapper

2016-10-25 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



[issue28514] Python (IDLE?) freezes on file save on Windows

2016-10-25 Thread Ned Deily

Ned Deily added the comment:

You need more assistance than we can give here on the issue tracker.  Please 
look at the help resources here: https://www.python.org/about/help/.  In 
particular, you could try asking on the tutor mailing list: 
https://mail.python.org/mailman/listinfo/tutor.  Good luck!

--

___
Python tracker 

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



[issue28509] dict.update allocates too much

2016-10-25 Thread INADA Naoki

INADA Naoki added the comment:

script:
import sys

for i in range(25):
a = {}
b = {j: j for j in range(i)}
a.update(b)
print(i, sys.getsizeof(a))

before:
0 256
1 256
2 256
3 256
4 256
5 256
6 384
7 384
8 664
9 664
10 664
11 664
12 664
13 664
14 664
15 664
16 1200
17 1200
18 1200
19 1200
20 1200
21 1200
22 1200
23 1200
24 1200

patched:
0 256
1 256
2 256
3 256
4 256
5 256
6 384
7 384
8 384
9 384
10 384
11 664
12 664
13 664
14 664
15 664
16 664
17 664
18 664
19 664
20 664
21 664
22 1200
23 1200
24 1200

--
keywords: +patch
Added file: http://bugs.python.org/file45223/28509-smaller-update.patch

___
Python tracker 

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



[issue28199] Compact dict resizing is doing too much work

2016-10-25 Thread INADA Naoki

INADA Naoki added the comment:

@haypo, could you review this?

--

___
Python tracker 

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



[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-25 Thread Steve Dower

Changes by Steve Dower :


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



[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6b46c3deea2c by Steve Dower in branch '3.6':
Issue #28333: Fixes off-by-one error that was adding an extra space.
https://hg.python.org/cpython/rev/6b46c3deea2c

New changeset 44d15ba67d2e by Steve Dower in branch 'default':
Issue #28333: Fixes off-by-one error that was adding an extra space.
https://hg.python.org/cpython/rev/44d15ba67d2e

--

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread R. David Murray

R. David Murray added the comment:

The alternative has already been written: aiosmtpd, in the aiolibs project.  
The question is should it be added to the stdlib...

--

___
Python tracker 

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



[issue27517] LZMACompressor and LZMADecompressor raise exceptions if given empty strings twice

2016-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue14061] Misc fixes and cleanups in archiving code in shutil and test_shutil

2016-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
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



[issue17711] Persistent id in pickle with protocol version 0

2016-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue28529] 0 ** 0 should raise ArithmeticError

2016-10-25 Thread Mark Dickinson

Mark Dickinson added the comment:

Also, https://en.wikipedia.org/wiki/Exponentiation#Zero_to_the_power_of_zero

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks Serhiy, 

I created these two tickets:
https://bugs.python.org/issue28534
https://bugs.python.org/issue28533

--

___
Python tracker 

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



[issue28533] Replace asyncore

2016-10-25 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
components: +asyncio
nosy: +gvanrossum, yselivanov

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, asyncore/asynchat are used in smtpd!

It looks to me that we should first write asyncio alternative to smtpd, then 
deprecate smtpd, and only after this we can deprecate asyncore/asynchat.

--
dependencies: +Deprecate smtpd (based on deprecated asyncore/asynchat): write a 
new smtp server with asyncio

___
Python tracker 

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



[issue28534] Replace asynchat

2016-10-25 Thread Mariatta Wijaya

New submission from Mariatta Wijaya:

Deprecation warning was added to asynchat in https://bugs.python.org/issue25002

asynchat is still used in several tests and should be replaced.

--
components: asyncio
messages: 279441
nosy: Mariatta, gvanrossum, yselivanov
priority: normal
severity: normal
status: open
title: Replace asynchat

___
Python tracker 

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



[issue28533] Replace asyncore

2016-10-25 Thread Mariatta Wijaya

New submission from Mariatta Wijaya:

Deprecation warning was added to asyncore in https://bugs.python.org/issue25002

asyncore is still used in several tests and should be replaced.

--
messages: 279439
nosy: Mariatta
priority: normal
severity: normal
status: open
title: Replace asyncore

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Should I create a different ticket about replacing asyncore and asynchat?

This may require several tickets, one per case.

--
components: +Library (Lib)
resolution: fixed -> 
stage:  -> needs patch
type:  -> enhancement
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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Sorry about this Serhiy. I can work on another patch based on your code snippet 
later today.

Should I create a different ticket about replacing asyncore and asynchat?

--

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think replacing

import asynchat
import asyncore

with

with warnings.catch_warnings():
warnings.simplefilter('ignore', PendingDeprecationWarning)
import asynchat
import asyncore

can help.

asynchat and asyncore are used in several tests.

In long term asynchat and asyncore should be replaced with alternatives.

--

___
Python tracker 

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



[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-25 Thread Eryk Sun

Eryk Sun added the comment:

I forgot to include the link to the python-list thread where this came up:

https://mail.python.org/pipermail/python-list/2016-October/715428.html

--

___
Python tracker 

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



[issue28259] Ctypes bug windows

2016-10-25 Thread Aristotel

Aristotel added the comment:

Sorry for delay. I tried to write as small as possible example. Sorry if it is 
too big
Usage: run 2 consoles, cd to dir with sources. In first console type 'python3 
main.py test1.tox', and in second type 'python3 main.py test2.tox'. Wait 1-2 
min until apps connect and you will see a lot of "access violation reading 
0x" when consoles start video call. sometimes apps crashes too. crashes 
fine on both win 7 an win 8 for me

--
Added file: http://bugs.python.org/file45222/toxygen_video_test.zip

___
Python tracker 

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



[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2016-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, what is the reason for this code!

But Python implementation of popitem() don't call overridden 
__getitem__/__delitem__. It uses dict.pop(). Simplified C implementation is 
closer to Python implementation.

expiringdict is not the only implementation broken by accelerated OrderedDict. 
See other example in issue28014.

--

___
Python tracker 

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



[issue28530] Howto detect if an object is of type os.DirEntry

2016-10-25 Thread Eryk Sun

Eryk Sun added the comment:

os.DirEntry exists in 3.6, but the change wasn't backported to 3.5. See issue 
27038. As a workaround, you can scan a non-empty directory to get a reference 
to the DirEntry type, e.g.:

import os
import tempfile

with tempfile.NamedTemporaryFile() as f:
path = os.path.dirname(f.name)
DirEntry = type(next(os.scandir(path)))

--
nosy: +eryksun

___
Python tracker 

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-25 Thread Steve Dower

Steve Dower added the comment:

Check in the Event Log viewer to see if there is an "Application Error" entry 
for python.exe. Also, if you run python.exe from a command prompt there may be 
more information displayed in the output.

--

___
Python tracker 

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



[issue28514] Python (IDLE?) freezes on file save on Windows

2016-10-25 Thread Kamran

Kamran added the comment:

To Ned Deily
I am using Python 3.2.3 because I use it at schoolo and my teacher said use
this. Also because I do not know how to use any other model other than this
because I was taught this at school. ANY SUGGESTIONS

THANKS

*Kamran Muhammad*

On Mon, Oct 24, 2016 at 8:05 PM, Eryk Sun  wrote:

>
> Eryk Sun added the comment:
>
> > Windows 7 is very old.
>
> 3.8 will probably be the last Python version to support Windows 7 (2020-01
> EOL). 3.6 is the last to support Vista.
>
> --
> nosy: +eryksun
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Guido van Rossum

Guido van Rossum added the comment:

Sorry about that. Should I roll it back or is there a way to make the test pass 
(expect this deprecation)?

--

___
Python tracker 

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



[issue28532] Show sys.version when -V option is supplied twice.

2016-10-25 Thread INADA Naoki

New submission from INADA Naoki:

As discussed on python-dev, this patch adds -VV option to python cmdline.

$ ./python -V
Python 3.6.0b2+
$ ./python -VV
Python 3.6.0b2+ (3.6:84a3c5003510+, Oct 26 2016, 02:47:38) 
[GCC 6.2.0 20161005]

The patch includes doc and man update.
Please see, especially my English.

--
assignee: inada.naoki
components: Interpreter Core
files: verbose-version.patch
keywords: patch
messages: 279428
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: Show sys.version when -V option is supplied twice.
type: behavior
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45221/verbose-version.patch

___
Python tracker 

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



[issue28333] input() with Unicode prompt produces mojibake on Windows

2016-10-25 Thread Steve Dower

Steve Dower added the comment:

Not sure how I missed it originally, but that extra 1 char is actually very 
important:

Python 3.6.0b2 (v3.6.0b2:b9fadc7d1c3f, Oct 10 2016, 20:36:51) [MSC v.1900 32 
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>  import sys
>>>  sys.ps1='> '
>  sys

The extra space is because of that. Really ought to fix this before the next 
beta.

--
assignee:  -> steve.dower
nosy: +ned.deily

___
Python tracker 

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



[issue28530] Howto detect if an object is of type os.DirEntry

2016-10-25 Thread R. David Murray

R. David Murray added the comment:

Out of curiosity, what is your use case?

You can grab an object you know is a DirEntry and take its type to get a type 
object to use in, for example, isinstance.

posix.DirEntry is exposed...either nt.DirEntry should be too, or the posix one 
shouldn't be, and/or there should be an os.DirEntry superclass.  So, something 
isn't quite right here no matter how you look at it, IMO.

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-25 Thread Big Stone

Big Stone added the comment:

I just see a windows screen poping up with (translated from french)

"Python has stopped to work" 

a problem caused this program to stop working correctly. Windows is going to 
close this program and will inform you if a solution is available.

--

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: closed -> open

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This change broke buildbots.

$ ./python -We -m test.regrtest test_os 
Run tests sequentially
0:00:00 [1/1] test_os
test test_os crashed -- Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/runtest.py", line 151, in 
runtest_inner
the_module = importlib.import_module(abstest)
  File "/home/serhiy/py/cpython/Lib/importlib/__init__.py", line 126, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 978, in _gcd_import
  File "", line 961, in _find_and_load
  File "", line 950, in _find_and_load_unlocked
  File "", line 655, in _load_unlocked
  File "", line 677, in exec_module
  File "", line 205, in _call_with_frames_removed
  File "/home/serhiy/py/cpython/Lib/test/test_os.py", line 5, in 
import asynchat
  File "/home/serhiy/py/cpython/Lib/asynchat.py", line 48, in 
import asyncore
  File "/home/serhiy/py/cpython/Lib/asyncore.py", line 65, in 
PendingDeprecationWarning, stacklevel=2)
PendingDeprecationWarning: asyncore module is deprecated in 3.6. Use asyncio 
instead.

test_os failed

1 test failed:
test_os

Total duration: 59 ms
Tests result: FAILURE

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-25 Thread Steve Dower

Steve Dower added the comment:

Can you tell me more about the crash? It doesn't cause a crash when I try it 
with my own install.

--

___
Python tracker 

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



[issue28353] os.fwalk() unhandled exception when error occurs accessing symbolic link target

2016-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 470224ec16b6 by Serhiy Storchaka in branch '3.5':
Issue #28353: Fixed tests of os.fwalk() with broken links.
https://hg.python.org/cpython/rev/470224ec16b6

--

___
Python tracker 

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



[issue28107] Update typing module documentation for NamedTuple

2016-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 78c0487562d9 by Guido van Rossum in branch '3.6':
Issue #28107: Update typing module documentation for NamedTuple (Ivan)
https://hg.python.org/cpython/rev/78c0487562d9

New changeset 709b19b9d6ea by Guido van Rossum in branch 'default':
Issue #28107: Update typing module documentation for NamedTuple (Ivan) 
(3.6->3.7)
https://hg.python.org/cpython/rev/709b19b9d6ea

--
nosy: +python-dev

___
Python tracker 

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



[issue28107] Update typing module documentation for NamedTuple

2016-10-25 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks, applied!

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



[issue20847] asyncio docs should call out that network logging is a no-no

2016-10-25 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



[issue28531] Improve utf7 encoder memory usage

2016-10-25 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue28531] Improve utf7 encoder memory usage

2016-10-25 Thread Xiang Zhang

Changes by Xiang Zhang :


Added file: http://bugs.python.org/file45220/utf7_encoder.patch

___
Python tracker 

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



[issue28531] Improve utf7 encoder memory usage

2016-10-25 Thread Xiang Zhang

Changes by Xiang Zhang :


Removed file: http://bugs.python.org/file45219/utf7_encoder.patch

___
Python tracker 

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



[issue28531] Improve utf7 encoder memory usage

2016-10-25 Thread Xiang Zhang

New submission from Xiang Zhang:

Currently utf7 encoder uses an aggressive memory allocation strategy: use the 
worst case 8. We can tighten the worst case.

For 1 byte and 2 byte unicodes, the worst case could be 3*n + 2. For 4 byte 
unicodes, the worst case could be 6*n + 2.

There are 2 cases. First, all characters needs to be encoded, the result length 
should be upper_round(2.67*n) + 2 <= 3*n + 2. Second, encode and not encode 
characters appear one by one. For even length, it's 3n < 3n + 2. For odd 
length, it's exactly 3n + 2.

This won't benefit much when the string is short. But when the string is long, 
it speeds up.

Without patch:

[bin]$ ./python3 -m perf timeit -s 's = "abc"*10' 's.encode("utf7")'

Median +- std dev: 2.79 us +- 0.09 us
[bin]$ ./python3 -m perf timeit -s 's = "abc"*100' 's.encode("utf7")'

Median +- std dev: 4.55 us +- 0.13 us
[bin]$ ./python3 -m perf timeit -s 's = "abc"*1000' 's.encode("utf7")'

Median +- std dev: 14.0 us +- 0.4 us
[bin]$ ./python3 -m perf timeit -s 's = "abc"*1' 's.encode("utf7")'

Median +- std dev: 178 us +- 1 us

With patch:

[bin]$ ./python3 -m perf timeit -s 's = "abc"*10' 's.encode("utf7")'

Median +- std dev: 2.87 us +- 0.09 us
[bin]$ ./python3 -m perf timeit -s 's = "abc"*100' 's.encode("utf7")'

Median +- std dev: 4.50 us +- 0.23 us
[bin]$ ./python3 -m perf timeit -s 's = "abc"*1000' 's.encode("utf7")'

Median +- std dev: 13.3 us +- 0.4 us
[bin]$ ./python3 -m perf timeit -s 's = "abc"*1' 's.encode("utf7")'

Median +- std dev: 102 us +- 1 us

The patch also removes a check, base64bits can only be not 0 when inShift is 
not 0.

--
components: Interpreter Core
files: utf7_encoder.patch
keywords: patch
messages: 279419
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: Improve utf7 encoder memory usage
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45219/utf7_encoder.patch

___
Python tracker 

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



[issue28353] os.fwalk() unhandled exception when error occurs accessing symbolic link target

2016-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ec12e16ea6a1 by Serhiy Storchaka in branch '3.6':
Issue #28353: Try to fix tests.
https://hg.python.org/cpython/rev/ec12e16ea6a1

New changeset a0913dbadea6 by Serhiy Storchaka in branch 'default':
Issue #28353: Try to fix tests.
https://hg.python.org/cpython/rev/a0913dbadea6

--

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bb23770f82f1 by Guido van Rossum in branch '3.6':
Issue 25002: Deprecate asyncore/asynchat. Patch by Mariatta.
https://hg.python.org/cpython/rev/bb23770f82f1

New changeset 3b8dfe6f5bcb by Guido van Rossum in branch 'default':
Issue 25002: Deprecate asyncore/asynchat. Patch by Mariatta. (3.6->3.7)
https://hg.python.org/cpython/rev/3b8dfe6f5bcb

--
nosy: +python-dev

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-10-25 Thread Guido van Rossum

Guido van Rossum added the comment:

Applied:

remote: notified python-check...@python.org of incoming changeset bb23770f82f1
remote: notified python-check...@python.org of incoming changeset 3b8dfe6f5bcb

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



[issue28530] Howto detect if an object is of type os.DirEntry

2016-10-25 Thread stephan

New submission from stephan:

I have a small problem with python 3.5.2 64bit on win7 64 bit:

I cannot check if an object is of type DirEntry 
(os.DirEntry or nt.DirEntry).

Did I misunderstand something or what is wrong?

Here is a log of my console:
-
In [63]: sd = os.scandir(".")

In [64]: de = next(sd)

In [65]: type(de)
Out[65]: nt.DirEntry

In [66]: import nt

In [67]: nt.DirEntry
---
AttributeErrorTraceback (most recent call last)
 in ()
> 1 nt.DirEntry

AttributeError: module 'nt' has no attribute 'DirEntry'

In [68]: os.DirEntry
---
AttributeErrorTraceback (most recent call last)
 in ()
> 1 os.DirEntry

AttributeError: module 'os' has no attribute 'DirEntry'

In [69]:

--

--
messages: 279415
nosy: stephan
priority: normal
severity: normal
status: open
title: Howto detect if an object is of type os.DirEntry
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



[issue28029] Replace and empty strings

2016-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Interestingly, initially string.replace() was implemented in terms of 
split/join. string.replace(s, '', s2, n) returned s for any s, s2 and n.

After making replace() a method of str, in aca7b5eaf5e8 (1999-10-12), it became 
raising ValueError for empty pattern string.

Since 762dd09edb83 (issue599128, 2002-08-23) it supports zero-length pattern 
string. str.replace('', s1, s2, n) returned '' for any s1, s2 and n.

New implementation added in 41809406a35e (2006-05-25) made str.replace('', '', 
'x', -1) returning 'x' while str.replace('', '', 'x', 1) still returns ''.

As you can see, the behavior of replacing with empty pattern is not stable. It 
was changed several times. Maybe it is a time for new change.

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



[issue28529] 0 ** 0 should raise ArithmeticError

2016-10-25 Thread Tim Peters

Tim Peters added the comment:

This won't be changed - it's a near-universally mandated behavior across 
relevant standards.  Many years ago it wasn't, but Knuth changed minds when he 
wrote:

"""
We must define x^0=1 for all x, if the binomial theorem is to be valid when x=0 
, y=0 , and/or x=-y . The theorem is too important to be arbitrarily restricted!
"""

More here:

https://www.quora.com/Why-does-Python-return-1-for-pow-0-0-which-is-mathematically-wrong

--
nosy: +tim.peters
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue27495] Pretty printing sorting for set and frozenset instances

2016-10-25 Thread Steven D'Aprano

Steven D'Aprano added the comment:

There seems to be consensus that this should be treated as a bug fix, not a new 
feature. Could this still make it into 3.6 even though it missed the first beta?

--
nosy: +steven.daprano

___
Python tracker 

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



[issue28529] 0 ** 0 should raise ArithmeticError

2016-10-25 Thread Jáchym Barvínek

Jáchym Barvínek added the comment:

Sorry, It should be 0.0 ** 0 == 0 ** 0.0 == 0.0 ** 0.0 == 1.0 of course.

--

___
Python tracker 

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



[issue28529] 0 ** 0 should raise ArithmeticError

2016-10-25 Thread Jáchym Barvínek

New submission from Jáchym Barvínek:

0 ** 0 is mathematically undefined and equivalent to 0/0. 0/0 correctly raises 
ZeroDivisionError, but 0 ** 0 == 1. Also 0.0 ** 0 == 0 ** 0.0 == 0.0 ** 0.0 == 
0.0. Similarly for math.pow.

--
components: Interpreter Core
messages: 279410
nosy: Jáchym Barvínek
priority: normal
severity: normal
status: open
title: 0 ** 0 should raise ArithmeticError
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



[issue28526] Use PyUnicode_AsEncodedString instead of PyUnicode_AsEncodedObject

2016-10-25 Thread Josh Rosenberg

Josh Rosenberg added the comment:

LGTM.

--
nosy: +josh.r

___
Python tracker 

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



  1   2   >