[issue25563] Windows 10 Tkinter startup problem

2015-11-06 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: Windows 10 IDLE / Tkinter startup problem -> Windows 10 Tkinter startup 
problem

___
Python tracker 

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



[issue25336] Segmentation fault on Mavericks consistent crashing of software

2015-11-06 Thread ppperry

Changes by ppperry :


--
title: Segmentation fault on Mavericks consistent crashing of software: Please 
HELP! -> Segmentation fault on Mavericks consistent crashing of software

___
Python tracker 

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



[issue25538] Traceback from __exit__ method is misleading

2015-11-06 Thread Martin Panter

Martin Panter added the comment:

Explanation of my example because it is tricky: The print is actually executed. 
Then the context manager exits, and the built-in buffered file object tries to 
flush its buffer and fails. The earlier write() call succeeds, because it only 
writes to the Python buffer, not the OS file descriptor.

--

___
Python tracker 

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



[issue25563] Windows 10: _tkinter import fails

2015-11-06 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: Windows 10 Tkinter startup problem -> Windows 10: _tkinter import fails

___
Python tracker 

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



[issue25545] email parsing docs: clarify that only ASCII strings are supported

2015-11-06 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: email parsing docs need to be clear that only ASCII strings are 
supported -> email parsing docs: clarify that only ASCII strings are supported

___
Python tracker 

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



[issue25534] SimpleHTTPServer throwed an exception due to negtive st_mtime attr in file

2015-11-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Does this affect 3.x also?  I would expect that it does.

The question for this issue is whether the program should stop on a gmtime 
error and say "I will not serve this file until you fix the modification time." 
or whether it should catch and workaround the problem and merely warn about the 
mtime.

For the latter, BaseHTTPServer could catch the gmtime error and use the current 
time instead.  Or SimpleHTTPServer could catch the exception and omit the Last 
Modified: header, if that is allowed.  I believe the purpose of this header is 
for caching, and the current time would say to replace any cached value.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-11-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Ryan, please sign the PSF Contributor Agreement
https://www.python.org/psf/contrib/
https://www.python.org/psf/contrib/contrib-form/

Also, when replying by email, please delete the previous message, except 
possibly for quoting a line or two.  When listed on the web page, big 
quotations are useless noise.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue25534] SimpleHTTPServer throwed an exception due to negtive st_mtime attr in file

2015-11-06 Thread Martin Panter

Martin Panter added the comment:

I assume it affects Python 3, though I suspect the exception is OSError, not 
ValueError. But it would be good if someone with Windows (or other affected OS) 
could confirm.

I think the server should serve the file, with just a best-effort attempt to 
serve the timestamp. Some other options:

* Maybe using datetime rather than the OS’s gmtime() would be more reliable
* Omit the Last-Modified header if the timestamp cannot be represented
* Make time.gmtime() more platform-independent (probably against the original 
spirit of the module)

I don’t think setting Last-Modified to the current time is a particularly good 
idea. I guess omitting the field would have a similar effect on caching, 
without actually serving a misleading value.

--
versions: +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



[issue25574] 2.7 incorrectly documents objects hash as equal to id

2015-11-06 Thread wim glenn

New submission from wim glenn:

The 2.7 glossary still incorrectly mentions instances of user-defined classes 
hash equal to their id.  
https://docs.python.org/2/glossary.html#term-hashable

Just a minor documentation bug that was unfortunately missed by 
http://bugs.python.org/issue21782

--
assignee: docs@python
components: Documentation
files: mywork.patch
keywords: patch
messages: 254237
nosy: docs@python, wim.glenn
priority: normal
severity: normal
status: open
title: 2.7 incorrectly documents objects hash as equal to id
versions: Python 2.7
Added file: http://bugs.python.org/file40966/mywork.patch

___
Python tracker 

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



[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

2015-11-06 Thread Martin Panter

Martin Panter added the comment:

This change is a result of parameter checking added in Issue 22928. The colon 
is not meant to be part of a field name. This is what the request being sent by 
your example looks like in the unpatched 3.4. (I changed to localhost.) Your 
attempt to override the default Content-Type is not working due to the colon:

POST /xrbl82xr HTTP/1.1
Accept-Encoding: identity
Content-Type: application/x-www-form-urlencoded
Host: localhost
User-Agent: Python-urllib/3.4
Content-Length: 21
Content-Type:: application/x-www-form-urlencoded;charset=utf-8
Connection: close

spam=1=2=0

So I don’t think this is a valid bug or regression. What gave you the idea to 
include the colon? Does the documentation need clarifying?

Also, I would recommend not trying to set a “charset” attribute with the 
form-urlencoded content type in general. It is not standardized, and I proposed 
to remove the recommendation from the documentation in Issue 23360 (feedback 
welcome). If you really need to send non-ASCII data, you might be able to get 
away with UTF-8 by default. Also, HTML 5 mentions a _charset_ field, and there 
is the multipart/form-data content type.

--
nosy: +martin.panter
stage: needs patch -> 
type: crash -> behavior

___
Python tracker 

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



[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

2015-11-06 Thread Martin Panter

Martin Panter added the comment:

Sorry, it seems I missed some updates to this bug.

I think the docs have enough big red warning boxes. But an explanation or short 
example might be good.

--
stage:  -> needs patch

___
Python tracker 

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



[issue25543] locale.atof keep '.' even if not part of the localeconv

2015-11-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I much prefer a new argument, 'strict=False', to a new, near-duplicate function.

locale.atof('2.500,5') should raise.  The only question is what should be 
displayed as the invalid literal: the original or the converted.  It seems to 
me that delocalize should replace the local thousands separator, in this case 
'.', with ',' as it replaces the local decimal point with '.'.  Then the 
invalid literal would be '1,234.5'.  And locale.atof('1.5') would become 
float('1,5'), which would raise.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue25541] Wrong usage of sockaddr_un struct for abstract namespace unix sockets

2015-11-06 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +pitrou

___
Python tracker 

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



[issue25575] idle not working

2015-11-06 Thread G

New submission from G:

I'm teaching Python in a computer lab with 28, new this Sept., Mac Minis. 
One of the machines will run from the command line in Terminal but will not run 
using IDLE. I'm using the turtle module for graphics. I've attached a screen 
snap of the code and error message. The top part of the image shows error 
message using IDLE. The bottom part of the image shows the same code runs from 
the command line. I just updated the OS to OSX 11.11.1 and it still did not fix 
the issue. 
Any ideas on how to fix it?

--
components: IDLE
files: Python idle problem.png
messages: 254242
nosy: ccgm
priority: normal
severity: normal
status: open
title: idle not working
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file40967/Python idle problem.png

___
Python tracker 

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



[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

2015-11-06 Thread Martin Panter

Martin Panter added the comment:

Ah, I think I see where you are coming from. I guess you aren’t intimately 
familiar with the HTTP protocol. There are various types of “headers” aka 
header fields, not only User-Agent, but Content-Type and others. When they 
suggest passing a User-Agent header, that actually means a call like

request.add_header("User-Agent", "custom text here")

using the exact string "User-Agent" as the field name (key).

If you can given a specific comment line to add to a specific example, that 
might be useful. Even if you aren’t 100% sure of the details :)

--

___
Python tracker 

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



[issue25538] Traceback from __exit__ method is misleading

2015-11-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

In Martin's example, I would expect the first line of the traceback to be the 
file write that raised the exception, not the print that is never executed.  If 
print were writing to a different device than the first line, the traceback 
would be positively misleading.  

In David's example, the print executed just fine, so it should not appear in 
the traceback either.  The replacement, if any, might be the with statement 
itself.  The 'pseudo-line' that triggers the __exit__ call is really the dedent 
on the next line, but printing the whole next line would be wrong too.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue25064] Adjust tempfile documentation for bytes filename support

