[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-09-28 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I'd imagine an equivalent of the 3.6 PR would work for 3.5.

Someone should look at how to do similar in 2.7 _if_ the project(s) that 
complained about the problem rely on such behavior in their last 2.7 compatible 
releases.

--

___
Python tracker 

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



[issue38306] High level API for loop.run_in_executor(None, ...)?

2019-09-28 Thread Paul Martin


Paul Martin  added the comment:

run_in_executor doesn't necessarily create a new thread each time so 
create_thread would be misleading. run_in_thread might be better.

--
nosy: +primal

___
Python tracker 

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



[issue38163] AsyncMock child mocks should detect their type

2019-09-28 Thread Lisa Roach


Change by Lisa Roach :


--
keywords: +patch
pull_requests: +16054
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16471

___
Python tracker 

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



[issue38313] Crash/No start

2019-09-28 Thread Gautam


New submission from Gautam :

Hi
Python in my Laptop used to work well but now a days i is not working in fact 
it wont even start. Even after pressing it for half an hour no screen would 
appear 
pls check

--
components: Windows
messages: 353482
nosy: Rick Grimes, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Crash/No start
type: crash
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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-09-28 Thread Larry Hastings


Larry Hastings  added the comment:

So, following this recent flurry of activity, all that remains are to sort out 
2.7 and 3.5.  3.5.8 is still in a holding pattern; at this point I think I'm 
going to insert another RC, so I can add the new version of expat.

Will a makes-everyone-happy PR appear for 3.5 soon?

--

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-28 Thread Tim Peters


Tim Peters  added the comment:

> call_func and remove are part of a reference cycle. A forced garbage
> collection breaks the cycle and removes the two objects, but they are
> not removed in the expected order:
>
> * first: call_func
> * then: remove
>
> The crash requires to destroy the objects in the reverse order

Victor, I'm not sure what you had in mind there, so please flesh it out if the 
following isn't clear?

In any case "like" the one you constructed, __del__  will always run first, 
with everything needed wholly intact.

Because tp_clear can leave an object in a useless (or worse) state, gc runs all 
finalizers and all weakref callbacks before tp_clear is run on anything.  
tp_clear is used only in delete_garbage, which is the last non-trivial thing gc 
does.  Before then, clears and deallocations happen only as side effects of 
refcounting semantics while running finalizers and callbacks.  So refcount 
precedence order is respected, and nothing will get torn down before its 
refcount hits 0.

At the time gc first calls tp_clear, the intent is that no non-trivial code 
will run again - just tp_clear implementations applying Py_CLEAR to objects' 
members, and deallocations happening as refcounts fall to 0.  No finalizers, no 
callbacks, none, ever ;-)

So what I saw your program doing wasn't just an accident relying on the order 
the objects happened to appear in the list.  Regardless of that order, gc 
forces __del__ to run before tp_clear is applied to anything, and the call_func 
instance is wholly intact when its __del__ runs.

--

___
Python tracker 

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



[issue38312] curses: add `set_tabsize` and `set_escdelay`

2019-09-28 Thread Ammar Askar


Ammar Askar  added the comment:

> I'd like to help with this, but I don't even know where to start with 
> argumentclinic -- any points would be greatly appreciated

Are you asking about argumentclinic in general or something specific to this 
bug? If it's something specific feel free to ignore the following:

You can find a basic tutorial on argumentclinic here 
https://docs.python.org/3/howto/clinic.html#basic-concepts-and-usage

Essentially, you'll be adding something along these lines into _cursesmodule.c

/*[clinic input]
_curses.set_escdelay
size: int
bla bla description for size.
/

One line description.

Extended description. Spanning over
multiple lines.
[clinic start generated code]*/

after which you can run `python3 Tools/clinic/clinic.py _cursesmodule.c` which 
will update the file and place the stub for the method in there.

--
nosy: +ammar2

___
Python tracker 

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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-09-28 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
versions:  -Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue38108] Everything in Mock should inherit from Base

2019-09-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16053
pull_request: https://github.com/python/cpython/pull/16470

___
Python tracker 

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



[issue38108] Everything in Mock should inherit from Base

