[issue30458] CRLF Injection in httplib

2017-06-03 Thread Martin Panter

Martin Panter added the comment:

You can also inject proper HTTP header fields (or do multiple requests) if you 
omit the space after the CRLF:

urlopen("http://localhost:8000/ HTTP/1.1\r\nHEADER: INJECTED\r\nIgnore:")

Data sent to the server:
>>> server = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)
>>> server.bind(("localhost", 8000))
>>> server.listen()
>>> [conn, addr] = server.accept()
>>> pprint(conn.recv(300).splitlines(keepends=True))
[b'GET / HTTP/1.1\r\n',
 b'HEADER: INJECTED\r\n',
 b'Ignore: HTTP/1.1\r\n',
 b'Accept-Encoding: identity\r\n',
 b'User-Agent: Python-urllib/3.5\r\n',
 b'Connection: close\r\n',
 b'Host: localhost:8000\r\n',
 b'\r\n']

Issue 14826 is already open about how “urlopen” handles spaces, and there is a 
patch in Issue 13359 that proposes to also encode newline characters. But if 
the CRLF or header injection is a security problem, then 2.7 etc could be 
changed to raise an exception (like Issue 22928), or to do percent encoding.

--

___
Python tracker 

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



[issue30558] [Suggestion] Improve documentation for set() API

2017-06-03 Thread Martin Panter

Martin Panter added the comment:

Did you see 
?

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python, martin.panter
status: open -> pending

___
Python tracker 

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



[issue25910] Fixing links in documentation

2017-06-03 Thread Sanyam Khurana

Sanyam Khurana added the comment:

Hi,

If this work is not being actively worked on, can I work on this and fix the 
remaining links?

--
nosy: +CuriousLearner

___
Python tracker 

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