2015-11-06 Thread Martin Panter

Changes by Martin Panter :


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



[issue25569] Memory leak in SSLSocket.getpeercert()

2015-11-06 Thread Alex Gaynor

Alex Gaynor added the comment:

Tests pass and the original script runs without a leak using this patch. It 
could probably be shorter if we converted from local returns to `goto fail` or 
something, but I don't really have an opinion.

--

___
Python tracker 

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



[issue25538] Traceback from __exit__ method is misleading

2015-11-06 Thread R. David Murray

R. David Murray added the comment:

Yes, I think the line that should be in the traceback in my example is the 
'with' line.  I have no clue how hard that would be to achieve.

--

___
Python tracker 

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



[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

2015-11-06 Thread Christian Rickert

Christian Rickert added the comment:

>>So I don’t think this is a valid bug or regression. What gave you the idea to 
>>include the colon?

"We ask that if you are going to consume the API that you pass a custom 
User-Agent header along with your requests. The User-Agent should primarily 
include information on how we can contact you, but it is also a good idea to 
include your application name and version."
[https://eveonline-third-party-documentation.readthedocs.org/en/latest/xmlapi/intro/#other-information]

This is why I created custom User-Agent headers:
.add_header("Contact: ","me")
.add_header("Software: ","sw")
.add_header("Version: ","0.1")
I didn't really need the colons, it just worked.


>>Does the documentation need clarifying?

In the description for "headers" in the "class urllib.request.Request" section, 
Mozilla's string is given as an example:
"Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11"
Including slashes, semicolons, and braces, I didn't think I would run into 
problems with using a colon (in the first parameter string).

>>Also, I would recommend not trying to set a “charset” attribute with the 
>>form-urlencoded content type in general. It is not standardized, and I 
>>proposed to remove the recommendation from the documentation in Issue 23360 
>>(feedback welcome).

I agree. The examples provided should be good (standard-conform) examples.


>>I think the docs have enough big red warning boxes. But an explanation or 
>>short example might be good.
Maybe a comment line in the examples?

--

___
Python tracker 

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



[issue25064] Adjust tempfile documentation for bytes filename support

2015-11-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset de79e483565c by Martin Panter in branch '3.5':
Issue #25064: Adjust documentation according to new mkstemp signature
https://hg.python.org/cpython/rev/de79e483565c

New changeset c495c9dd7726 by Martin Panter in branch 'default':
Issue #25064: Merge tempfile doc from 3.5
https://hg.python.org/cpython/rev/c495c9dd7726

--
nosy: +python-dev

___
Python tracker 

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



[issue21224] BaseHTTPRequestHandler, update the protocol version to http 1.1 by default?

2015-11-06 Thread Martin Panter

Martin Panter added the comment:

There is already Issue 23794 discussing HTTP 2. IMO it would be interesting to 
implement, but I’m not sure how appropriate it would be in Python’s standard 
library at this stage. But working on it could drive other improvements in the 
existing HTTP stuff, as Demian hinted.

What do you mean by supporting HTTP 1.1 in the future? The basic support is 
already there; you just have to manually enable it. Maybe there is scope for 
making 1.1 easier to use, perhaps with a BaseHTTP11RequestHandler (shorter: 
Http11Handler) class or something.

--

___
Python tracker 

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



[issue18010] pydoc search chokes on import errors

2015-11-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1ab20d3c9dc6 by Martin Panter in branch '2.7':
Issue #18010: Fix pydoc GUI search to handle package exceptions
https://hg.python.org/cpython/rev/1ab20d3c9dc6

--

___
Python tracker 

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



[issue25575] idle not working

2015-11-06 Thread Zachary Ware

Zachary Ware added the comment:

Check the traceback carefully, it shows exactly where the problem is, though 
it's not immediately obvious until it's bitten you a time or two. You are 
running /Users/a5/Desktop/z.py which imports turtle, but you have a turtle.py 
in /Users/a5/Desktop which is found before the standard library turtle. Your 
command line test works because it is run from a different directory.  Just 
remove or rename /Users/a5/Desktop/turtle.py and it will work.

There have been other reports about this lately, and there are on-going 
discussions about what can be done to try to prevent this situation.

--
nosy: +zach.ware
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



[issue23360] Content-Type when sending data with urlopen()

2015-11-06 Thread Martin Panter

Martin Panter added the comment:

Patch 4 is just updated to avoid conflicts with the current code. Changes are 
the same.

--
versions: +Python 3.6
Added file: http://bugs.python.org/file40968/non-urlencoded.4.patch

___
Python tracker 

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



[issue24802] int and float constructing from non NUL-terminated buffer

2015-11-06 Thread Martin Panter

Martin Panter added the comment:

I have committed changes to Python 3. The compile() test now exists as 
test_compile.TestSpecifics.test_null_terminated.

Serhiy: You set these bugs for Python 2 as well. Is there a way to produce a 
non-null-terminated buffer in Python 2 to help verify this? Both John’s 
original array() tests and the memoryview() tests don’t seem to be supported by 
Python 2’s idea of buffer objects:

>>> float(array.array("B",b"A"*0x10))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: float() argument must be a string or a number
>>> float(memoryview(b"1234")[1:-1])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: float() argument must be a string or a number

I have a half-ported patch for Python 2, but it would be nice to know (a) if it 
is actually needed, and (b) what to do about unit tests.

--

___
Python tracker 

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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-11-06 Thread Martin Panter

Martin Panter added the comment:

David: are you saying you like the first patch better (ignoring the markup 
mistakes)?

--

___
Python tracker 

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



[issue18010] pydoc search chokes on import errors

2015-11-06 Thread Martin Panter

Changes by Martin Panter :


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



[issue23360] Content-Type when sending data with urlopen()

2015-11-06 Thread Martin Panter

Martin Panter added the comment:

Spotted a docstring that needed updating

--
Added file: http://bugs.python.org/file40969/non-urlencoded.5.patch

___
Python tracker 

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



[issue24802] int and float constructing from non NUL-terminated buffer

2015-11-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a75336ac40e0 by Martin Panter in branch '3.4':
Issue #24802: Copy bytes-like objects to null-terminated buffers if necessary
https://hg.python.org/cpython/rev/a75336ac40e0

New changeset 95b9c07b27f7 by Martin Panter in branch '3.5':
Issue #24802: Merge null termination fixes from 3.4 into 3.5
https://hg.python.org/cpython/rev/95b9c07b27f7

New changeset 4df1eaecb506 by Martin Panter in branch 'default':
Issue #24802: Merge null termination fixes from 3.5
https://hg.python.org/cpython/rev/4df1eaecb506

--
nosy: +python-dev

___
Python tracker 

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



[issue24802] int and float constructing from non NUL-terminated buffer

2015-11-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, looks as this issue is not related to 2.7.

--
assignee: serhiy.storchaka -> martin.panter
versions:  -Python 2.7

___
Python tracker 

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



[issue25550] RecursionError in re with '(' * 500

2015-11-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think it is possible to make the parser non-recursive, but without reports 
about such real-world problems it looks premature and just will complicate the 
code. For years before 3.5 there was a limitation on only 100 capturing groups.

--

___
Python tracker 

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



[issue25564] IDLE behaves differently than python on `del __builtins__`

2015-11-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

We try to have IDLE work the same as Python (and CPython, where relevant), 
except where differences are intentional or unavoidable.  I am trying to 
eliminate some unintentional avoidable differences in other issues.  However, 
this one is unavoidable given IDLE's basic design.  Also, Steven is correct; see
https://docs.python.org/3/library/builtins.html#module-builtins

IDLE executes user code with "exec(code, self.locals)" (run.py, l.351 in 3.5).
https://docs.python.org/3/library/functions.html#exec
says "If the globals dictionary does not contain a value for the key 
__builtins__, a reference to the dictionary of the built-in module builtins is 
inserted under that key."

(Doc issus: From the builtins doc and the Jython example, this seems 
implementation dependent. Steven, does
  >>> d = {}; exec('', d); d.keys()
  dict_keys(['__builtins__'])
have this result in Jython?)

In the IDLE shell, each statement is exec'ed separately.  With two statements, 
__builtins__ is added back before 'min' , while with one statement, it is not.  

Editor: Run Module execs the entire file at once.  I expected print(min) to 
fail either way, but it works either way.  I verified that globals().keys() 
lost '__builtins__', so I don't know how __builtins__.min is found.

I left this open to consider adding a line to
https://docs.python.org/3/library/idle.html#idle-console-differences

--
assignee:  -> terry.reedy
components: +Documentation
stage:  -> needs patch
title: IDLE behaves differently that the standard interpreter when someone 
types `del __builtins__` -> IDLE behaves differently than python on `del 
__builtins__`
type:  -> behavior
versions: +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



[issue25545] email parsing docs need to be clear that only ASCII strings are supported

2015-11-06 Thread Christian Tanzer

Christian Tanzer added the comment:

> If you can suggest ways of improving the string support without
> breaking existing python3 code that may be using it (most likely
> wrongly, but working for them), then I will happily review them.

At the moment, I'm mainly interested in having code that runs
correctly in both python2.7 and python3.

Having the same method behave totally differently in the two versions
is what triggered this bug report.

Adding new methods won't help with 2.7.

> To do what you appear to want, to be able to represent non-ascii as
> the equivalent unicode *cannot work*, because email messages may
> contain binary data which *cannot* be represented in printable
> unicode.

I have no problem whatsoever if, and would actually expect that,
binary message parts are encoded as necessary for RFS compliance. My
beef is with message parts that are text and are naturally represented
as unicode not as charset- and transfer-encoded 7-bit strings!

I also don't see how such a representation would break existing
python3 code but that might just be another example of famous last
words.

> But, making unicode easier is one big reason python3 exists (the
> biggest one, in practice).

>From what I have seen up to now, that has failed (spectacularly, in my
opinion, if you consider things like unpickling python2-created
pickles with binary strings, e.g., datetime instances).

Using unicode in python2 worked well enough although there was the
problem that one couldn't specify which strings were supposed to be
binary. Exactly those strings are a big problem for code that wants to
run in both python2 and python3.

python3 solves the problem of binary strings, though badly because
of the various missing string functions. But there seem to be bugs all
over the standard library and in third party modules.

That library APIs still haven't settled down yet in python3 is even
worse!

Maybe python3 would work well if one threw away all existing code and
started with completely new code but I don't think that was the
intention.

--

___
Python tracker 

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



[issue25410] Clean up and fix OrderedDict

2015-11-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 45ce4c6b4f36 by Serhiy Storchaka in branch '3.5':
Issue #25410: Made testing that od_fast_nodes and dk_entries are in sync more
https://hg.python.org/cpython/rev/45ce4c6b4f36

New changeset c16af48153a4 by Serhiy Storchaka in branch 'default':
Issue #25410: Made testing that od_fast_nodes and dk_entries are in sync more
https://hg.python.org/cpython/rev/c16af48153a4

--

___
Python tracker 

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



[issue25410] Clean up and fix OrderedDict

2015-11-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Eric.

I made error in commit messages, that is why they are non shown here. 
odict_revert_setting_on_error.patch and odict_iternext_simpler.patch were 
committed in 1594c23d8c2f and ad44d551c13c.

od_resize_sentinel2 in odict_resize_sentinel.patch was renamed to 
od_fast_nodes_size. Now I see that this is not enough. It is possible that 
ma_keys is located on the same place, has the same size, but has different 
layout for keys with matched hashes. I'm trying to write more reliable checks.

--
stage: commit review -> needs patch

___
Python tracker 

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



[issue25462] Avoid repeated hash calculation in C implementation of OrderedDict

2015-11-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please make a review of this patch Eric? It is moved to separate 
issue because it is enough large and complex.

--

___
Python tracker 

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



[issue24726] OrderedDict has strange behaviour when dict.__setitem__ is used.

2015-11-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1594c23d8c2f by Serhiy Storchaka in branch '3.5':
Issue #24726: Revert setting the value on the dict if
https://hg.python.org/cpython/rev/1594c23d8c2f

New changeset b391e97ccfe5 by Serhiy Storchaka in branch 'default':
Issue #24726: Revert setting the value on the dict if
https://hg.python.org/cpython/rev/b391e97ccfe5

--

___
Python tracker 

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



[issue25558] Use static asserts in C code

2015-11-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ad44d551c13c by Serhiy Storchaka in branch '3.5':
Issue #25558: Refactoring OrderedDict iteration.
https://hg.python.org/cpython/rev/ad44d551c13c

New changeset 51f3547da99c by Serhiy Storchaka in branch 'default':
Issue #25558: Refactoring OrderedDict iteration.
https://hg.python.org/cpython/rev/51f3547da99c

--
nosy: +python-dev

___
Python tracker 

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



[issue25558] Use static asserts in C code

2015-11-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Wrong issue. The correct one is issue24726.

--

___
Python tracker 

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



[issue25558] Use static asserts in C code

2015-11-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, no, the correct one is issue25410.

--

___
Python tracker 

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



[issue24726] OrderedDict has strange behaviour when dict.__setitem__ is used.

2015-11-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Wrong issue. The correct one is issue25410.

--

___
Python tracker 

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



[issue25553] smtpd strips final carraige return from received message body

2015-11-06 Thread R. David Murray

R. David Murray added the comment:

That does indeed appear to be a bug in smtpd.py.

Even if postfix's client mode does do an unconditional add of an extra newline, 
it is wrong according to the RFC, so I don't think that we'd change smtplib.  
Especially since we've had no other reports of the current code causing 
problems (the only problem case you have reported is against smtpd.py, which is 
a bug in smtpd.py).

--
resolution: not a bug -> 
stage: resolved -> needs patch
status: closed -> open
title: SMTP.data(msg) function may cause the last CRLF of msg lost if msg is 
quoted-printable encoding. -> smtpd strips final carraige return from received 
message body
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



[issue25553] smtpd strips final carraige return from received message body

2015-11-06 Thread R. David Murray

Changes by R. David Murray :


--
components: +email
nosy: +barry

___
Python tracker 

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



[issue25495] binascii documentation incorrect

2015-11-06 Thread Mouse

Mouse added the comment:

> my patch should be valid for 3.5 also.
> The relevant wording is identical to 2.7.

OK.

> I have resisted removing the magic number 57 for a couple
> of reasons. Reading existing code that uses this number may
> be harder.

You expect to see "existing code that uses this number" in Python-3.5+? 
Interesting... (Care to point me at a couple of samples of such "existing" 
Python-3 code?) And you expect that the main info source for understanding the 
reason behind that "57" (assuming this function is invoked that way, as opposed 
to splitting the output :) would be the doc for this function, rather than the 
main program, or RFC 2045, or...? Fine.

> It helps explain how the function was originally to be used,
> and why the newline is appended.

Pardon me, but why do you think anybody would care...? There are tons of 
functions, old and new, with more new ones popping up fast enough. I'd really 
envy a person who has time to enjoy history of one minuscule function of an old 
(albeit still useful :) library.

OK. You think a history of this function should be documented - fine. I don't 
need it (and don't think anybody else wants to read it either), but it's not my 
doc or my decision.

Just get the darn bug fixed.

--

___
Python tracker 

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



[issue25565] subprocess.Popen creates inheritable file descriptors on Windows, can leak to other child processes

2015-11-06 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

yep, maybe, because in the other issue, it's about a race condition. similar.

--
nosy: +matrixise

___
Python tracker 

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



[issue22829] Add --prompt option to venv

2015-11-06 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

oops, forgotten to provide the patch :/

--

___
Python tracker 

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



[issue21247] test_asyncio: test_subprocess_send_signal hangs on Fedora builders

2015-11-06 Thread Марк Коренберг

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

Bug still reproduced. Jenkins running from init.d use /usr/bin/daemon. This 
mean SIGHUP will be in SIG_IGN state. Since echo.py does not setup sighup 
handler, sighup will be equivalent of SIGKILL. So, why not to use, say, SIGTERM 
instead? After such change all tests passed.

If not, signal handling tests should reset signal handling to SIG_DFL.

Please reopen

--
nosy: +mmarkk

___
Python tracker 

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



[issue25177] OverflowError in statistics.mean when summing large floats

2015-11-06 Thread Mark Dickinson

Mark Dickinson added the comment:

I can reproduce here (OS X 10.9, Python 3.5), exactly as described in the 
original post.

Python 3.5.0 (default, Sep 22 2015, 18:26:54) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import statistics
>>> statistics.mean([8.988465674311579e+307, 8.98846567431158e+307])
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/statistics.py",
 line 293, in mean
return _sum(data)/n
  File 
"/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/statistics.py",
 line 184, in _sum
return T(total)
  File 
"/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/numbers.py",
 line 291, in __float__
return self.numerator / self.denominator
OverflowError: integer division result too large for a float

--

___
Python tracker 

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



[issue21224] BaseHTTPRequestHandler, update the protocol version to http 1.1 by default?

2015-11-06 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

After your remarks, maybe we can close this issue. It's not just a simple 
modification of a string.

Do you know if we want to support the HTTP 1.1 and 2.0 in the future, directly 
in CPython and not via an external library (gunicorn, ...)

What do you think ? we close this issue and open an other with "Support of HTTP 
1.1 and 2.0" ?

--

___
Python tracker 

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



[issue25567] shlex.quote doesn't work on bytestrings

2015-11-06 Thread Jonas Thiem

New submission from Jonas Thiem:

Demonstration:

>>> import shlex
>>> shlex.quote(b"abc")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.4/shlex.py", line 285, in quote
if _find_unsafe(s) is None:
TypeError: can't use a string pattern on a bytes-like object
>>>

Your question is now probably, why would anyone not want to use unicode strings 
here?

The reason is that for some operations (e.g. file access to some known paths) 
decoding and encoding from/to any sort of unicode interpretation can be lossy, 
specifically when the file path on the filesystem has broken/mixed encoding 
characters. In such a case, the shell command might need to be supplied as 
bytestring to ensure it is sent exactly as-is so such broken files can still be 
dealt with, without the Unicode interpretation possibly deforming the path in 
some bytes.

Since shlex.quote seems targeted at shell usage, it should therefore support 
this.

--
components: Library (Lib)
messages: 254186
nosy: Jonas Thiem, The Compiler
priority: normal
severity: normal
status: open
title: shlex.quote doesn't work on bytestrings
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue25565] subprocess.Popen creates inheritable file descriptors on Windows, can leak to other child processes

2015-11-06 Thread R. David Murray

R. David Murray added the comment:

This looks like a duplicate of issue 24909?

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



[issue25545] email parsing docs need to be clear that only ASCII strings are supported

2015-11-06 Thread R. David Murray

R. David Murray added the comment:

Python3 is easier to do unicode in for programs that start with a clear 
bytes/string split.  Yes, porting from python2 has bumps arising from the 
places where bytes and string are blurred.  Yes if we could redo python3 
knowing what we know now we could improve matters.  But IMO we did a pretty 
good job given that we *didn't* know what we know now.  

This is not the forum to discuss such matters further :)

--

___
Python tracker 

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



[issue892902] problem with pickling newstyle class instances

2015-11-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is revised patch that uses different approach to tests. 
cPickleFastPicklerTests overridden old recursive tests to check that they 
raises an exception. The patch extends this to new recursive tests.

--
Added file: http://bugs.python.org/file40961/pickle_recursive-2.7_3.patch

___
Python tracker 

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



[issue25565] subprocess.Popen creates inheritable file descriptors on Windows, can leak to other child processes

2015-11-06 Thread eryksun

Changes by eryksun :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Windows: subprocess.Popen: race condition for leaking 
inheritable handles

___
Python tracker 

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



[issue25565] subprocess.Popen creates inheritable file descriptors on Windows, can leak to other child processes

2015-11-06 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

I don't have the right to close it. can you close it ?

Thanks

--

___
Python tracker 

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



[issue22919] Update PCBuild for VS 2015

2015-11-06 Thread Kevin Phillips

Kevin Phillips added the comment:

This change has the adverse side effect of requiring users of Python 3.5 to use 
the Visual Studio 2015 runtime library. Further, as is documented on 
Microsoft's website, the minimum system requirements for installing and running 
this runtime is Windows 7 SP1 or newer.

As a result, adopting this new compiler for the Python runtime prevents users 
of operating systems older than this from using this version. Even users with 
Windows 7 pre service pack are unable to use it. Based on a quick review of the 
comment thread here, the choice for adopting the 2015 compiler was relatively 
arbitrary and thus an older version, say 2013 for example, could have been used 
instead and older operation systems would still be supported with little to no 
impact on Python.

While this is unfortunate to say the least, what makes matters worse is there 
appears to be little to no information on the Python.org website indicating 
that the minimum system requirements have now been affected in this way. Also, 
for users attempting to install v3.5 on a system older than this are presented 
with a cryptic error message basically just saying that "some unknown error has 
occurred", leaving them scratching their head trying to figure out what's wrong.

Seeing as how you can't go back in time and fix this in 3.5.0, I am hoping that 
at the very least you could add some information about this to some obvious 
location on the main Python.org website, and maybe consider updating the 
installation for future 3.5.x releases such that a check is done to see if the 
operating system meets these new minimum requirements and present the user with 
some helpful information that would lead them to a resolution.

--
nosy: +Kevin.Phillips

___
Python tracker 

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



[issue22919] Update PCBuild for VS 2015

2015-11-06 Thread Steve Dower

Steve Dower added the comment:

The check is already added and will be in 3.5.1.

Changes to the python.org website should be suggested on 
https://github.com/python/pythondotorg (but I agree it could be more clear on 
the main site - the rule that we only support the same versions of Windows that 
Microsoft supports is not very well known, unfortunately).