2019-09-28 Thread Lisa Roach


Lisa Roach  added the comment:


New changeset 9a7d9519506ae807ca48ff02e2ea117ebac3450e by Lisa Roach in branch 
'master':
bpo-38108: Makes mock objects inherit from Base (GH-16060)
https://github.com/python/cpython/commit/9a7d9519506ae807ca48ff02e2ea117ebac3450e


--

___
Python tracker 

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



[issue38312] curses: add `set_tabsize` and `set_escdelay`

2019-09-28 Thread Anthony Sottile


New submission from Anthony Sottile :

https://linux.die.net/man/3/set_escdelay
https://linux.die.net/man/3/set_tabsize

I'd like to help with this, but I don't even know where to start with 
argumentclinic -- any points would be greatly appreciated

presumably I should also add getters for these as well to retrieve the global 
variable from the curses side?

--
components: Extension Modules
messages: 353477
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: curses: add `set_tabsize` and `set_escdelay`
versions: Python 3.9

___
Python tracker 

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



[issue38310] Opcode predictions for asserts, class definitions, and some calls.

2019-09-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the patch :-)

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



[issue38310] Opcode predictions for asserts, class definitions, and some calls.

2019-09-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset f185a73249189bc3b75b4dc26e9ec2990a587b17 by Raymond Hettinger 
(Brandt Bucher) in branch 'master':
bpo-38310: Predict BUILD_MAP_UNPACK_WITH_CALL -> CALL_FUNCTION_EX. (GH-16467)
https://github.com/python/cpython/commit/f185a73249189bc3b75b4dc26e9ec2990a587b17


--

___
Python tracker 

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



[issue38311] macOS sqlite 3 module build fix

2019-09-28 Thread David CARLIER


Change by David CARLIER :


--
components: Build
nosy: devnexen
priority: normal
pull_requests: 16052
severity: normal
status: open
title: macOS sqlite 3 module build fix
type: compile error
versions: Python 3.9

___
Python tracker 

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



[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-28 Thread Kit Yan Choi


Kit Yan Choi  added the comment:

I think Python does differentiate "test error" and "test failure" such that a 
test outcome state can be one of these: success, failure, error, skipped. One 
could refine these to six: expected success, unexpected success, expected 
failure, unexpected failure, error, skipped.


For example, in the documentation for failureException:

* failureException: determines which exception will be raised when
the instance's assertion methods fail; test methods raising this
exception will be deemed to have 'failed' rather than 'errored'.


Another evidence: unittest.runner.TextTestResult, there are methods called 
"addSuccess", "addError", "addFailure", "addSkip", "addExpectedFailure" and 
"addUnexpectedSuccess".


For example, this test outcome is marked as "FAILED":

def test(self):
x = 1
y = 2
self.assertEqual(x + y, 4)


==
FAIL: test (test_main.T)
--
Traceback (most recent call last):
  File "test_main.py", line 9, in test
self.assertEqual(x + y, 4)
AssertionError: 3 != 4


But the test outcome for this test is "ERROR":

def test(self):
x = 1
y = 2 + z  # NameError  
self.assertEqual(x + y, 4)


==
ERROR: test (test_main.T)
--
Traceback (most recent call last):
  File "test_main.py", line 8, in test
y = 2 + z  # NameError
NameError: global name 'z' is not defined


The issue here being "expectedFailure" converting "error" to "success", which 
is not expected, and is causing decorated tests to become unmaintained. While 
the rest of unittest differentiates "error" and "failure", expectedFailure does 
not. This is either a bug in the behaviour of expectedFailure, or a bug in the 
documentation for not being clear on the fact that unexpected error will be 
considered as expected failure (which I think is wrong).

--

___
Python tracker 

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



[issue38298] Base class of generic type has wrong `cls` argument in classmethods

2019-09-28 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Yes, it is unfortunately hard to support with the new design. Also note that 
this was previously discussed at https://github.com/python/typing/issues/629. I 
think we can close this, since the other issue has more context.

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



[issue38310] Opcode predictions for asserts, class definitions, and some calls.

2019-09-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue38310] Opcode predictions for asserts, class definitions, and some calls.