[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2017-06-03 Thread Sanyam Khurana

Sanyam Khurana added the comment:

Hi r.david.murray,

What error do you think should be raised in this case, when path is an instance 
of str?

I'll issue a PR once I know what end results are expected.

--
nosy: +CuriousLearner

___
Python tracker 

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



[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2017-06-03 Thread Sanyam Khurana

Changes by Sanyam Khurana :


--
pull_requests: +2006

___
Python tracker 

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



[issue30559] Bugs in Web app

2017-06-03 Thread Mahira

New submission from Mahira:

Hai 

I followed your Tutorial
In the Following Program, i am getting 
Traceback (most recent call last):
  File 
"C:\Users\Mahira\AppData\Local\Programs\Python\Python36\Scripts\localhost.py", 
line 1, in 
import web
  File "C:\Users\Mahira\AppData\Local\Programs\Python\Python36\Scripts\web.py", 
line 6, in 
app = web.application(("urls"),globals())
AttributeError: module 'web' has no attribute 'application'

And my program is:

import web

urls = (
'/', 'index'
)

class index:
def GET(self):
return "Hello, world!"

if __name__ == "__main__":
app = web.application(urls, globals())
app.run()

--
assignee: terry.reedy
components: IDLE
messages: 295071
nosy: Mahira, terry.reedy
priority: normal
severity: normal
status: open
title: Bugs in Web app
type: compile error
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



[issue30559] Bugs in Web app

2017-06-03 Thread Mark Dickinson

Mark Dickinson added the comment:

Hi Mahira,

This site is for reporting bugs in the Python core language itself, not bugs in 
code written by users.

You appear to be using the "Learn Python the Hard Way" tutorial, which is a 
third-party resource that's not maintained by the Python language developers. 
You might want to try asking your questions on one of the Python mailing lists 
(see https://www.python.org/community/lists/), or the "Learn Code the Hard Way" 
chat room: https://gitter.im/lcthw/Lobby

--
nosy: +mark.dickinson
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



[issue25910] Fixing links in documentation

2017-06-03 Thread SilentGhost

SilentGhost added the comment:

>  can I work on this and fix the remaining links?
Please do.

--

___
Python tracker 

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



[issue30526] Allow setting line_buffering on existing TextIOWrapper

2017-06-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:


New changeset 3c2817b6884a5fcf792197203f3c26b157210607 by Antoine Pitrou in 
branch 'master':
Fix bpo-30526: Add TextIOWrapper.reconfigure() and a 
TextIOWrapper.write_through attribute (#1922)
https://github.com/python/cpython/commit/3c2817b6884a5fcf792197203f3c26b157210607


--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2017-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think only lawyers or people related to the Zope Corporation and the BeOpen 
PythonLabs team can help with fixing the links to http://www.zope.com/ and 
http://www.pythonlabs.com/logos.html.

--

___
Python tracker 

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



[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2017-06-03 Thread R. David Murray

R. David Murray added the comment:

As I mentioned on the PR I think it should be a ValueError, and that the PR 
also needs tests.

--

___
Python tracker 

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



[issue30555] _io._WindowsConsoleIO breaks in the face of fd redirection

2017-06-03 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2007

___
Python tracker 

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



[issue29929] Eliminate implicit __main__ relative imports

2017-06-03 Thread Nick Coghlan

Nick Coghlan added the comment:

See https://mail.python.org/pipermail/import-sig/2017-March/001068.html for the 
above-mentioned import-sig post (the design in that email isn't the same as the 
one described above, but later in the thread I decided the design suggested 
here is likely to be less confusing overall)

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2017-06-03 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Adding Jim Fulton (for Zope) and Guido (for Pythonlabs).  I don't know who owns 
the former, but I'm fairly sure Guido owns the pythonlabs domain.

--
nosy: +gvanrossum, j1m

___
Python tracker 

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



[issue30534] error message for incorrect call degraded in 3.7

2017-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated error messages. Later I'm going to unify error messages for Python and 
C functions. But this is a different issue.

I can wrote a test, but I don't know good place for it. test_builtin doesn't 
look a good place to me.

--

___
Python tracker 

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



[issue27321] Email parser creates a message object that can't be flattened

2017-06-03 Thread Johannes Löthberg

Johannes Löthberg added the comment:

Any updates on this?  I'm having the same problem with some non-spam emails 
while trying to use some mail-handling tools written in Python.

--
nosy: +Johannes Löthberg

___
Python tracker 

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



[issue30538] Functional Programming HOWTO describes one argument itertools.count()

2017-06-03 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Thank you.  I've added that.  

This may seem like an odd question, but should I assume that the docs should 
always match the code?  For example, in the Functional HOWTO, I wasn't sure if 
the arguments were left off purposely or if it was just something that hadn't 
been updated.  If the docs should always match, then I wouldn't have to ask so 
many questions if I see another place where this happens.

Also, the example for enumerate is this:

f = open('data.txt', 'r')
for i, line in enumerate(f):
if line.strip() == '':
print('Blank line at line #%i' % i)

Is it code churn to replace the old style string formatting or is that 
something else that should be done as clean-up?

--

___
Python tracker 

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



[issue30540] regrtest: add --matchfile option

2017-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I less need reading test names from a file than other changes in this file. :)

But what about doctests? They are run unconditionally.

--

___
Python tracker 

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



[issue30559] Bugs in Web app

2017-06-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

It is good that you included both a short program and the full traceback. Too 
many beginners don't do that when asking questions.  Three comments: your 
program does not have syntax errors and compiled just fine; exceptions almost 
never involved the editor/IDE you happen to use; if 'web' comes from a book, 
its discussion group should be your best bet.

--
assignee: terry.reedy -> 
type: compile error -> behavior

___
Python tracker 

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



[issue30526] Allow setting line_buffering on existing TextIOWrapper

2017-06-03 Thread Antoine Pitrou

Changes by Antoine Pitrou :


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



[issue30523] unittest: add --list-tests option to only display the list of test names, don't run tests

2017-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

How to use this feature? "./python -m unittest --list-tests" produces nothing.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30518] Import type aliases from another module

2017-06-03 Thread John Jackson

John Jackson added the comment:

Thanks for your response!  Yes, the problem was a circular definition.  I still 
have much to learn about Python...

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



[issue30417] [buildbot] Disable the cpu resources on slow buildbots

2017-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And disable the "tzdata" resource for skipping generated tests for all 
timezones in test_datetime. Or make them requiring not only "tzdata", but "cpu".

--
nosy: +belopolsky, pitrou, serhiy.storchaka

___
Python tracker 

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



[issue30545] Enum equality across modules: comparing objects instead of values

2017-06-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue30523] unittest: add --list-tests option to only display the list of test names, don't run tests

2017-06-03 Thread Julien Palard

Julien Palard added the comment:

It works in "discover" mode, I tested:

./python -m unittest discover ./Lib/unittest/test/ --list-tests

and it worked.

So maybe the --list-tests should be moved to _getDiscoveryArgParser?

Also spotted that tests are printed on stderr, typically when the users asks 
for something, it has to be printed to stdout. Typically usages are written on 
stderr in case of error, but on stdout when explicitly asked via --help, see:

$ ./python -m unittest discover ./Lib/unittest/test/ --tabayo | wc
usage: python -m unittest discover [-h] [-v] [-q] [--locals] [-f] [-c] [-b]
   [-s START] [-p PATTERN] [-t TOP]
   [--list-tests]
python -m unittest discover: error: unrecognized arguments: --tabayo
  0   0   0
$ ./python -m unittest discover ./Lib/unittest/test/ --help | wc
 23 1291110

--

___
Python tracker 

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



[issue30417] [buildbot] Disable the cpu resources on slow buildbots

2017-06-03 Thread Zachary Ware

Changes by Zachary Ware :


--
pull_requests: +2008

___
Python tracker 

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



[issue30537] Using PyNumber_AsSsize_t in itertools.islice

2017-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Adding support of more general int-like objects in islice() looks reasonable to 
me. I'm not sure about permutations(), but if make this change, use 
PyIndex_Check() instead of PyNumber_Check(), or don't use the special check at 
all, allowing PyNumber_AsSsize_t() to fail.

The __setstate__() methods shouldn't be changed. We know that the __reduce__() 
methods return exact ints, not general int-like objects.

When replace PyLong_AsSsize_t with PyNumber_AsSsize_t take into account that 
PyLong_AsSsize_t is atomic and thread-safe, while PyNumber_AsSsize_t can call 
Python code and release the GIL.

--
assignee:  -> rhettinger
nosy: +rhettinger, serhiy.storchaka

___
Python tracker 

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



[issue30417] [buildbot] Disable the cpu resources on slow buildbots

2017-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This made tests faster by a third!

--

___
Python tracker 

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



[issue30498] Run Python's slowest tests in the first 3/4 of tests when using -r

2017-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue30417.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25910] Fixing links in documentation

2017-06-03 Thread Guido van Rossum

Guido van Rossum added the comment:

www.pythonlabs.com still exists. (The www. is mandatory.) And zope.org also
still works.

On Jun 3, 2017 7:52 AM, "Barry A. Warsaw"  wrote:

>
> Barry A. Warsaw added the comment:
>
> Adding Jim Fulton (for Zope) and Guido (for Pythonlabs).  I don't know who
> owns the former, but I'm fairly sure Guido owns the pythonlabs domain.
>
> --
> nosy: +gvanrossum, j1m
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2017-06-03 Thread Jim Fulton

Jim Fulton added the comment:

Zope Corporation no longer exists. Any references to it should be in the past 
tense and without a link.

(The http://www.zope.org is for the Zope Foundation, which is a different 
thing.)

--

___
Python tracker 

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



[issue27321] Email parser creates a message object that can't be flattened

2017-06-03 Thread R. David Murray

R. David Murray added the comment:

replace_header has a different semantic than del-and-set (replace_header leaves 
the header in the same location in the list, rather than appending it to the 
end...that's it's purpose).  If replace_header is throwing a key error, then I 
guess we need a look-before-you-leap if statement.

And a test :)