--

___
Python tracker 

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



[issue25569] Memory leak in SSLSocket.getpeercert()

2015-11-06 Thread Alex Gaynor

New submission from Alex Gaynor:

Run the following code:

import socket
import ssl
import sys


def main():
ctx = ssl.create_default_context()
s = socket.create_connection(('www.bing.com', 443))
s = ctx.wrap_socket(s, server_hostname='www.bing.com')
while True:
s.getpeercert()

sys.stderr.write('.')
sys.stderr.flush()


if __name__ == '__main__':
main()



and observe memory usage, you'll see it increases by a MB/s or so.

--
messages: 254210
nosy: alex
priority: normal
severity: normal
status: open
title: Memory leak in SSLSocket.getpeercert()
versions: Python 2.7, 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



[issue25569] Memory leak in SSLSocket.getpeercert()

2015-11-06 Thread Alex Gaynor

Changes by Alex Gaynor :


--
nosy: +christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou

___
Python tracker 

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



[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

2015-11-06 Thread Christian Rickert

New submission from Christian Rickert:

A piece of software stopped working after the update from Python 3.4.x to 3.5 
(both Linux and Windows).

I found the cause in the  Request.add_header("abcd","efgh")  function:
If the first parameter string "abcd" contains a colon (":") character, a 
ValueError is raised and the execution stops.

This is an example code:

>>> import urllib.request
>>> import urllib.parse
>>> data = urllib.parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
>>> data = data.encode('utf-8')
>>> request = urllib.request.Request("http://requestb.in/xrbl82xr;)
>>> # adding charset parameter to the Content-Type header.
>>> request.add_header("Content-Type:","application/x-www-form-urlencoded;charset=utf-8")
>>> with urllib.request.urlopen(request, data) as f:
... print(f.read().decode('utf-8'))
...

This is the error:

Traceback (most recent call last):
  File "C:\Users\user\Desktop\example.py", line 9, in 
with urllib.request.urlopen(request, data) as f:
  File "C:\python\lib\urllib\request.py", line 162, in urlopen
return opener.open(url, data, timeout)
  File "C:\python\lib\urllib\request.py", line 465, in open
response = self._open(req, data)
  File "C:\python\lib\urllib\request.py", line 483, in _open
'_open', req)
  File "C:\python\lib\urllib\request.py", line 443, in _call_chain
result = func(*args)
  File "C:\python\lib\urllib\request.py", line 1268, in http_open
return self.do_open(http.client.HTTPConnection, req)
  File "C:\python\lib\urllib\request.py", line 1240, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
  File "C:\python\lib\http\client.py", line 1083, in request
self._send_request(method, url, body, headers)
  File "C:\python\lib\http\client.py", line 1123, in _send_request
self.putheader(hdr, value)
  File "C:\python\lib\http\client.py", line 1050, in putheader
raise ValueError('Invalid header name %r' % (header,))
ValueError: Invalid header name b'Content-Type:'

Steps to reproduce:

Add a colon character anywhere into the first parameter of the  
Request.add_header()  function and execute the code using Python 3.5.x.

--
components: Library (Lib)
messages: 254214
nosy: crickert
priority: normal
severity: normal
status: open
title: urllib.request > Request.add_header("abcd","efgh") fails with character 
":" in first parameter string
type: crash
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



[issue25569] Memory leak in SSLSocket.getpeercert()

2015-11-06 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Maybe you are right, I didn't see that this function returns a pointer in 
function of the parameter. sorry.


Could you try with this patch, really sorry but my internet connection is 
really slow and I have a problem with the _ssl module on my laptop (problem 
with the compilation and the dependencies because I am on OSX).

Thank you

--
keywords: +patch
Added file: http://bugs.python.org/file40963/issue25569.patch

___
Python tracker 

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



[issue25177] OverflowError in statistics.mean when summing large floats

2015-11-06 Thread Mark Dickinson

Mark Dickinson added the comment:

Note that the two input values given in the original report are not the same:

[8.988465674311579e+307, 8.98846567431158e+307] != [8.988465674311579e+307] * 2.

--

___
Python tracker 

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



[issue25569] Memory leak in SSLSocket.getpeercert()

2015-11-06 Thread Alex Gaynor

Alex Gaynor added the comment:

A probably source of the leak is here: 
https://github.com/python/cpython/blob/master/Modules/_ssl.c#L1073-L1076 `dps` 
is never freed. (This is with OpenSSL 0.9.8zg)

--

___
Python tracker 

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



[issue25569] Memory leak in SSLSocket.getpeercert()

2015-11-06 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Hi Alex,

not sure, but I think the right function to free the memory is 
AUTHORITY_INFO_ACCESS_free(dps)

I will provide a patch for a review asap

--
nosy: +matrixise

___
Python tracker 

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



[issue25569] Memory leak in SSLSocket.getpeercert()

2015-11-06 Thread Alex Gaynor

Alex Gaynor added the comment:

I think you want sk_DIST_POINT_free actually.

--

___
Python tracker 

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



[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

2015-11-06 Thread Christian Rickert

Christian Rickert added the comment:

The URL "http://requestb.in/xrbl82xr; is invalid, you'll get a 
"urllib.error.HTTPError: HTTP Error 404: NOT FOUND" error."

Instead, please use "http://www.example.com; to confirm.

--

___
Python tracker 

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



[issue22829] Add --prompt option to venv

2015-11-06 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Hi @berker.peksag

Please, could you review this patch, I have followed your remarks and adjust 
the patch.

Thank you

--
Added file: http://bugs.python.org/file40962/venv-prompt-argument-3_6.patch

___
Python tracker 

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



[issue25566] asyncio reference cycles after ConnectionResetError

2015-11-06 Thread Jeroen van der Heijden

New submission from Jeroen van der Heijden:

When a ConnectionResetError occurs, reference cycles are created due to 
__traceback__. As far as I can see there's no way to prevent this to happen 
since the event loop exception handler is not called for the following events: 
BrokenPipeError, ConnectionResetError and ConnectionAbortedError. 
(selector_events.py, line 579)

In this case the connection is probably lost so '_protocol.connection_lost()' 
will not be called either. (at least we can't rely on this)

Maybe it's possible to just call the exception handler? Or, in case we want to 
ignore these errors set __traceback__ to None?

--
components: asyncio
messages: 254184
nosy: gvanrossum, haypo, joente, yselivanov
priority: normal
severity: normal
status: open
title: asyncio reference cycles after ConnectionResetError
type: resource usage
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



[issue25553] SMTP.data(msg) function may cause the last CRLF of msg lost if msg is quoted-printable encoding.

2015-11-06 Thread Deli Zhang

Deli Zhang added the comment:

I can understand you, while could you please consider below fact:
Once our SMTP server module smtpd.py receives the sample mail, it will remove 
the end-of-data sequence, that makes the "=" become the last char of mail data. 
I think it's inconsistent to our SMTP client module smtplib.py.

If we can just add "." following mail data like postfix, which is 
influential amd authoritative in SMTP field, that will make things simple and 
will not make any trouble in reality situation.

I just advise this, if you think no need then I can compromise.
Thanks.

--

___
Python tracker 

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



[issue25565] subprocess.Popen creates inheritable file descriptors on Windows, can leak to other child processes

2015-11-06 Thread Jack O'Connor

Jack O'Connor added the comment:

Definitely a duplicate, thanks for pointing me to the original. Should I mark 
it resolved, or let someone from the project do that?

--

___
Python tracker 

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




[issue25462] Avoid repeated hash calculation in C implementation of OrderedDict

2015-11-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file40960/odict_knownhash_2.patch

___
Python tracker 

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



[issue25567] shlex.quote doesn't work on bytestrings

2015-11-06 Thread R. David Murray

R. David Murray added the comment:

I think that this is a reasonable request, and probably applies to the whole 
shlex module, although less strongly.

You could use the surrogateescape hack to work around the problem:

  shlex.quote(mydata.encode('ascii', 'surrogateescape')).decode('ascii', 
'surrogateescape)

That might be the only practical way to handle bytes input to the shlex parser, 
if we do also want to tackle that.

Note that it is already the case that os module functions that retrn filenames 
and stdin/stdout use surrogateescape, so a naive program may actually work with 
binary filenames (which is why the handler is used in those contexts).

--
keywords: +easy
nosy: +r.david.murray
stage:  -> needs patch
type: behavior -> enhancement
versions: +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



[issue25568] typing backport: AttributeError: 'module' object has no attribute 'GeneratorType'

2015-11-06 Thread nicolas33

New submission from nicolas33:

$ pip3 install typing
$ python3
>>> import typing
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/nicolas/.local/lib64/python3.4/site-packages/typing.py", line 
1449, in 
_G_base = types.GeneratorType
AttributeError: 'module' object has no attribute 'GeneratorType'
>>>

--
messages: 254198
nosy: nicolas33
priority: normal
severity: normal
status: open
title: typing backport: AttributeError: 'module' object has no attribute 
'GeneratorType'
type: crash
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



[issue22829] Add --prompt option to venv

2015-11-06 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue25568] typing backport: AttributeError: 'module' object has no attribute 'GeneratorType'

2015-11-06 Thread nicolas33

nicolas33 added the comment:

My bad. This happens while running on Python3.3 (while pip3 installed module 
using python3.4).

--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue25568] typing backport: AttributeError: 'module' object has no attribute 'GeneratorType'

2015-11-06 Thread STINNER Victor

STINNER Victor added the comment:

https://github.com/JukkaL/typing/ looks to be the upstream project for the 
third party "typing" module.

See https://github.com/JukkaL/typing/issues/46

--
nosy: +haypo

___
Python tracker 

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



[issue25558] Use static asserts in C code

2015-11-06 Thread STINNER Victor

STINNER Victor added the comment:

use_Py_BUILD_ASSERT_EXPR.patch looks good to me. But you should revert the 
change on decimal, as asked by Stefan, and I suggested to move an assertion 
inside the related function (see my comment on Rietveld).

"""
A library can follow the example in the comment.

   #define foo_to_char(foo)  \
   ((char *)(foo)\
+ Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))
"""

Hum ok, I know understand the "_EXPR" suffix of the macro name. Maybe it's 
worth to add a new #define Py_BUILD_ASSERT(expr) 
(void)Py_BUILD_ASSERT_EXPR(expr)" macro?

By the way, I don't know what happens if you pass a variable to 
Py_BUILD_ASSERT_EXPR() rather than a constant. Maybe we could use 
__builtin_constant_p() on GCC? Maybe it's overcomplexicated :-)

--

___
Python tracker 

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



[issue25555] Fix parser and AST: fill lineno and col_offset when compiling AST from Python objects

2015-11-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 54d4290f0ec6 by Victor Stinner in branch 'default':
Issue #2: Fix parser and AST: fill lineno and col_offset of "arg" node when
https://hg.python.org/cpython/rev/54d4290f0ec6

--
nosy: +python-dev

___
Python tracker 

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



[issue25555] Fix parser and AST: fill lineno and col_offset when compiling AST from Python objects

2015-11-06 Thread STINNER Victor

STINNER Victor added the comment:

> 3. How can I test it? currently, everything is fine.

Sorry, I don't know how to test it.

To write my fix, I had to modify the compile() builtin function to be able to 
compile Python to AST, and then AST to Python. But without this fix I don't 
know how to test.

I tried to revert the AST patch on my FAT Python to try to find which part of 
the code fails without the fix, but FAT Python doesn't compile anymore. I 
reverted the revert, and it still doesn't work!?

For this bug, sorry, you have to trust me :-(

I applied the fix to Python 3.6. I will wait a bit for buildbots before 
backporting to 3.5.

--

___
Python tracker 

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



[issue25555] Fix parser and AST: fill lineno and col_offset when compiling AST from Python objects

2015-11-06 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

I trust you, I have reviewed the source code and it seems to be right.

--

___
Python tracker 

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



[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

2015-11-06 Thread R. David Murray

R. David Murray added the comment:

This behavior change was part of a security fix, and will appear in the next 
version of 3.4 as well.  See issue 22928.  Header names may not contain colons, 
the colon separator is added when the header is rendered.  Detecting and 
rejecting them guards against header injection attacks.

However, that fix was done in httplib.  I think it would also be worthwhile to 
fix add_header so that it rejects invalid header components when called, 
instead of only having the check done later in httplib, at a point distant from 
where the problem occurred.

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



[issue25571] Improve the lltrace feature with the Py_Debug mode

2015-11-06 Thread Stéphane Wirtel

New submission from Stéphane Wirtel:

When we use the Py_Debug flag for the compilation, we can see the Bytecodes and 
the opcode arguments.

Here is a small patch, it will show the label of the opcode in the ceval.c file.

--
messages: 254218
nosy: matrixise
priority: normal
severity: normal
status: open
title: Improve the lltrace feature with the Py_Debug mode

___
Python tracker 

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



[issue25571] Improve the lltrace feature with the Py_Debug mode

2015-11-06 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Here is my patch with the improvement.

--
keywords: +patch
Added file: http://bugs.python.org/file40964/issue25571.patch

___
Python tracker 

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



[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

2015-11-06 Thread R. David Murray

R. David Murray added the comment:

By the way, that your application worked before was pure luck, here is what 
httplib sends in 3.4 given your test program:

POST / HTTP/1.1
Accept-Encoding: identity
User-Agent: Python-urllib/3.4
Connection: close
Host: ..com:
Content-Length: 21
Content-Type:: application/x-www-form-urlencoded;charset=utf-8
Content-Type: application/x-www-form-urlencoded

--

___
Python tracker 

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



[issue25572] _ssl doesn't build on OSX 10.11

2015-11-06 Thread Stéphane Wirtel

New submission from Stéphane Wirtel:

On OSX 10.11, if you don't use Homebrew or MacPorts, the _ssl module is not 
built with Makefile.

Homebrew supports OpenSSL and LibreSSL, but OpenSSL is in 
/usr/local/opt/openssl and not in /usr/local/ssl (see setup.py)

So, the next point, I am not sure, but the headers of OpenSSL has not provided 
with OSX 10.11

--
messages: 254222
nosy: matrixise
priority: normal
severity: normal
status: open
title: _ssl doesn't build on OSX 10.11

___
Python tracker 

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



[issue11907] SysLogHandler can't send long messages

2015-11-06 Thread Harsh Patel

Harsh Patel added the comment:

I know this has been closed as "Not a bug" but it would have been convenient if 
the message was broken down into multiple packets and transmitted, should it 
exceed the packet limit. 
Raising an exception [Errno 40 or Errno 90] or silently ignoring the packet (by 
setting logging.raiseExceptions to False) doesn't help much in terms of 
robustness and reliability. 
I eventually ended up extending these Handler classes and overriding the send 
to accomplish breaking messages into multiple parts

--
nosy: +Harsh Patel

___
Python tracker 

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



[issue11907] SysLogHandler can't send long messages

2015-11-06 Thread R. David Murray

R. David Murray added the comment:

Writing your own handler is what Vinay recommended.

Is it even possible to determine the maximum message size?  If we can't do that 
reliably, then the best we can do is recommend writing your own exception 
handler using local knowledge.  If it can be determined reliably, you could 
open a new issue with that feature request.

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



[issue25388] tokenizer crash/misbehavior -- heap use-after-free

2015-11-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, there is a bug. When decoding_fgets() encounter non-UTF-8 bytes, it fails 
and free input buffer in error_ret(). But since tok->cur != tok->inp, next call 
of tok_nextc() reads freed memory.

if (tok->cur != tok->inp) {
return Py_CHARMASK(*tok->cur++); /* Fast path */
}

If Python is not crashed here, new buffer is allocated and assigned to 
tok->buf, then PyTokenizer_Get returns error, parsetok() calculates the 
position of the error

err_ret->offset = (int)(tok->cur - tok->buf);

but tok->cur points inside old freed buffer, and the offset becomes too large 
integer. err_input() tries to decode the part of the string before error with 
the "replace" error handler, but since the position was wrongly calculated, it 
reads out of allocated memory.

Proposed patch fixes the issue. It sets tok->done and pointers in case of 
decoding error, so they now are in consistent state. It also removes some 
duplicated or dead code.

--
stage:  -> patch review
Added file: http://bugs.python.org/file40965/issue25388.patch

___
Python tracker 

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



[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

2015-11-06 Thread Christian Rickert

Christian Rickert added the comment:

Hi David,

Thanks for looking into this.

IMHO it would be very helpful for code debugging, if "add_header" rejects 
invalid header arguments ad hoc.
As an alternative, the documentation I used for the implementation 
[https://docs.python.org/3.6/library/urllib.request.html] could be updated.


"Content-Type:: application/x-www-form-urlencoded;charset=utf-8"
A scope resolution operator thingy in the header? - What could possibly go 
wrong?  ^^

--

___
Python tracker 

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



[issue25573] FrameSummary repr() does not support previously working uses of repr in traceback module

2015-11-06 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Could you check with Python 3.4 ?

--
nosy: +matrixise

___
Python tracker 

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



[issue11822] Improve disassembly to show embedded code objects

2015-11-06 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Hi all,

For this feature, I have an other output:

stephane@sg1 /tmp> python3 dump_bytecode.py


  3   0 LOAD_BUILD_CLASS
  1 LOAD_CONST   0 (", line 3>)
  4 LOAD_CONST   1 ('User')
  7 MAKE_FUNCTION0
 10 LOAD_CONST   1 ('User')
 13 CALL_FUNCTION2 (2 positional, 0 keyword pair)
 16 STORE_NAME   0 (User)

  8  19 LOAD_NAME0 (User)
 22 LOAD_CONST   2 ('user')
 25 LOAD_CONST   3 ('password')
 28 CALL_FUNCTION2 (2 positional, 0 keyword pair)
 31 STORE_NAME   1 (user)
 34 LOAD_CONST   4 (None)
 37 RETURN_VALUE

.User
-
  3   0 LOAD_NAME0 (__name__)
  3 STORE_NAME   1 (__module__)
  6 LOAD_CONST   0 ('User')
  9 STORE_NAME   2 (__qualname__)

  4  12 LOAD_CONST   1 (", line 4>)
 15 LOAD_CONST   2 ('User.__init__')
 18 MAKE_FUNCTION0
 21 STORE_NAME   3 (__init__)
 24 LOAD_CONST   3 (None)
 27 RETURN_VALUE

.User.__init__
--
  5   0 LOAD_FAST1 (email)
  3 LOAD_FAST0 (self)
  6 STORE_ATTR   0 (email)

  6   9 LOAD_FAST2 (password)
 12 LOAD_FAST0 (self)
 15 STORE_ATTR   1 (password)
 18 LOAD_CONST   0 (None)
 21 RETURN_VALUE

--
nosy: +matrixise
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue25572] _ssl doesn't build on OSX 10.11

2015-11-06 Thread Zachary Ware

Changes by Zachary Ware :


--
components: +Macintosh
nosy: +ned.deily, ronaldoussoren, zach.ware
stage:  -> needs patch
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



[issue25573] traceback documentation example is lying about FrameSummary repr()

2015-11-06 Thread Alexandre Macabies

New submission from Alexandre Macabies:

https://docs.python.org/3.5/library/traceback.html#traceback-examples
See second code sample and its sample output. According to the docs, the call:

  print(repr(traceback.extract_tb(exc_traceback)))

is supposed to print something that looks like an array with only strings; that 
is what the doc sample output states:

  [('', 10, '', 'lumberjack()'),

But actually, in 3.5+, this call outputs the repr() of a list of FrameSummary 
instances that do not go further in repr()esenting their state:

  [, line 10 in >,

By looking at the docs I thought I was able to get a nice string representation 
of a FrameSummary. I actually have to format it myself. It should be reflected 
in the doc sample output.

--
assignee: docs@python
components: Documentation
messages: 254224
nosy: Alexandre Macabies, docs@python
priority: normal
severity: normal
status: open
title: traceback documentation example is lying about FrameSummary repr()
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



[issue25573] FrameSummary repr() does not support previously working uses of repr in traceback module

2015-11-06 Thread R. David Murray

R. David Murray added the comment:

IMO, that is neither a lie nor a doc bug, it is a bug in the new traceback 
features that were added in 3.5.

--
assignee: docs@python -> 
keywords: +3.5regression
nosy: +r.david.murray, rbcollins
stage:  -> needs patch
title: traceback documentation example is lying about FrameSummary repr() -> 
FrameSummary repr() does not support previously working uses of repr in 
traceback module

___
Python tracker 

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



[issue25520] unittest load_tests protocol not working as documented

2015-11-06 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +ezio.melotti, michael.foord, rbcollins

___
Python tracker 

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



[issue11907] SysLogHandler can't send long messages

2015-11-06 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

This issue will stay closed, BUT I propose you to create a new issue with a new 
title: Feature: Support message over 1024 bytes for the SysLogHandler. and 
propose a patch for this feature.

--
nosy: +matrixise

___
Python tracker 

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



[issue25528] Attempt to further increase test coverage of calendar module

2015-11-06 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +rhettinger

___
Python tracker 

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



[issue25527] Invalid (... and confusing) warning raised by 2to3 regarding repeat

2015-11-06 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

2015-11-06 Thread R. David Murray

R. David Murray added the comment:

I don't think the docs need updating if the ValueError is raised by add_header. 
 The 'key' in the docs is the header name, as examples in other sections of 
that doc make clear.  Granted you won't necessarily see that if you just read 
the add_header entry, but we can't explain every detail in every entry.

Hmm.  Perhaps an example could be added, though.

--
keywords: +easy
stage:  -> needs patch

___
Python tracker 

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



  1   2   >