[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Martin Panter

Martin Panter added the comment:

Removing the redundant _quote_html() function seems like a good idea to me. I 
wonder if the code should be using the html.escape(..., quote=False) option 
though, because it does not need to encode quote signs.

It might be good to add a test. It looks like there may not be anything testing 
the HTML encoding.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26560] Error in assertion in wsgiref.handlers.BaseHandler.start_response

2016-03-19 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Peter! I've simplified the test a bit and commit it.

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



[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Chris Angelico

Chris Angelico added the comment:

Sounds good to me. Replacement patch.

--
Added file: http://bugs.python.org/file42182/deco-docos.patch

___
Python tracker 

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



[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Elsewhere we use "roughly equivalent to" instead of "broadly equivalent to".  
The latter seems a little bit off the mark.

--
nosy: +rhettinger

___
Python tracker 

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



[issue26583] test_timestamp_overflow fails

2016-03-19 Thread Peter Inglesby

Peter Inglesby added the comment:

I can reproduce it reliably.

I ran ./configure with --with-pydebug.

I'm not using NFS, and I'm not aware of anything else unusual about my 
filesystem.

The fact that a timestamp overflows in the failing test is a red herring -- the 
following also fails, with os.stat raising FileNotFoundError:

def test_without_timestamp_overflow(self):
sys.path.insert(0, os.curdir)
try:
source = TESTFN + ".py"
compiled = importlib.util.cache_from_source(source)
with open(source, 'w') as f:
pass
__import__(TESTFN)
os.stat(compiled)
finally:
del sys.path[0]
remove_files(TESTFN)

I've verified that TESTFN does get imported by writing 'print("hello")' to the 
source file.

--

___
Python tracker 

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



[issue26553] Write HTTP in uppercase

2016-03-19 Thread Aatish Neupane

Changes by Aatish Neupane :


Added file: http://bugs.python.org/file42203/2_fix_3.6.patch

___
Python tracker 

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



[issue26095] Update porting HOWTO to special-case Python 2 code, not Python 3

2016-03-19 Thread Brett Cannon

Changes by Brett Cannon :


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



[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Chris Angelico

Chris Angelico added the comment:

Sure - changing it to "roughly". I started with that wording, and then changed 
to "broadly", for reasons which I now can't remember - so they can't have been 
too important. Consistency wins.

--
Added file: http://bugs.python.org/file42214/deco-docos.patch

___
Python tracker 

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



[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Martin Panter

Martin Panter added the comment:

Yeah I would be happy if you want to change to html.escape(quote=False) in 
list_directory() as well.

BTW I am getting Undelivered Mail replies from the review comments. I guess 
they might be getting rejected due to looking like spam (they tend to be 
classified as spam by default for me, something about how the server sends 
them).

--

___
Python tracker 

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2016-03-19 Thread Larry Hastings

Larry Hastings added the comment:

>Modules/_opcode.c: Issue 19674 (3.4). Only one function I can see there 
> (Larry’s original post says two sites).

I produced the post with a big grep through the codebase.  Which was quite a 
while ago now.  Code changes and moves around; if you can only find one site in 
the current file I believe you.

--

___
Python tracker 

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



[issue26580] Documentation for ftplib still references ftpmirror.py

2016-03-19 Thread Alex Walters

New submission from Alex Walters:

in #23130 ftpmirror.py was removed from the python source distribution.  The 
documentation still references this, and sends people looking for the file 
(ostensibly as an example of how to use ftplib).

--
assignee: docs@python
components: Documentation
messages: 261908
nosy: docs@python, tritium
priority: normal
severity: normal
status: open
title: Documentation for ftplib still references ftpmirror.py
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-19 Thread Jeff Allen

Jeff Allen added the comment:

Thanks for the prompt acknowledgement and for accepting this to review.

I have updated the coverage & tolerance demo program. Usage in the comments (in 
v3).

I have also added the program I used to generate the extra test cases (needs 
mpmath -- easier to get working than mpf in the original Windows/Jython 
environment).

--

___
Python tracker 

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



[issue26271] freeze.py makefile uses the wrong flags variables

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 599328247e84 by Brett Cannon in branch '3.5':
Issue #26271: Fix the Freeze tool to use variables passed in from the
https://hg.python.org/cpython/rev/599328247e84

New changeset 364895e54bb0 by Brett Cannon in branch 'default':
Merge for issue #26271
https://hg.python.org/cpython/rev/364895e54bb0

--
nosy: +python-dev

___
Python tracker 

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



[issue26538] regrtest: setup_tests() must not replace module.__path__ (_NamespacePath) with a simple list // importlib & abspath

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

I pushed my minimum fix. I now understand that it is not needed to change 
importlib, it's ok to keep "abspath" code in site & libregrtest.

--

___
Python tracker 

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



[issue26560] Error in assertion in wsgiref.handlers.BaseHandler.start_response

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 60f01a8a71ef by Berker Peksag in branch '3.5':
Issue #26560: Avoid potential ValueError in BaseHandler.start_response
https://hg.python.org/cpython/rev/60f01a8a71ef

New changeset ae1d12f09392 by Berker Peksag in branch 'default':
Issue #26560: Avoid potential ValueError in BaseHandler.start_response
https://hg.python.org/cpython/rev/ae1d12f09392

--
nosy: +python-dev

___
Python tracker 

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



[issue26556] Update expat to 2.2.1

2016-03-19 Thread Larry Hastings

Larry Hastings added the comment:

Christian: Is that CVE the same crash as reported by mail by Gustavo Grieco?

--

___
Python tracker 

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



[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Chris Angelico

New submission from Chris Angelico:

The official documentation declares an unambiguous equivalence which is not 
true in some corner cases:

@deco
def f(x): pass

is not quite the same as

def f(x): pass
f = deco(f)

as the name is never bound to the undecorated function. This is what makes 
@property and @prop.setter work; otherwise, the undecorated setter function 
would overwrite the property, and the decoration would fail. Attached patch 
loosens the wording slightly to "broadly equivalent"; this permits corner cases 
to vary from the equivalence, while still retaining its simplicity for the 99% 
of cases where it's correct. (Think of explaining "yield from iter" as "for x 
in iter: yield x" and you have a similar near-equivalence.)

Also, class decorators aren't required to return classes. Text removed saying 
that they do.

--
assignee: docs@python
components: Documentation
files: deco-docos.patch
keywords: patch
messages: 261888
nosy: Rosuav, docs@python
priority: normal
severity: normal
status: open
title: Tweak wording of decorator docos
Added file: http://bugs.python.org/file42181/deco-docos.patch

___
Python tracker 

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



[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Xiang Zhang

Xiang Zhang added the comment:

I add two tests for html escaping. One for the error message and the other for 
display name in SimpleHTTPRequesthandler.

--
Added file: http://bugs.python.org/file42204/_quote_html_to_html_escape_v2.patch

___
Python tracker 

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



[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Xiang Zhang

New submission from Xiang Zhang:

In http.server, _quote_html is used to escape content for BaseHTTPServer. The 
function has already been implemented by html.escape.

--
components: Library (Lib)
files: _quote_html_to_html_escape.patch
keywords: patch
messages: 261943
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: Use html.escape to replace _quote_html in http.server
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42195/_quote_html_to_html_escape.patch

___
Python tracker 

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



[issue26591] datetime datetime.time to datetime.time comparison does nothing

2016-03-19 Thread jason crockett

New submission from jason crockett:

if datetime.time(#blah) > datetime.time(#blah):
  [a][b]

does nothing.. it doesnt raise an error. it doesnt run the if function even 
though the printout of variables compared says it should.

22:15:00 [a]
16:00:00 [b]
True
22:20:00
16:00:00
True
22:25:00
16:00:00

--
components: Extension Modules
messages: 262027
nosy: jason crockett
priority: normal
severity: normal
status: open
title: datetime datetime.time to datetime.time comparison does nothing
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



[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages

2016-03-19 Thread Eric Snow

Eric Snow added the comment:

Also, beside namespace packages, custom loaders may run into a similar problem 
with get_filename() and probably other code in there.  It looks like the pyclbr 
module assumes that modules will be either builtin or loaded through 
SourceFileLoader.  For example, you get a similar failure for frozen modules:

  ./python Lib/pyclbr.py _frozen_importlib

--

___
Python tracker 

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



[issue24959] unittest swallows part of stack trace when raising AssertionError in a TestCase

2016-03-19 Thread Robert Collins

Robert Collins added the comment:

Yes, it is... ish.

The frame skipping code occurs when we serialise exceptions, and we pass a 
limit in. The limit is calculated on the main exception only. If the cause has 
a longer exception than the limit we calculated, you'd see this behaviour.

Probably need to make it possible to do per-exception processing of limit: I 
think via a callback or similar mechanism in traceback (because the cause might 
have thrown from some code that is also marked __unittest, so if we're 
honouring that, we should honour it within each exception.

--
title: unittest swallows par t of stack trace when raising AssertionError in a 
TestCase -> unittest swallows part of stack trace when raising AssertionError 
in a TestCase

___
Python tracker 

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



[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages

2016-03-19 Thread Eric Snow

Eric Snow added the comment:

Ah, you're talking about deleting Lib/test/__init__.py.  Doing so makes it a 
namespace package.  The loader we use for namespace packages [1] does not have 
a get_filename() method.  So the problem to solve is supporting namespace 
packages in Lib/pyclbr.py.

Regarding your patch, it's okay, but not the best option.  Using 
spec.submodule_search_locations like you are isn't ideal, but works.  However, 
you should be able to leave the is_package() call alone.

TBH, the better option is to use importlib.util.module_from_spec() instead, 
since it does the right thing for you, like setting __path__.

FWIW, I get the same as you by deleting those files and running the following:

  ./python Lib/pyclbr.py Lib/test


[1] 
https://hg.python.org/cpython/file/default/Lib/importlib/_bootstrap_external.py#l991

--
title: pyclbr.readmodule() and pyclbr.readmodule_ex() don't support packages -> 
pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages

___
Python tracker 

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



[issue22854] Documentation/implementation out of sync for IO

2016-03-19 Thread Martin Panter

Martin Panter added the comment:

Thanks for looking at this Serhiy. Here is patch v2, merged with 3.6 branch; 
some doc string changes were redundant with upstream Arg Clinic changes.

However looking at this again, I think we should be cautious changing the 
documented exceptions for the base classes, since that is changing the API. 
E.g. perhaps it would be safer to leave the exception for fileno() as OSError 
(aka IOError). It it actually causing a problem? Or the API changes should be 
reserved for 3.6 only.

--
Added file: http://bugs.python.org/file42194/UnsupportedOperation.v2.patch

___
Python tracker 

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



[issue26264] keyword module missing async and await keywords

2016-03-19 Thread Ezio Melotti

Ezio Melotti added the comment:

> Depending on the purpose of the syntax highlighting or code analysis,
> it might be better for these to be listed as keywords now, rather than
> waiting until 3.7.

I agree, especially considering that it takes time before syntax highlighters 
update their keywords list and users update their syntax highlighters.

Would this be doable, considering that the list is generated automatically?  
Are there any other downsides in doing it?

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue26553] Write HTTP in uppercase

2016-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Similar changes could be made in docstrings and comments. But changing error 
messages can be not safe and could be made only in 3.6.

--

___
Python tracker 

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-19 Thread Mark Dickinson

Mark Dickinson added the comment:

Big +1 for the idea, and thank you for doing this work. I can't promise to find 
time to do a thorough review in the near future (though I'll try).

--

___
Python tracker 

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



[issue26270] Support for read()/write()/select() on asyncio

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

> Anyway, despite the existence of streams and protocols, I still believe that 
> `asyncio.read()`, `asyncio.write()` and `asyncio.select()` would be 
> nice-to-have low-level APIs.

You can probably develop your own helper functions based on existing asyncio 
function.

I'm opposed to add such helper functions since it doesn't fit into the design 
of asyncio. Please read a little bit more about event loops and how asyncio is 
design. Don't hesitate to come back if you have something concrete, but IMHO 
this discussion should be moved to the python-tulip Google Groups rather than a 
*bug tracker*.

I close the issue.

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



[issue26553] Write HTTP in uppercase

2016-03-19 Thread Aatish Neupane

Aatish Neupane added the comment:

I have attached the patches fixing numerous case errors.

--
nosy: +aatishnn

___
Python tracker 

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



[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Chris Angelico

Chris Angelico added the comment:

I may be a committer, but I don't push to cpython - just to the peps. But sure, 
pretty little logo :)

--

___
Python tracker 

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



[issue26281] Clear sys.path_importer_cache from importlib.invalidate_caches()

2016-03-19 Thread Brett Cannon

Brett Cannon added the comment:

Eric's convinced me this isn't worth it.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue17603] AC_LIBOBJ replacement of fileblocks

2016-03-19 Thread Martin Panter

Martin Panter added the comment:

I assume that should have fixed the problem, but I have only tested it in 
roundabout ways, so it would be good to get confirmation if it helps e.g. the 
original Ming GW problem.

--
resolution:  -> fixed
status: open -> closed
versions: +Python 2.7, Python 3.6

___
Python tracker 

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



[issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 959e58cfbde9 by Victor Stinner in branch 'default':
Fix usage of PyMem_Malloc() in overlapped.c
https://hg.python.org/cpython/rev/959e58cfbde9

--

___
Python tracker 

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



[issue15660] Clarify 0 prefix for width specifier in str.format doc,

2016-03-19 Thread Eric V. Smith

Eric V. Smith added the comment:

> '''
> When no explicit alignment is given, preceding the width field by a zero 
> ('0') character enables sign-aware zero-padding for numeric types. This is 
> equivalent to a fill character of '0' with an alignment type of '='.
> '''

I think that's good.

> I presume the problem with changing the error message is that it is not 
> immediately known that alignment was set implicitly, by 0 before decimal 
> width, rather than explicitly.  If the spec string is still available, it 
> could be searched and the message adjusted if '=' is not present.  That 
> proposal should be a new issue if someone wants to push it.

Yes, that's the problem. I guess it would be easier to keep track of
which fields were set via defaults, and which explicitly. Currently,
that information is lost.

--

___
Python tracker 

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



[issue26572] urlparse does not handle passwords with ? in them.

2016-03-19 Thread Rob Church

New submission from Rob Church:

>>> urlparse('http://user:pass?w...@example.com/path?query')
ParseResult(scheme='http', netloc='user:pass', path='', params='', 
query='w...@example.com/path?query', fragment='')

Expected output is:

ParseResult(scheme='http', netloc='user:pass?w...@example.com', path='/path', 
params='', query='query', fragment='')

--
components: Library (Lib)
messages: 261860
nosy: Rob Church
priority: normal
severity: normal
status: open
title: urlparse does not handle passwords with ? in them.
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



[issue23723] Provide a way to disable bytecode staleness checks

2016-03-19 Thread Brett Cannon

Brett Cannon added the comment:

I realized that importlib.abc.SourceLoader.path_stats() provides a way to 
override stat collection and basically hard-code the stat number for all files 
from an import perspective. So if people simply generated their bytecode with a 
static timestamp and overrode this method then they would get the effect they 
want.

--
resolution:  -> out of date
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



[issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 73d8adc0d5ea by Victor Stinner in branch '3.5':
Fix usage of PyMem_Malloc() in overlapped.c
https://hg.python.org/cpython/rev/73d8adc0d5ea

--

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

> So you guarantee tracemalloc itself won't use such a hack for other
purposes? ;-)

As the defacto maintainer of the module, yes, I can guarantee that.

> FWIW, LLVM calls the "domain" "address space", and simply uses an
> integer for it (0 being the default CPU-addressable address space).  You
> can probably restrict yourself to 8-bit address spaces...

I understood that we have the CPU and GPU address spaces. Do you know other 
address spaces?

I only care of address spaces where two equal pointers point to two different 
memory blocks.

--

___
Python tracker 

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



[issue26257] Eliminate buffer_tests.py

2016-03-19 Thread Martin Panter

Martin Panter added the comment:

Yes what you say about re-arranging the methods in string_tests.py makes sense 
to me. There might also be some factorizing possible between specific methods 
in test_bytes.py and the (currently) string-only test methods. But I would like 
to handle these as separate steps, to keep the patch size under control, ensure 
we don’t lose any important test cases in the process, etc.

--

___
Python tracker 

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



[issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5b4f173f0690 by Victor Stinner in branch 'default':
faulthandler now works in non-Python threads
https://hg.python.org/cpython/rev/5b4f173f0690

New changeset d6d64168ee8c by Victor Stinner in branch 'default':
Py_FatalError: disable faulthandler earlier
https://hg.python.org/cpython/rev/d6d64168ee8c

--

___
Python tracker 

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



[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Martin Panter

Changes by Martin Panter :


--
stage:  -> patch review

___
Python tracker 

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



[issue3539] Problem with testembed make dependencies in certain circumstances

2016-03-19 Thread Martin Panter

Martin Panter added the comment:

The fault still exists for me with the pgen objects. The makefile has changed a 
few times about automatically compiling pgen (Issue 22359) or not (Issue 
14321), so it would depend which version is tested.

I’m not an expert on VPATH, but it seems like it would be a awkward working 
around this problem (e.g. adding absolute paths do all the object file names or 
something). I propose to just close this. Issue 1613 added a note to the Python 
2 README, and Python 3’s README says:

[Building from a subdirectory] will fail if you *also* built at the top-level 
directory. You should do a "make clean" at the toplevel first.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Xiang Zhang

Xiang Zhang added the comment:

It's BaseHTTPRequestHandler, not BaseHTTPServer.

--

___
Python tracker 

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



[issue15660] Clarify 0 prefix for width specifier in str.format doc,

2016-03-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This came up again on python-list today in thread "Replace weird error 
message?" by "the.gerenuk--- via Python-list".  After reading the discussion, I 
decided that expecting someone to read and connect together two sentences half 
a page apart is expecting a bit too much.

'''
'=' Forces the padding to be placed after the sign (if any) but before the 
digits. This is used for printing fields in the form ‘+00120’. This 
alignment option is only valid for numeric types.
'''

Add "It becomes the default when '0' precedes the field width."

''' 
Preceding the width field by a zero ('0') character enables sign-aware 
zero-padding for numeric types. This is equivalent to a fill character of '0' 
with an alignment type of '='.
'''

This is not true when an explicit alignment other than '=' is given.
>>> "{:09}".format(-1)
'-0001'
>>> "{:>09}".format(-1)  # 2.7.11 and 3.5.1
'000-1'

Proposal: Replace with
'''
When no explicit alignment is given, preceding the width field by a zero ('0') 
character enables sign-aware zero-padding for numeric types. This is equivalent 
to a fill character of '0' with an alignment type of '='.
'''

I presume the problem with changing the error message is that it is not 
immediately known that alignment was set implicitly, by 0 before decimal width, 
rather than explicitly.  If the spec string is still available, it could be 
searched and the message adjusted if '=' is not present.  That proposal should 
be a new issue if someone wants to push it.

--
resolution: fixed -> 
stage: resolved -> patch review
status: closed -> open
versions: +Python 3.5, Python 3.6 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-19 Thread Jeff Allen

Changes by Jeff Allen :


Removed file: http://bugs.python.org/file41526/stat_math.py

___
Python tracker 

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



[issue26579] Support pickling slots in subclasses of common classes

2016-03-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Pickling and copying instances of subclasses of some basic classes pickles and 
copies instance attributes. Example:

>>> class BA(bytearray):
... pass
... 
>>> b = BA(b'abc')
>>> b.x = 10
>>> c = copy.copy(b)
>>> c.x
10
>>> c = pickle.loads(pickle.dumps(b))
>>> c.x
10

But this doesn't work if attributes are saved not in instance dictionary, but 
in slots.

>>> class BA(bytearray):
... __slots__ = ('x',)
... 
>>> b = BA(b'abc')
>>> b.x = 10
>>> c = copy.copy(b)
>>> c.x
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: x
>>> c = pickle.loads(pickle.dumps(b))
>>> c.x
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: x

Since using __slots__ is implementation detail, this failure can be considered 
as a bug.

Proposed patch adds support of pickling and copying slots in subclasses of all 
classes that already support pickling and copying non-slot attributes. It is 
backward compatible, classes with slots can be unpickled on older Python 
versions without slots. Affected classes: bytearray, set, frozenset, 
weakref.WeakSet, collections.OrderedDict, collections.deque, datetime.tzinfo.

The patch adds the copyreg._getstate() function for Python classes and exposes 
the _PyObject_GetState() function for extension classes. An alternative (and 
simpler for end user) solution would be to add default implementation as 
object.__getstate__(). But this is not easy to reject non-pickleable classes 
(issue22995) in this case, since __getstate__ is looked up as instance 
attribute, not as other special methods.

--
components: Extension Modules, Library (Lib)
files: copyreg_getstate.patch
keywords: patch
messages: 261903
nosy: alexandre.vassalotti, pitrou, rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Support pickling slots in subclasses of common classes
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42183/copyreg_getstate.patch

___
Python tracker 

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



[issue13601] sys.stderr should always be line-buffered

2016-03-19 Thread Nick Coghlan

Nick Coghlan added the comment:

Changing the target version and summarising my understanding of the status quo:

"python3": sys.stderr is line buffered at both the TextIOWrapper layer and may 
be fully buffered at the binary BufferedWriter layer if the output is 
redirected to a file
"python3 -u": the BufferedWriter layer is omitted entirely, leaving only the 
line buffering at the TextIOWrapper layer

Looking at http://pubs.opengroup.org/onlinepubs/9699919799/functions/stdin.html 
(which also covers stdout and stderr), it specifically says about stderr: "When 
opened, the standard error stream is not fully buffered;".

That means either line buffering or no buffering is considered acceptable, but 
full buffering is not.

So, at the very least, it seems to me that the way we configure stderr should 
be the same regardless of whether or not "-u" is used: omit the BufferedWriter 
layer.

Given that POSIX allows compliant implementations to use line-buffering on 
stderr, the "missing trailing newline and no implicit flush() is ever 
triggered" scenario is probably obscure enough not to worry about.

--
versions: +Python 3.6 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue10721] Remove HTTP 0.9 server support

2016-03-19 Thread Martin Panter

Martin Panter added the comment:

Does this need any deprecation cycle, or can we just remove everything 
immediately in 3.6?

I suspect that the HTTP 0.9 support never properly worked, but I don’t have 
enough info to be sure. Wouldn’t a HTTP 0.9 request send b"GET \r\n" with 
a single line, and then wait for a response? If so, Python’s server hangs 
waiting for a second blank line (or EOF), so the protocol will deadlock.

In any case, I would be in favour of removing HTTP 0.9 support. Senthil: do you 
know of actual clients that do HTTP 0.9 requests?

I left a review comment. The patch will also need manual merging with current 
code.

--
nosy: +martin.panter
versions: +Python 3.6 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-19 Thread Jeff Allen

Changes by Jeff Allen :


Added file: http://bugs.python.org/file42192/stat_math.py

___
Python tracker 

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



[issue26577] inspect.getclosurevars returns incorrect variable when using class member with the same name as other variable

2016-03-19 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +yselivanov
type:  -> behavior
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



[issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

Reopen. I found and fixed two bugs in os and _overlapped modules (_overlapped 
is used by asyncio on Windows).

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

___
Python tracker 

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



[issue19450] Bug in sqlite in Windows binaries

2016-03-19 Thread Steve Dower

Steve Dower added the comment:

Done. The test_sqlite tests were fine, but that's all I checked.

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



[issue26248] Improve scandir DirEntry docs, especially re symlinks and caching

2016-03-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage:  -> resolved
type:  -> enhancement

___
Python tracker 

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



[issue26582] asyncio documentation links to wrong CancelledError

2016-03-19 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



[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 691fba640266 by Victor Stinner in branch 'default':
Issue #26567: enhance ResourceWarning example
https://hg.python.org/cpython/rev/691fba640266

--

___
Python tracker 

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



[issue13601] sys.stderr should be line-buffered when stderr is not a TTY

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

I changed the title, since sys.stderr is already line-buffered when stderr is a 
TTY.

--

___
Python tracker 

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



[issue25643] Python tokenizer rewriting

2016-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Double coding cookie

___
Python tracker 

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



[issue25934] ICC compiler: ICC treats denormal floating point numbers as 0.0

2016-03-19 Thread Zachary Ware

Zachary Ware added the comment:

I closed this prematurely: I successfully added /fp:strict to ICC builds, but 
it didn't fix the underlying issue.

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

___
Python tracker 

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



[issue19450] Bug in sqlite in Windows binaries

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fa68df1d5e65 by Steve Dower in branch '2.7':
Issue #19450: Update Windows builds to use SQLite 3.8.11.0.
https://hg.python.org/cpython/rev/fa68df1d5e65

--

___
Python tracker 

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



[issue26590] socket destructor: implement finalizer

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

It's unclear to me if it's needed to call the following code in sock_dealloc():

+if (PyObject_CallFinalizerFromDealloc((PyObject *)s) < 0)
+return;

It looks like this code is not needed, since sock_finalize() is called before 
sock_dealloc().

--

___
Python tracker 

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



[issue26590] socket destructor: implement finalizer

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

Attached patch adds a finalizer to _socket.socket() and use 
PyErr_ResourceWarning() to log the traceback where the socket was created in 
the warning logger (if tracemalloc is enabled, see issue #26567).

--
keywords: +patch
Added file: http://bugs.python.org/file42215/sock_finalize.patch

___
Python tracker 

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



[issue18787] Misleading error from getspnam function of spwd module

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a1d738158390 by Berker Peksag in branch 'default':
Issue #18787: spwd.getspnam() now raises a PermissionError if the user
https://hg.python.org/cpython/rev/a1d738158390

--
nosy: +python-dev

___
Python tracker 

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



[issue26257] Eliminate buffer_tests.py

2016-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I meant that the patch can be smaller if move more tests from CommonTest to 
BaseTest without changing order. Here is smaller patch.

--
Added file: http://bugs.python.org/file42216/buffer_tests_2.patch

___
Python tracker 

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



[issue18787] Misleading error from getspnam function of spwd module

2016-03-19 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue26590] socket destructor: implement finalizer

2016-03-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

sock_finalize() is only called explicitly if there is a reference cycle. This 
is why sock_dealloc() has to call it.

--

___
Python tracker 

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



[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 543639cdfdb9 by Victor Stinner in branch 'default':
Try again to fix test_warnings on Windows
https://hg.python.org/cpython/rev/543639cdfdb9

--

___
Python tracker 

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2016-03-19 Thread Tal Einat

Tal Einat added the comment:

My patches haven't been looked at for a while, anyone considering them should 
make sure they still apply cleanly and don't break anything. Here their status 
as far as I can tell:

Quite a bit of work went into Modules/_operator.c, and it got an "LGTM" from 
Serhiy, so it should probably go in after a quick check.

Modules/mathmodule.c was also in a good state when I left it, and it underwent 
some review from Serhiy whose comments were implemented. It should probably be 
good to go after a thorough review.

Objects/enumobject.c is simpler but requires review.

--

___
Python tracker 

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



[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-03-19 Thread Stefan Behnel

Stefan Behnel added the comment:

Nice one. While reimplementing it for Cython, I noticed that the grammar 
described in the PEP isn't exactly as it's implemented, though. The grammar says

digit (["_"] digit)*

whereas the latest patch (v4) says

`digit` (`digit` | "_")*

and also implements it that way. The former doesn't allow underscores at the 
end of a literal.

And the regexes in tokenize.py seem happy to accept "0x___", for example. Is 
that intended?

--
nosy: +scoder

___
Python tracker 

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



[issue26582] asyncio documentation links to wrong CancelledError

2016-03-19 Thread awilfox

New submission from awilfox:

In the 3.5 and 3.6a0 documentation for asyncio, "CancelledError" is linked to 
the concurrent.futures.CancelledError.  This led me to try catching that 
exception and finding that it did not work correctly at all.  Only after 
searching for asyncio example code and seeing how other people caught 
asyncio.CancelledError did I realise the issue.

The fact asyncio.CancelledError even exists isn't actually documented, and I 
believe that is why the :exc: reference is linking to the wrong module.

--
assignee: docs@python
components: Documentation
messages: 261911
nosy: awilfox, docs@python
priority: normal
severity: normal
status: open
title: asyncio documentation links to wrong CancelledError
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

Nathaniel Smith:
> So PyMem_Malloc would just call PyMem_RecordAlloc("heap", ptr, size) (or act 
> equivalently to something that called that, etc.), but something like PyCuda 
> might do PyMem_RecordAlloc("gpu", ptr, size) to track allocations in GPU 
> memory.

If I change tracemalloc, it's not to fullfit numpy requirements, it must remain 
very generic. *If* we add something, I see 3 choices:

* add a C int to trace_t
* add a C char* to trace_t
* add a C void* to trace_t

int uses 2x less memory than char* or void* on 64-bit systems.

The problem of void* is to find a way to expose it in Python. An option is not 
ignore it in the Python API, and only provide a C API to retrieve traces with 
the extra info.

void* allows to implement the rejected option of also storing the C filename an 
C line number:
https://www.python.org/dev/peps/pep-0445/#pass-the-c-filename-and-line-number

When I designed the PEP 445 (malloc API) an PEP 454 (tracemalloc), I recall 
that it was proposed to add "colors" (red, blue, etc.) to memory allocations. 
It sounds similar do you "heap" and "gpu" use case. It's just that you use an 
integer rather than a string.

Anyway, extending tracemalloc is non-trivial, we have to investigate use cases 
to design the new API. I would prefer to move step by step, an begin with 
exposing existing API. What do you think?


> All the tracing stuff in tracemalloc would be awesome to have for GPU 
> allocations, and it would hardly require any changes to enable it. Ditto for 
> other leakable resources like file descriptors or shmem segments.

FYI I opened an issue to use tracemalloc when logging ResourceWarning:
http://bugs.python.org/issue26567


> I think the extra footprint would be tiny?

In my experience, tracemalloc footprint is large. Basically, it doubles the 
total memory footprint. So adding 4 or 8 bytes to a trace which currently takes 
16 bytes is not negligible!

Maybe we can be smart and use compact trace when extra info is not stored 
(current trace_t) and switch to "extended" trace (trace_t + int/char*/void*) 
when the extended API is used? It requires to convert all existing traces from 
the compact to the extende format. It doesn't look too complex to support two 
formats, expecially if the extended format is based on the compact format 
(trace_t structure used in extended_trace_t structure).


> Logically, you'd index traces by (domain, pointer) instead of (pointer)

It's not how tracemalloc is designed. _tracemalloc has a simple design. It's a 
simple hashtable: pointer => trace. The Python module tracemalloc.py is 
responsible to group traces:
https://docs.python.org/dev/library/tracemalloc.html#tracemalloc.Snapshot.statistics

The design is to have a simple and efficient _tracemalloc module, an off-load 
statistics later. It allows to capture traces on a small and slow device, and 
then analyze data on a fast compuer with more memory (ex: transfer data by 
network). The idea is also to limit the overhead of using _tracemalloc.

Moreover, your proposed structure looks specific to your use case. I'm not sure 
that you always want to group by the domain. If domain is a C traceback 
(filename, line number), you probably don't want to group by traceback, but 
group by C filename for example.

--

___
Python tracker 

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



[issue26568] Add a new warnings.showwarnmsg() function taking a warnings.WarningMessage object

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9c92352324e8 by Victor Stinner in branch 'default':
Fix test_logging
https://hg.python.org/cpython/rev/9c92352324e8

--

___
Python tracker 

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



[issue26313] ssl.py _load_windows_store_certs fails if windows cert store is empty

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8df52636b0dc by Steve Dower in branch '2.7':
Issue #26313: ssl.py _load_windows_store_certs fails if windows cert store is 
empty. Patch by Baji.
https://hg.python.org/cpython/rev/8df52636b0dc

--
nosy: +python-dev

___
Python tracker 

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



[issue26583] test_timestamp_overflow fails

2016-03-19 Thread Peter Inglesby

Peter Inglesby added the comment:

The problem is that I have PYTHONDONTWRITEBYTECODE set in my environment.

Should the setUp and tearDown methods ensure that PYTHONDONTWRITEBYTECODE is 
cleared and reset?

--

___
Python tracker 

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



[issue26573] Method Parameters can be Accepted as Keyword Arguments?

2016-03-19 Thread G Young

G Young added the comment:

Google indicates that this is indeed a feature of the language. Sorry about 
that! I guess that was a miscommunication on the PR-end.

--
status: open -> closed

___
Python tracker 

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



[issue26258] readline module for python 3.x on windows

2016-03-19 Thread Ezio Melotti

Ezio Melotti added the comment:

I'm going to close this, but you can try bringing this up on python-list or 
python-ideas to see if there's any existing solution that could perhaps be 
included in Python.

--
nosy: +ezio.melotti
resolution:  -> postponed
stage:  -> resolved
status: open -> closed
type:  -> enhancement
versions: +Python 3.6

___
Python tracker 

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



[issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's

2016-03-19 Thread Wolfgang Langner

New submission from Wolfgang Langner:

In site.py there is the internal function _init_pathinfo() This function builds 
a set of path entries from sys.path. This is used to avoid duplicate entries in 
sys.path.
But this function has a check if it is a directory with os.path.isdir(...). All 
this is fine as long as someone has a .zip file in sys.path or a zipfile 
subpath. Then the path entry is not part of the set. With this duplicate 
detection with none directories does not work.

The fix is as simple as removing the os.path.isdir(...) line and fixing the 
indent. Also the docstring should be modified.

Detected by using this function in a project reusing addsitedir(...) 
functionality to add another path with .pth processing.

--
components: Library (Lib)
messages: 261958
nosy: tds333
priority: normal
severity: normal
status: open
title: Possible duplicate entries in sys.path if .pth files are used with zip's
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-03-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

A n-GPU system will have n+1 address spaces. Such systems exist in 
high-performance computing.

You can also probably find weird systems (embedded, mostly, I'd say) with more 
than two address spaces.

--

___
Python tracker 

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



[issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9

2016-03-19 Thread Xiang Zhang

New submission from Xiang Zhang:

BaseHTTPRequestHandler in http.server supports HTTP/0.9. But the response for 
HTTP/0.9 request is implemented wrong. 

Response of HTTP/0.9 request returns message body directly without status line 
and headers. But if you inherit BaseHTTPRequestHandler and set the 
default_request_version to "HTTP/1.x", then self.request_version can never be 
"HTTP/0.9" since in the 
https://hg.python.org/cpython/file/tip/Lib/http/server.py#l315 branch it does 
not set version to "HTTP/0.9" and then always sends the status line and headers 
back.

A trivial patch can fix this problem that set version to "HTTP/0.9" in the 
branch. But this will cause some failure in tests. The tests in 
test_httpservers use http.client.HTTPConnection to send and receive HTTP 
message. But since 3.4, HTTPConnection doesn't support HTTP/0.9-style simple 
responses. We can use it to test HTTP/0.9 connection if the server is 
implemented in the right way.

And since http.client.HTTPConnection has dropped the support for HTTP/0.9, is 
it reasonable to drop the support in http.server too?

--
components: Library (Lib)
messages: 261898
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: Bad BaseHTTPRequestHandler response when using HTTP/0.9
versions: Python 3.6

___
Python tracker 

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



[issue19265] Increased test coverage for datetime pickling

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c6649d4477ab by Berker Peksag in branch '3.5':
Issue #19265: Improve test coverage of datetime.tzinfo
https://hg.python.org/cpython/rev/c6649d4477ab

New changeset f1539e7607e4 by Berker Peksag in branch 'default':
Issue #19265: Improve test coverage of datetime.tzinfo
https://hg.python.org/cpython/rev/f1539e7607e4

--
nosy: +python-dev

___
Python tracker 

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



[issue19265] Increased test coverage for datetime pickling

2016-03-19 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Colin!

--
nosy: +berker.peksag
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.5, Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26574] replace_interleave can be optimized for single character byte strings

2016-03-19 Thread Josh Snider

Josh Snider added the comment:

Addresses review comments.

--
Added file: http://bugs.python.org/file42180/bytes-2.patch

___
Python tracker 

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



[issue26554] Missing fclose

2016-03-19 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +easy

___
Python tracker 

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



[issue26583] test_timestamp_overflow of test_importlib fails if PYTHONDONTWRITEBYTECODE is set

2016-03-19 Thread Brett Cannon

Brett Cannon added the comment:

LGTM, Ned.

--
assignee:  -> larry
nosy: +larry
stage: patch review -> commit review

___
Python tracker 

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



[issue26580] Documentation for ftplib still references ftpmirror.py

2016-03-19 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
nosy: +berker.peksag
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 2.7, Python 3.2, 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



[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Xiang Zhang

Xiang Zhang added the comment:

OK. You left the comment preferring using ascii or utf-8 to encode the filename 
in test. But actually the response SimpeHTTPRequestHandler send is explicitly 
encoded in filesystemdefaultencoding. So in such a case, am I doing right?

--

___
Python tracker 

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



[issue26560] Error in assertion in wsgiref.handlers.BaseHandler.start_response

2016-03-19 Thread Peter Inglesby

Peter Inglesby added the comment:

I found it while reading the source.  Patch attached.

--
keywords: +patch
Added file: http://bugs.python.org/file42188/issue26560.patch

___
Python tracker 

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



[issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument

2016-03-19 Thread Alexander Mohr

Alexander Mohr added the comment:

any chance if this getting into 3.5.2? I have some gross code to get around it 
(setting global properties)

--
nosy: +thehesiod

___
Python tracker 

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



[issue17605] mingw-meta: build interpeter core

2016-03-19 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +mingw: detect REPARSE_DATA_BUFFER

___
Python tracker 

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



[issue24959] unittest swallows par t of stack trace when raising AssertionError in a TestCase

2016-03-19 Thread Robert Collins

Robert Collins added the comment:

I'm fairly sure its eating the stack frames because the calling frames are 
annotated __unittest__ - its technically a feature :/.

--
title: unittest swallows part of stack trace when raising AssertionError in a 
TestCase -> unittest swallows par t of stack trace when raising AssertionError 
in a TestCase

___
Python tracker 

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



[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

> However, you should be able to leave the is_package() call alone.

I don't really care how the issue is fixed. As I wrote, I don't know well the 
importlib module. Feel free to propose a better patch :-) My main concern is to 
fix test_pyclbr when test becomes a namespace.

--

___
Python tracker 

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



[issue26546] Provide translated french translation on docs.python.org

2016-03-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I agree on the url.  It can always redirect to a CCTLD if there is one.

You *might* want to discuss the how on python-ideas list.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue26538] regrtest: setup_tests() must not replace module.__path__ (_NamespacePath) with a simple list // importlib & abspath

2016-03-19 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



[issue19265] Increased test coverage for datetime pickling

2016-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

These lines should be removed again after applying the patch for issue26579.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26271] freeze.py makefile uses the wrong flags variables

2016-03-19 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the patch, Daniel! Added you to the ACKS file.

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



[issue26583] test_timestamp_overflow of test_importlib fails if PYTHONDONTWRITEBYTECODE is set

2016-03-19 Thread Ned Deily

Ned Deily added the comment:

Pushed for release in 3.5.2 and 3.6.0.

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



[issue26579] Support pickling slots in subclasses of common classes

2016-03-19 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-03-19 Thread Georg Brandl

Georg Brandl added the comment:

The last patch isn't up to date with the PEP; Serhiy's patch is the closest one.

--

___
Python tracker 

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



[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Xiang Zhang

Xiang Zhang added the comment:

Oops. You have already left new comment. No notify either. :(

I like the idea that extract the actual encoding from response header. I will 
update my patch then.

--

___
Python tracker 

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



[issue25609] Add a ContextManager ABC and type

2016-03-19 Thread Nick Coghlan

Nick Coghlan added the comment:

* the ABC should have a structural __issubclass__ check looking for __enter__ 
and __exit__ methods

* I agree with making __exit__ abstract (if you don't define it, you don't need 
a context manager), but does __enter__ need to be abstract? The "return self" 
default is a good one in many cases where the resource is acquired in __new__ 
or __init__.

* the docs for the ABC are potentially confusing, as they describe what the 
default implementation does, without making it clear that it's only the default 
implementation and *permitted* return behaviour is more flexible than that.

* I'd prefer not to have contextlib depend on typing, so the generic type 
definition should probably be in the typing module (similar to the abc-vs-type 
split for collections). That should also make backporting easier - the ABC can 
go back via contextlib2, while the generic type can go back via the 
comment-based typehinting variant

--

___
Python tracker 

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



[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages

2016-03-19 Thread Eric Snow

Eric Snow added the comment:

Well, your patch is correct even if not ideal. :)  Landing it as a short-term 
solution is fine.  Just keep this issue open so we can address the problem more 
completely later.

--
components: +Interpreter Core
stage:  -> commit review
type:  -> behavior

___
Python tracker 

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



  1   2   >