Note that a correct fix would preserve the broken input email, but since we're 
obviously already doing munging I'm fine with just making this work for now.

--

___
Python tracker 

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



[issue27321] Email parser creates a message object that can't be flattened

2017-06-03 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.6, Python 3.7 -Python 3.4

___
Python tracker 

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



[issue27448] Race condition in subprocess.Popen which causes a huge memory leak

2017-06-03 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
pull_requests: +2009

___
Python tracker 

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



[issue30417] [buildbot] Disable the cpu resources on slow buildbots

2017-06-03 Thread Brett Cannon

Brett Cannon added the comment:

One thing to note is if we want to speed up things like the coverage run on 
Travis we may want to make this optionally more deterministic rather than fully 
random for the 10 selected files, otherwise coverage shifts and we can't rely 
on any coverage metrics per-PR to know if code is increasing or decreasing 
coverage. Maybe having a ``-u deterministic`` resource to take out the 
randomness for coverage runs but leave the randomness for buildbots? This might 
also require tweaking our Travis tests as they currently use the buildbot make 
rule (I think).

P.S. I bet there are also some multiprocessing tests that go a bit overboard 
that we could consider scaling back, e.g. the coverage run skips a bunch of 
tests because they seem to process the entire stdlib.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue30498] Run Python's slowest tests in the first 3/4 of tests when using -r