2019-09-28 Thread Brandt Bucher


Change by Brandt Bucher :


--
keywords: +patch
pull_requests: +16051
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16467

___
Python tracker 

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



[issue38310] Opcode predictions for asserts, class definitions, and some calls.

2019-09-28 Thread Brandt Bucher


New submission from Brandt Bucher :

This patch adds four new opcode predictions:

BUILD_MAP_UNPACK_WITH_CALL -> CALL_FUNCTION_EX:
 - Emitted whenever more than one map of **kwargs is unpacked into a call.
 - Pair *always* occurs together.

LOAD_BUILD_CLASS -> LOAD_CONST:
 - Emitted whenever a class is defined *without* the use of cell vars.
 - Occurs ~93% of the time, in my analysis.

LOAD_BUILD_CLASS -> LOAD_CLOSURE:
 - Emitted whenever a class is defined *with* the use of cell vars.
 - Occurs the other ~7% of the time

LOAD_ASSERTION_ERROR -> RAISE_VARARGS:
 - Emitted whenever the one-argument form of "assert" is used.
 - Occurs ~91% of the time.

--
components: Interpreter Core
messages: 353472
nosy: brandtbucher
priority: normal
severity: normal
status: open
title: Opcode predictions for asserts, class definitions, and some calls.
type: performance
versions: Python 3.9

___
Python tracker 

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



[issue38309] Avoid creating duplicate PATH entries with the macOS installer

2019-09-28 Thread Raymond Hettinger


New submission from Raymond Hettinger :

The macOS installer updates .bash_profile to add the current python version to 
the PATH.

The problem is that it doesn't check to see if that work has already been done 
in a previous installation.  So, as a person install successive beta releases, 
release candidates, a final release, and then maintenance releases, the PATH 
variable grows and grows.

As it stands now, a manual edit is required every after every update/upgrade.

--
assignee: ned.deily
components: Build
messages: 353471
nosy: ned.deily, rhettinger
priority: normal
severity: normal
status: open
title: Avoid creating duplicate PATH entries with the macOS installer
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

A test either passes or fails.  Like a not operator, the expectedFailure 
decorator inverts the result.

https://docs.python.org/3/library/unittest.html#unittest.expectedFailure
@unittest.expectedFailure
Mark the test as an expected failure. If the test fails it will be 
considered a success. If the test passes, it will be considered a failure.

By itself, your 'test' method fails.  Decorated, it should and does pass.

As you suggested, using expectedFailure is a blunt instrument that can be 
misleading if not used carefully and not reviewed when editing the module 
tested.  It is only used 7 times in test_xyz.py modules in the lib/test 
directory and subdirectories.

--
nosy: +ezio.melotti, michael.foord
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



[issue38308] Add optional weighting to statistics.harmonic_mean()

2019-09-28 Thread Raymond Hettinger

New submission from Raymond Hettinger :

Currently, harmonic_mean() is difficult to use in real applications because it 
assumes equal weighting.  While that is sometimes true, the API precludes a 
broad class of applications where the weights are uneven.

That is easily remedied with an optional *weights* argument modeled after the 
API for random.choices():

harmonic_mean(data, weights=None)


Examples


Suppose a car travels 40 km/hr for 5 km, and when traffic clears, speeds-up to 
60 km/hr for the remaining 30 km of the journey. What is the average speed?

>>> harmonic_mean([40, 60], weights=[5, 30])
56.0

Suppose an investor owns shares in each of three companies, with P/E 
(price/earning) ratios of 2.5, 3 and 10, and with market values of 10,000, 
7,200, and 12,900 respectively.  What is the weighted average P/E ratio for the 
investor’s portfolio?

>>> avg_pe = harmonic_mean([2.5, 3, 10], weights=[10_000, 7_200, 12_900])
>>> round(avg_pe, 1)
3.9


Existing workarounds


It is possible to use the current API for theses tasks, but it is inconvenient, 
awkward, slow, and only works with integer ratios:

>>> harmonic_mean([40]*5 + [60]*30)
56.0

>>> harmonic_mean([2.5]*10_000 + [3]*7_200 + [10]*12_900)
3.9141742522756826


Algorithm
-

Following the formula at 
https://en.wikipedia.org/wiki/Harmonic_mean#Weighted_harmonic_mean , the 
algorithm is straight forward:

def weighted_harmonic_mean(data, weights):
num = den = 0
for x, w in zip(data, weights):
num += w
den += w / x
return num / den


PR
--

If you're open to this suggestion, I'll work-up a PR modeled after the existing 
code and that uses _sum() and _fail_neg() for exactness and data validity 
checks.

--
assignee: steven.daprano
components: Library (Lib)
messages: 353469
nosy: rhettinger, steven.daprano
priority: normal
severity: normal
status: open
title: Add optional weighting to statistics.harmonic_mean()
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue38307] Provide Class' end line in readmodule module

2019-09-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

What `readmodule` are you referring to?

3.6 is in feature-freeze. The earliest that any enhancement could be added is 
version 3.9.

Can you explain how having an ending line number as well as the starting line 
number can be used to check which imports are used in a class?

--
nosy: +steven.daprano
versions: +Python 3.9 -Python 3.6

___
Python tracker 

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



[issue38307] Provide Class' end line in readmodule module

2019-09-28 Thread Aviral


New submission from Aviral :

Currently, the `readmodule` returns the starting line of the classes but not 
the end line. This should be provided as well in order to get the scope of the 
class, mainly to help check what all imports were used in a class.

--
components: Library (Lib)
messages: 353467
nosy: aviral
priority: normal
severity: normal
status: open
title: Provide Class' end line in readmodule module
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-28 Thread Kit Yan Choi


Kit Yan Choi  added the comment:

Pining Chris based on previous discussion in issue16997 ... Hope that's okay.

I notice that the language in my initial message also conflates error and 
failure. My apologies on the carelessness.

Just to clarify:


@unittest.expectedFailure
def test(self):
THIS_VARIABLE_IS_UNDEFINED  # ---> NameError


should give: ERROR (errors=1)
currently gives: OK (expected failures=1)


By fixing this, we can help projects to maintain their tests decorated with 
expectedFailure so that the tests remaining to be meaningful.

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue36274] http.client cannot send non-ASCII request lines

2019-09-28 Thread Ned Deily


Ned Deily  added the comment:


New changeset 5b18ce60b432d1dfa6f6988be07dd55646201a9b by Ned Deily (Jason R. 
Coombs) in branch '3.6':
[3.6] bpo-38216, bpo-36274: Allow subclasses to separately override validation 
and encoding behavior (GH-16448) (GH-16462)
https://github.com/python/cpython/commit/5b18ce60b432d1dfa6f6988be07dd55646201a9b


--

___
Python tracker 

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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-09-28 Thread Ned Deily


Ned Deily  added the comment:


New changeset 5b18ce60b432d1dfa6f6988be07dd55646201a9b by Ned Deily (Jason R. 
Coombs) in branch '3.6':
[3.6] bpo-38216, bpo-36274: Allow subclasses to separately override validation 
and encoding behavior (GH-16448) (GH-16462)
https://github.com/python/cpython/commit/5b18ce60b432d1dfa6f6988be07dd55646201a9b


--

___
Python tracker 

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



[issue38305] https://2.python-requests.org/ missing TLS certicate

2019-09-28 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report but this is not something relevant to this issue tracker. 
 A quick whois lookup for the domain did not reveal an owner.  Suggest you 
pursue by asking the PSF infrastructure team via an email to 
infrastructure-staff at python.org.

--
nosy: +ned.deily
resolution:  -> third party
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



[issue38035] shared_semaphores cannot be shared across unrelated processes

2019-09-28 Thread Ned Deily


Change by Ned Deily :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue38115] Invalid bytecode offsets in co_lnotab

2019-09-28 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

thanks Thomas!

--
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

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



[issue38115] Invalid bytecode offsets in co_lnotab

2019-09-28 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 36c6fa968016a46a39c3cdbd0a17ea5490dfa343 by Gregory P. Smith in 
branch '3.8':
bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079) (GH-16464)
https://github.com/python/cpython/commit/36c6fa968016a46a39c3cdbd0a17ea5490dfa343