2017-06-03 Thread Brett Cannon

Brett Cannon added the comment:

Travis takes nearly 22 minutes to do a test run with the slowest test currently 
at just under 8 minutes. That means on Travis the slowest test takes roughly 
1/3 of the time. But with your machine taking literally 2 minutes, or 1/10 the 
time as Travis, to do a test run, Terry, I'm not worried about speeding up your 
machine. ;)

But yes, we could change it to being the first 50% if people wanted. The 75% 
was somewhat arbitrarily selected to not artificially constrain the introduced 
pseudo-randomness of the test order.

--

___
Python tracker 

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



[issue30534] error message for incorrect call degraded in 3.7

2017-06-03 Thread Brett Cannon

Brett Cannon added the comment:

The tests could either go into the respective type's tests or a new test module 
like test_exception_messages could be added that's only to help keep messages 
in sync with each other.

--

___
Python tracker 

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



[issue29929] Eliminate implicit __main__ relative imports

2017-06-03 Thread Chris Angelico

Changes by Chris Angelico :


--
nosy: +Rosuav

___
Python tracker 

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



[issue30534] error message for incorrect call degraded in 3.7

2017-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is no respective type. abs() is just an arbitrary example. There are 
perhaps tens functions affected by this bug. test_exception_messages looks an 
overkill. There are similar tests in test_capi and test_getargs2 that test 
public PyArg_* functions. But this bug is related to other code.

Hmm, may be test_call is an appropriate test.

--

___
Python tracker 

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



[issue30558] [Suggestion] Improve documentation for set() API

2017-06-03 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +rhettinger
status: pending -> open

___
Python tracker 

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



[issue30560] Py_SetFatalErrorAbortFunc: Allow embedding program to handle fatal errors

2017-06-03 Thread Thomas Perl

New submission from Thomas Perl:

In our application that embeds a Python interpreter, we had the issue that 
certain system configurations (namely, a lone "libpython27.dll" without any 
standard library) caused silent failures (note that this is using Python 2.7, 
but Python 3.x would be similarly affected, as the Py_FatalError() handling is 
still the same):

https://github.com/gpodder/gpodder/issues/286

There exists a Stack Overflow thread about this:

https://stackoverflow.com/questions/7688374/how-to-i-catch-and-handle-a-fatal-error-when-py-initialize-fails

The workaround described therein is:

"I solved this by creating a separate executable that attempts to initialize 
python. My primary process will launch it and check the exit code and only call 
PyInitialize if the child process was successful. So, python is initialized 
twice, but it is better than an apparent crash to the user."

So, what if instead we allow the embedding program to set a function pointer to 
a function that will get called instead of abort()? We have to make clear in 
the docs that after this function is called, the Python interpreter cannot be 
used, and the application should probably exit, but at least it would allow 
applications to capture the error message and show it to the user (e.g. using a 
MessageBox() on Windows) before exiting -- see attached patch.

Any alternative solutions would be fine as well that don't require us to create 
a new process and "try to" Py_Initialize() there, especially since 
Py_FatalError() might potentially be called in other places and in all those 
cases, a user-visible dialog would be better than an apparent "crash" 
(application exits).