--

___
Python tracker 

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



[issue38306] High level API for loop.run_in_executor(None, ...)?

2019-09-28 Thread Antoine Pietri


Antoine Pietri  added the comment:

Actually I don't think it's possible with the current implementation to cancel 
the concurrent.Future after a timeout, so maybe we should remove that argument. 
So, this signature instead:

async def create_thread(callable, *args, *, kwargs=None, loop=None)

--

___
Python tracker 

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



[issue37408] [DOC] Precise that Tarfile "format" argument only concerns writing.

2019-09-28 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
stage: patch review -> backport needed

___
Python tracker 

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



[issue37408] [DOC] Precise that Tarfile "format" argument only concerns writing.

2019-09-28 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
versions: +Python 3.8

___
Python tracker 

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



[issue37408] [DOC] Precise that Tarfile "format" argument only concerns writing.

2019-09-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16050
pull_request: https://github.com/python/cpython/pull/16465

___
Python tracker 

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



[issue37408] [DOC] Precise that Tarfile "format" argument only concerns writing.

2019-09-28 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset c5a7e0ce194c0eafe82eb3e431881012398e7d46 by Gregory P. Smith 
(Pascal Chambon) in branch 'master':
bpo-37408: Precise that Tarfile "format" argument only concerns writing. 
(GH-14389)
https://github.com/python/cpython/commit/c5a7e0ce194c0eafe82eb3e431881012398e7d46


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue38115] Invalid bytecode offsets in co_lnotab

2019-09-28 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +16049
pull_request: https://github.com/python/cpython/pull/16464

___
Python tracker 

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



[issue38115] Invalid bytecode offsets in co_lnotab

2019-09-28 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset c8165036f374cd2ee64d4314eeb2514f7acb5026 by Gregory P. Smith (T. 
Wouters) in branch 'master':
bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079)
https://github.com/python/cpython/commit/c8165036f374cd2ee64d4314eeb2514f7acb5026


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue38306] High level API for loop.run_in_executor(None, ...)?

2019-09-28 Thread Antoine Pietri


New submission from Antoine Pietri :

In 3.7 a lot of high level functions have been added to the asyncio API, but 
nothing to start blocking functions as non-blocking threads. You still have to 
call get_event_loop() then await loop.run_in_executor(None, callable). I think 
this pattern is *very* common and could use a higher level interface.

Would an API like this make sense?

async def create_thread(callable, *args, *, kwargs=None, loop=None, 
timeout=None)

Then it could just be used like this:

await asyncio.create_thread(my_blocking_read, 4096, timeout=10)

This API could wrap the run_in_executor in an asyncio.Task, that way
you wouldn't have to await it to start the thread. There's evidence
that this has confused people in the past:

https://stackoverflow.com/questions/54263558/is-asyncio-run-in-executor-specified-ambiguously

--
components: asyncio
messages: 353456
nosy: antoine.pietri, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: High level API for loop.run_in_executor(None, ...)?
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue34344] Fix the docstring for AbstractEventLoopPolicy.get_event_loop

2019-09-28 Thread Ido Michael


Ido Michael  added the comment:

I've fixed the documentation according to the thread.

Here's the PR: GH-16463

Ido

--
nosy: +Ido Michael

___
Python tracker 

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



[issue34344] Fix the docstring for AbstractEventLoopPolicy.get_event_loop

2019-09-28 Thread Ido Michael


Change by Ido Michael :


--
keywords: +patch
pull_requests: +16048
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16463

___
Python tracker 

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



[issue38035] shared_semaphores cannot be shared across unrelated processes

2019-09-28 Thread Ido Michael


Ido Michael  added the comment:

@ned.deily any thoughts?

I can start working on it.

Ido

--
nosy: +Ido Michael

___
Python tracker 

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



[issue36274] http.client cannot send non-ASCII request lines

2019-09-28 Thread miss-islington


miss-islington  added the comment:


New changeset 8f478b489ae11633d2609dff0ef21d0e1a857417 by Miss Islington (bot) 
in branch '3.8':
bpo-38216, bpo-36274: Allow subclasses to separately override validation and 
encoding behavior (GH-16448)
https://github.com/python/cpython/commit/8f478b489ae11633d2609dff0ef21d0e1a857417


--
nosy: +miss-islington

___
Python tracker 

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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-09-28 Thread miss-islington


miss-islington  added the comment:


New changeset 8f478b489ae11633d2609dff0ef21d0e1a857417 by Miss Islington (bot) 
in branch '3.8':
bpo-38216, bpo-36274: Allow subclasses to separately override validation and 
encoding behavior (GH-16448)
https://github.com/python/cpython/commit/8f478b489ae11633d2609dff0ef21d0e1a857417


--
nosy: +miss-islington

___
Python tracker 

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



[issue38305] https://2.python-requests.org/ missing TLS certicate

2019-09-28 Thread Tim Laurence


New submission from Tim Laurence :

I am unsure how to route this given the recent transition of Requests to PSF so 
my apologies if this is the wrong spot.

The page where I think most people look for Requests documentation appears to 
be broken 
  https://2.python-requests.org/

When I look more closely it looks like the server may not have a TLS 
certificate loaded. 

When I connect via http I get a redirection page to 
https://requests.kennethreitz.org/en/master/


Below is a dump of what openssl sees when trying to connect.

===
$ openssl s_client -connect 2.python-requests.org:443
CONNECTED(0005)
4608755308:error:14004438:SSL routines:CONNECT_CR_SRVR_HELLO:tlsv1 alert 
internal 
error:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-22.260.1/libressl-2.6/ssl/ssl_pkt.c:1205:SSL
 alert number 80
4608755308:error:140040E5:SSL routines:CONNECT_CR_SRVR_HELLO:ssl handshake 
failure:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-22.260.1/libressl-2.6/ssl/ssl_pkt.c:585:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 0 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol  : TLSv1.2
Cipher: 
Session-ID:
Session-ID-ctx:
Master-Key:
Start Time: 1569678290
Timeout   : 7200 (sec)
Verify return code: 0 (ok)
---

--
components: Library (Lib)
messages: 353452
nosy: timdaman
priority: normal
severity: normal
status: open
title: https://2.python-requests.org/ missing TLS certicate

___
Python tracker 

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



[issue38303] Make audioop PEP-384 compatible

2019-09-28 Thread Tyler Kieft


New submission from Tyler Kieft :

Working on a patch for this, will have it up in a couple days

--

___
Python tracker 

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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-09-28 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 80dd66ac278ecbabbf843526e3a56f5031da9562 by Jason R. Coombs in 
branch '3.7':
[3.7] bpo-38216, bpo-36274: Allow subclasses to separately override validation 
and encoding behavior (GH-16448) (GH-16461)
https://github.com/python/cpython/commit/80dd66ac278ecbabbf843526e3a56f5031da9562


--

___
Python tracker 

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



[issue36274] http.client cannot send non-ASCII request lines

2019-09-28 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 80dd66ac278ecbabbf843526e3a56f5031da9562 by Jason R. Coombs in 
branch '3.7':
[3.7] bpo-38216, bpo-36274: Allow subclasses to separately override validation 
and encoding behavior (GH-16448) (GH-16461)
https://github.com/python/cpython/commit/80dd66ac278ecbabbf843526e3a56f5031da9562


--

___
Python tracker 

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



[issue36274] http.client cannot send non-ASCII request lines

2019-09-28 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +16047
pull_request: https://github.com/python/cpython/pull/16462

___
Python tracker 

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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-09-28 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +16046
pull_request: https://github.com/python/cpython/pull/16462

___
Python tracker 

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



[issue36274] http.client cannot send non-ASCII request lines

2019-09-28 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +16045
pull_request: https://github.com/python/cpython/pull/16461

___
Python tracker 

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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-09-28 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +16044
pull_request: https://github.com/python/cpython/pull/16461

___
Python tracker 

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



[issue36274] http.client cannot send non-ASCII request lines

2019-09-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16043
pull_request: https://github.com/python/cpython/pull/16460