--
components: Interpreter Core
files: Py_SetFatalErrorAbortFunc.patch
keywords: patch
messages: 295098
nosy: thomas.perl
priority: normal
severity: normal
status: open
title: Py_SetFatalErrorAbortFunc: Allow embedding program to handle fatal errors
versions: Python 3.6
Added file: http://bugs.python.org/file46921/Py_SetFatalErrorAbortFunc.patch

___
Python tracker 

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



[issue30560] Py_SetFatalErrorAbortFunc: Allow embedding program to handle fatal errors

2017-06-03 Thread Thomas Perl

Thomas Perl added the comment:

Quick fix for the patch: Of course, the line with abort() needs to be removed 
before this block:

+if (_fatal_error_abort_func != NULL) {
+_fatal_error_abort_func(msg);
+} else {
+abort();
+}

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2017-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> www.pythonlabs.com still exists. (The www. is mandatory.)

But http://www.pythonlabs.com/logos.html doesn't. And since this link is a part 
of the BeOpen.com license, changing it changes the license. I don't know 
whether this part of the license is valid if the referred resource no longer 
available.

--

___
Python tracker 

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



[issue27321] Email parser creates a message object that can't be flattened

2017-06-03 Thread Mark Sapiro

Mark Sapiro added the comment:

I considered look before you leap, but I decided since we're munging the 
headers anyway, preserving their order is not that critical, but the patch is 
easy enough. I'll work on that and a test.

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2017-06-03 Thread Sanyam Khurana

Changes by Sanyam Khurana :


--
pull_requests: +2010

___
Python tracker 

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



[issue30561] sync-up gammavariate and expovariate code

2017-06-03 Thread Leonardo De Marchi

New submission from Leonardo De Marchi:

As suggested by rhettinger in http://bugs.python.org/msg294438:

I agree that the comment should be changed. While we at it, perhaps sync-up 
with expovariate() code and eliminate the ``u <= 1e-7`` test:

Instead of:

elif alpha == 1.0:
# expovariate(1)
u = random()
while u <= 1e-7:
u = random()
return -_log(u) * beta

Use this instead:

elif alpha == 1.0:
# expovariate(1.0 / beta)
return -_log(1.0 - random()) * beta

--
messages: 295102
nosy: leodema
priority: normal
severity: normal
status: open
title: sync-up gammavariate and expovariate code
type: performance

___
Python tracker 

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



[issue21783] smtpd.py does not allow multiple helo/ehlo commands

2017-06-03 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

This is now fixed in aiosmtpd HEAD (what will be 1.1)

I'm going to close this issue here even though smtpd.py isn't fixed since it's 
unlikely that anybody wants to keep working on smtpd.py.  Feel free to reopen 
it if you do.

--
resolution:  -> wont fix
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



[issue25910] Fixing links in documentation

2017-06-03 Thread Guido van Rossum

Guido van Rossum added the comment:

I can make the logos.html page appear. Just keep the link in the license as
it is.

On Jun 3, 2017 1:05 PM, "Sanyam Khurana"  wrote:

>
> Changes by Sanyam Khurana :
>
>
> --
> pull_requests: +2010
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue30561] sync-up gammavariate and expovariate code

2017-06-03 Thread Leonardo De Marchi

Changes by Leonardo De Marchi :


--
pull_requests: +2011

___
Python tracker 

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



[issue30464] gammavariate has a wrong comment

2017-06-03 Thread Leonardo De Marchi

Changes by Leonardo De Marchi :


--
pull_requests: +2012

___
Python tracker 

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



[issue30561] sync-up gammavariate and expovariate code

2017-06-03 Thread Leonardo De Marchi

Changes by Leonardo De Marchi :


--
pull_requests: +2014

___
Python tracker 

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



[issue27321] Email parser creates a message object that can't be flattened

2017-06-03 Thread Johannes Löthberg

Johannes Löthberg added the comment:

Fix: 
https://github.com/kyrias/cpython/commit/a986a8274a522c73d87360da6930e632a3eb4ebb
Testcase: 
https://github.com/kyrias/cpython/commit/9a510426522e1d714cd0ea238b14de0fc76862b2

Can start a PR once my CLA signature goes through I guess.

--

___
Python tracker 

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



[issue30562] SSL socket does not respect SO_RCVTIME0 timeouts

2017-06-03 Thread Allan Crooks

New submission from Allan Crooks:

I initially filed this ticket against the ldap3 library, as this is where I 
first encountered the issue: https://github.com/cannatag/ldap3/issues/356

I've attached a file which reproduces the issue using the standard library - it 
makes both a HTTP and HTTPS request to a link that should return a HTTP 
response after 10 seconds, but we set the socket option SO_RCVTIMEO to 2 
seconds. This should result in a read timeout while waiting for a response.

On my 64 bit Ubuntu 16.04 machine, the HTTP connection times out as expected, 
but the HTTPS connection doesn't time out at all (and so ends up reading the 
HTTP response).

It doesn't seem to be an issue specific to HTTPS - I ran into the original 
issue while using TLS for an LDAP connection using the ldap3 library. If you 
follow the comments in the ticket, a connection with SO_RCVTIMEO set to 3 
seconds ended up taking 1076 seconds to timeout, while on an OSX machine, it 
took 148 seconds to timeout. On a Windows machine, it seems to work just fine 
(it timed out after the desired 3 seconds).

Is this option fully supported for SSL sockets?

--
assignee: christian.heimes
components: SSL
files: httpdelay.py
messages: 295106
nosy: allanc, christian.heimes
priority: normal
severity: normal
status: open
title: SSL socket does not respect SO_RCVTIME0 timeouts
type: behavior
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file46922/httpdelay.py

___
Python tracker 

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



[issue27321] Email parser creates a message object that can't be flattened

2017-06-03 Thread Mark Sapiro

Mark Sapiro added the comment:

It looks like Johannes beat me to it. Thanks for that, but see my comments in 
the diff at 
https://github.com/kyrias/cpython/commit/a986a8274a522c73d87360da6930e632a3eb4ebb

--

___
Python tracker 

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



[issue27321] Email parser creates a message object that can't be flattened

2017-06-03 Thread Johannes Löthberg

Johannes Löthberg added the comment:

Ah, didn't even see your comment before I did it!  Fix to the comments are on 
the same branch, will be rebased before PR is up.

--

___
Python tracker 

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



[issue30319] ConnectionResetError: [Errno 54] Connection reset by peer in socket.close on FreeBSD, Py 3.6

2017-06-03 Thread Martin Panter

Martin Panter added the comment:

Making this an index of related reports:

Issue 30319: test_imap
Issue 30315: test_ftplib
Issue 30543: test_timeout
Issue 30328: test_ssl
Issue 27784: test_asyncore.TestAPI_UseIPv6Select.test_handle_accept, 
test_socketserver
Issue 30106: test_asyncore.TestAPI_UseIPv6Poll.test_handle_write

These all look like a side effect of my change to raise an error from the OS as 
an exception when closing a socket, Issue 26685. Only 3.6+ is affected. 
According to , ECONNRESET 
means “The underlying object was a stream socket that was shut down by the peer 
before all pending data was delivered”.

It seems this is specific to Free BSD. See bug report about Posix compliance: 
. According to 

 this started in Free BSD 6.3 in 2006.

I suppose the options are:

1. Completely revert Issue 26685 and ignore all “socket.close” errors (my least 
preferred option)
2. Ignore ECONNRESET in “socket.close” (backwards compatible, could use 
“os.close” if you really want to check for ECONNRESET)
3. Ignore ECONNRESET in the various higher-level libraries
4. Adjust the tests to ignore the error or otherwise avoid the problem