___
Python tracker 

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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-09-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16042
pull_request: https://github.com/python/cpython/pull/16460

___
Python tracker 

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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-09-28 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 7774d7831e8809795c64ce27f7df52674581d298 by Jason R. Coombs in 
branch 'master':
bpo-38216, bpo-36274: Allow subclasses to separately override validation and 
encoding behavior (GH-16448)
https://github.com/python/cpython/commit/7774d7831e8809795c64ce27f7df52674581d298


--

___
Python tracker 

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



[issue36274] http.client cannot send non-ASCII request lines

2019-09-28 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 7774d7831e8809795c64ce27f7df52674581d298 by Jason R. Coombs in 
branch 'master':
bpo-38216, bpo-36274: Allow subclasses to separately override validation and 
encoding behavior (GH-16448)
https://github.com/python/cpython/commit/7774d7831e8809795c64ce27f7df52674581d298


--

___
Python tracker 

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



[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-28 Thread Alex Shkop


Change by Alex Shkop :


--
keywords: +patch
pull_requests: +16041
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16459

___
Python tracker 

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



[issue37970] urllib.parse docstrings incomplete

2019-09-28 Thread Ido Michael


Ido Michael  added the comment:

Committed a PR: GH-16458

I've read all of the thread and changed the docstring to the latest suggestion 
by @zach.ware

Ido

--
nosy: +Ido Michael

___
Python tracker 

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



[issue37970] urllib.parse docstrings incomplete

2019-09-28 Thread Ido Michael


Change by Ido Michael :


--
keywords: +patch
pull_requests: +16039
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/16458

___
Python tracker 

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



[issue37404] asyncio sock_recv blocks on ssl sockets.

2019-09-28 Thread Ido Michael


Ido Michael  added the comment:

Fixed this issue since the CLA of the past user wasn't signed.

Added a check for the socket type in each of the methods: 
sock_recv, sock_recv_into, sock_sendall, sock_connect, sock_accept.

PR: GH-16457

--
nosy: +Ido Michael

___
Python tracker 

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



[issue37404] asyncio sock_recv blocks on ssl sockets.

2019-09-28 Thread Ido Michael


Change by Ido Michael :


--
pull_requests: +16037
pull_request: https://github.com/python/cpython/pull/16457

___
Python tracker 

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



[issue38297] Imports at top of module is often not used

2019-09-28 Thread Dominic Littlewood


Dominic Littlewood <11dlittlew...@gmail.com> added the comment:

I've slightly adjusted the script to check for module-level imports not at the 
top of the file. If we permit things like this:

if condition:
import module
else:
do_something_sensible()

as long as they are at the top of the file, it seems that only one in ten 
modules have a problem. Which is better but not great.

A common pattern which breaks the rules is this:

# Large amounts of code here

if __name__ == '__main__':
import unittest
unittest.main('test/test_thisfile')

although that by no means accounts for all of the problems.

--

___
Python tracker 

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



[issue35360] Update SQLite to 3.28 in Windows and macOS installer builds

2019-09-28 Thread Big Stone


Big Stone  added the comment:

there will be a security fix in sqlite-3.30 around October 10th.

https://nvd.nist.gov/vuln/detail/CVE-2019-16168#VulnChangeHistorySection

https://www.sqlite.org/draft/releaselog/3_30_0.html

--

___
Python tracker 

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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-09-28 Thread Lorenz Mende


Change by Lorenz Mende :


--
pull_requests: +16036
pull_request: https://github.com/python/cpython/pull/16456

___
Python tracker 

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-28 Thread Ned Deily


Ned Deily  added the comment:


New changeset 1698cacfb924d1df452e78d11a4bf81ae389 by Ned Deily (Victor 
Stinner) in branch '3.6':
bpo-38243, xmlrpc.server: Escape the server_title (GH-16373) (GH-16441)
https://github.com/python/cpython/commit/1698cacfb924d1df452e78d11a4bf81ae389


--
nosy: +ned.deily

___
Python tracker 

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



[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38301] If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-28 Thread Ned Deily


Change by Ned Deily :


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