--
dependencies: +Random failure of test_TCPServer() of 
test.test_socketserver.SocketServerTest and test_handle_accept() of 
test.test_asyncore.TestAPI_UseIPv6Select on FreeBSD buildbots, test_asyncore: 
test_handle_write() fails in tearDown(), test_ftplib.TestTLS_FTPClass: "[Errno 
54] Connection reset by peer" on "AMD64 FreeBSD CURRENT Debug 3.x" buildbot, 
test_ssl.test_connect_with_context(): ConnectionResetError on AMD64 FreeBSD 9.x 
3.6, test_timeout fails on AMD64 FreeBSD CURRENT Debug 3.x: 
ConnectionResetError: [Errno 54] Connection reset by peer
keywords: +3.6regression
nosy: +martin.panter
title: test_invalid_authentication()  of test_imaplib: ConnectionResetError: 
[Errno 54] Connection reset by peer in shutdown() on AMD64 FreeBSD 9.x 3.6 -> 
ConnectionResetError: [Errno 54] Connection reset by peer in socket.close on 
FreeBSD, Py 3.6
type:  -> behavior

___
Python tracker 

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



[issue30315] test_ftplib.TestTLS_FTPClass: "[Errno 54] Connection reset by peer" on "AMD64 FreeBSD CURRENT Debug 3.x" buildbot

2017-06-03 Thread Martin Panter

Martin Panter added the comment:

See  about the “socket.close” 
exception, which should only affect 3.6+. But the 2.7 “recv” exception is a bit 
different.

--
nosy: +martin.panter

___
Python tracker 

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



[issue30558] [Suggestion] Improve documentation for set() API

2017-06-03 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This looks like an invalid request.

--
assignee: docs@python -> rhettinger

___
Python tracker 

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



[issue30538] Functional Programming HOWTO describes one argument itertools.count()

2017-06-03 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Is it code churn to replace the old style string formatting
> or is that something else that should be done as clean-up?

Let's leave it as is.  Old-style formatting is still valid and is not going 
away.   We consciously decided not to sweep through the docs change the string 
formatting style.  Also, since both occur quite a bit in the wild, it is is 
useful for the docs to show some of both.

--

___
Python tracker 

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



[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2017-06-03 Thread Jon Dufresne

Changes by Jon Dufresne :


--
pull_requests: +2015

___
Python tracker 

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



[issue15216] Add encoding & errors parameters to TextIOWrapper.reconfigure()

2017-06-03 Thread Nick Coghlan

Nick Coghlan added the comment:

`TextIOWrapper.reconfigure()` has been added for 3.7 as part of issue 30526 
(currently covering the `line_buffering` and `write_through` options), so I've 
updated the issue title here to reflect that that's now the relevant API to use 
to address this particular RFE.

--
title: Support setting the encoding on a text stream after creation -> Add 
encoding & errors parameters to TextIOWrapper.reconfigure()

___
Python tracker 

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



[issue24340] co_stacksize estimate can be highly off

2017-06-03 Thread Armin Rigo

Changes by Armin Rigo :


--
versions: +Python 3.7

___
Python tracker 

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



[issue29535] datetime hash is deterministic in some cases

2017-06-03 Thread Armin Rigo

Changes by Armin Rigo :


--
pull_requests: +2016

___
Python tracker 

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



[issue30563] multiprocessing module with pool object issue

2017-06-03 Thread Julien Verger

New submission from Julien Verger:

Hello,

i'm trying to use the sample code that is documented here: 
https://docs.python.org/2/library/multiprocessing.html
from multiprocessing import Pool

def f(x):
return x*x

if __name__ == '__main__':
p = Pool(5)
print(p.map(f, [1, 2, 3]))

This code behaves differently depending on the python version that i use.
I use 2 versions of python interpreter, first on my windows 7 OS and second in 
cygwin.
The code behaves normaly when i execute it on windows python version, but 
nothing seems to happen when i use python interpreter from cygwin.
Other objects than 'pool' seems to be impacted but this short exemple helps me 
to show how to reproduce quickly my issue.

Here are somme informations on the python versions that i'm using:
On the windows side:
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.  


On the cygwin side:
Python 2.7.13 (default, Mar 13 2017, 20:56:15)   
[GCC 5.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.

Please help

Regards

--
components: Library (Lib)
messages: 295114
nosy: Julien Verger
priority: normal
severity: normal
status: open
title: multiprocessing module with pool object issue
type: behavior
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