[issue32989] IDLE: Fix pyparse.find_good_parse_start and its bad editor call

2018-03-04 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I agree with limiting the scope to the None bug and the faulty call.  However, 
we should think of the None fix as primary, and the new test thereof as the 
primary test.  Fixing the None check exposes the call bug, which we also fix.  
I change the title here and on PR.

As you noted, the new editor TestCase is not directly relevant to testing the 
double fix except to show that there is no change in indent.  The way to do 
that is to pass None instead of the in-string function.  I did that 
(temporarily!) and the test passes, meaning that the indents are the same.  (I 
do however think some of them are dubious, and I want to mark those cases.)

We could have made editor tests that initially failed by exposing bod as an 
instance attribute (as we have done before), and including a longer test case 
for which bod is a positive int.  However, bod should remain local.

As an alternative, for experimentation, I added print(bod).  The values for the 
patch are 0, None, None, None, None, None, 0, 0, None.  I added '  a\n' to 
'Block opener - indents +1 level.' and changed the mark and the 5th 'None' 
became '4'.

The fact that passing None and _build_char_in_string_func(startatindex) result 
in the same indents raises the question of whether the call has any benefit in 
reducing net time after the followup call to get_continuation_type().  Maybe 
tomorrow I will try to write a good timeit test.

In the meanwhile, to get some idea of how well find_good_parse_start finds good 
parse starts, I restarted IDLE in a console with the print still added, loaded 
editor.py, and hit RETURN followed by UNDO, in various places. The first 
non-zero bod, 812, comes with the cursor at the end of 'def _sphinx_version():' 
 812 is probably the beginning of the line.  After "if __name__ == '__main__':" 
near the end, 1416.  After the final "run(_editor_window)", 1654.  The highest 
value I got in about 10 tries past the middle, 1931.  To me, this is 
pathetically bad.

I tried turning on CodeContext and got the same results where I tested.  bod 
should just be the beginning of the last context line.  I am not optimistic 
about timing results.

--
title: IDLE: Incorrect signature in call from editor to 
pyparse.find_good_parse_start -> IDLE: Fix pyparse.find_good_parse_start and 
its bad editor call

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2018-03-04 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I take it you want this reopened.  I have not touched IDLE 2.7 for over a year, 
but since a) there have been no complaints about the patch in released 3.6.3/4, 
b) we recommend the same tk 8.5.18 for both 2.7 and 3.6, and c) this is a 
crippling regression upon equipment upgrade, I will review and manually test on 
Windows a combined backport of both PRs first tested on a Linux or Mac system.  
It should be tested on a HiDPI system before a merge.

--
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue32857] tkinter after_cancel does not behave correctly when called with id=None

2018-03-04 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 74382a3f175ac285cc924a73fd758e8dc3cc41bb by Serhiy Storchaka 
(Cheryl Sabella) in branch 'master':
bpo-32857: Raise error when tkinter after_cancel() is called with None. 
(GH-5701)
https://github.com/python/cpython/commit/74382a3f175ac285cc924a73fd758e8dc3cc41bb


--

___
Python tracker 

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



[issue32857] tkinter after_cancel does not behave correctly when called with id=None

2018-03-04 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5738

___
Python tracker 

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



[issue32857] tkinter after_cancel does not behave correctly when called with id=None

2018-03-04 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5739

___
Python tracker 

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



[issue28716] Fractions instantiation revisited

2018-03-04 Thread Stefan Behnel

Stefan Behnel  added the comment:

Just FYI and as further motivation, I reimplemented this dedicated parser for 
quicktions (in Cython, so the timings and speedups are not comparable).

https://github.com/scoder/quicktions/commit/cc034e07325ec492decdb7b1bcca69246cc780fd

I was able to get another quite visible improvement by caching the values of 
"10 ** shift" for 0 <= shift < 58 in a tuple. Higher values are very unlikely 
in practice, and the memory size of a tuple with 58 values gives a nice 
multiple of the usual cache line size. (I originally stored 64 values in my 
commit but then cut it down later.)

https://github.com/scoder/quicktions/commit/c20add53dc4936d70eb0daa370946a600adddca9

I suspect that the difference won't be as big for the Python implementation, 
but it still seems worth a try.

The overall speedup that I got, compared to the initial regex implementation, 
is 50-70%.

[regex]  $ python3.7 -m timeit -s 'from quicktions import Fraction as F' 
'F("153456/789344")'
20 loops, best of 5: 1.19 usec per loop
[native] $ python3.7 -m timeit -s 'from quicktions import Fraction as F' 
'F("153456/789344")'
50 loops, best of 5: 593 nsec per loop

[regex]  $ python3.7 -m timeit -s 'from quicktions import Fraction as F' 
'F("15.3456789E+4")'
10 loops, best of 5: 2.3 usec per loop
[native] $ python3.7 -m timeit -s 'from quicktions import Fraction as F' 
'F("15.3456789E+4")'
50 loops, best of 5: 667 nsec per loop

It could be even higher if I additionally moved the int() integer parsing into 
Cython. Might try that at some point. But that's also not something that 
concerns the implementation in CPython.

--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue32857] tkinter after_cancel does not behave correctly when called with id=None

2018-03-04 Thread miss-islington

miss-islington  added the comment:


New changeset 73a43960c7be50e136c5482404980175cb99f611 by Miss Islington (bot) 
in branch '3.6':
bpo-32857: Raise error when tkinter after_cancel() is called with None. 
(GH-5701)
https://github.com/python/cpython/commit/73a43960c7be50e136c5482404980175cb99f611


--
nosy: +miss-islington

___
Python tracker 

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



[issue32857] tkinter after_cancel does not behave correctly when called with id=None

2018-03-04 Thread miss-islington

miss-islington  added the comment:


New changeset a5303dd9c263b337f02dda0038f2f5a10208140c by Miss Islington (bot) 
in branch '3.7':
bpo-32857: Raise error when tkinter after_cancel() is called with None. 
(GH-5701)
https://github.com/python/cpython/commit/a5303dd9c263b337f02dda0038f2f5a10208140c


--

___
Python tracker 

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



[issue32992] unittest: Automatically run coroutines in a loop

2018-03-04 Thread Petter Strandmark

New submission from Petter Strandmark :

I am wondering whether it would be useful for unittest.TestCase to 
automatically run test methods that are coroutines within the default asyncio 
loop.

Example:

class TestAsync(unittest.TestCase):

async def test_foo(self):
result = await foo()
self.assertEqual(result, 42)

the test runner would then run test_foo within the default loop. If needed, we 
could also add functionality for providing a loop other than the default to the 
test class.

It seems to me that this functionality would be pretty easy to add to 
Lib/unittest/case.py:615 .

Personally, I think it would be useful. Right now I have to append every test 
case with a personal @run_in_loop decorator and I think unittest.TestCase could 
do this for me without breaking anything.

--
components: Library (Lib)
messages: 313211
nosy: Petter Strandmark
priority: normal
severity: normal
status: open
title: unittest: Automatically run coroutines in a loop
type: enhancement

___
Python tracker 

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



[issue32993] issue30657 Incomplete fix

2018-03-04 Thread yao zhihua

New submission from yao zhihua :

Due to the incomplete fix for CVE-2011-1521, urllib and urllib2 exist for this 
vulnerability and I tested on the version of Python 3.4.8 (default, Mar 4 2018, 
20:37:04).I am sorry that I do not know how to fix it.

--
components: Library (Lib)
files: poc.py
messages: 313212
nosy: yao zhihua
priority: normal
severity: normal
status: open
title: issue30657 Incomplete fix
type: security
versions: Python 3.4
Added file: https://bugs.python.org/file47469/poc.py

___
Python tracker 

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



[issue28955] Not matched behavior of numeric comparison with the documentation

2018-03-04 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +easy
stage:  -> needs patch
type: behavior -> enhancement
versions: +Python 3.7, Python 3.8 -Python 3.5

___
Python tracker 

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



[issue32839] Add after_info as a function to tkinter

2018-03-04 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
dependencies: +tkinter after_cancel does not behave correctly when called with 
id=None

___
Python tracker 

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



[issue32933] mock_open does not support iteration around text files.

2018-03-04 Thread Anthony Flury

Change by Anthony Flury :


--
keywords: +patch
pull_requests: +5740
stage:  -> patch review

___
Python tracker 

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



[issue32839] Add after_info as a function to tkinter

2018-03-04 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

A few questions about returning the Python function name (specifically, how to 
derive it).  This doesn't address the open issue with what to do about a Tcl 
command not tied to a Python function.

1.  Serhiy wrote "and the API for restoring the original Python callable is 
private."  What is that API?

2.  In the _register method, the Tcl command name is the callback ID + the 
function name:
f = CallWrapper(callback, None, self._root).__call__
cbname = repr(id(f))
try:
callback = callback.__func__
except AttributeError:
pass
try:
cbname = cbname + callback.__name__
except AttributeError:
pass 
So, with the values returned from tk.call('after', 'info', id) as (script, 
type), the Python function should be the same as script.lstrip('0123456789').  
I'm not sure if that would be the best way to get the name back.

3.  In tkinter, there is a list created/added to during _register:
self._tclCommands.append(cbname)
where cbname is the Tcl command name (as defined by the code in q2 above).  
Would it be possible to change _tclCommands to a dict mapping Tcl command name 
to Python function name?  _tclCommands already has some logic around it, 
including .remove functions, so I think a dictionary would be more efficient 
for the exisitng purposes.  Since it's semi-private, is there a fear with 
backward compatibility if it changes from a list to a dict?  Is it better to 
add a new dict variable?

Thanks!

--

___
Python tracker 

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



[issue32820] Add __format__ method to ipaddress

2018-03-04 Thread Eric Osborne

Eric Osborne  added the comment:

I have pushed out new diffs.

* moved __format__ to _BaseAddress, where it should have been in the first
place
* redid format parser as regexp, as it was getting awfully complicated
* added support for 'X'
* added support for 's' by falling through to regular format()
* added IPv6 to the test suite

This was a decent-sized change, but all the tests pass so it looks OK to me.
As per request, I defer importing re and compiling the necessary regexp
until it's absolutely necessary. This is significantly slower than
importing re and compiling the regexp when ipaddress is imported.

localized compile and import
In [4]: %timeit f'{a:#_b}'
7.05 µs ± 34.2 ns per loop (mean ± std. dev. of 7 runs, 10 loops each)

toplevel compile and import
In [2]: %timeit f'{a:#_b}'
5.34 µs ± 17 ns per loop (mean ± std. dev. of 7 runs, 10 loops each)

Is this worth trying to get clever about? It doesn't matter in my use case,
and I could make a reasonable argument either way. I'm tempted to leave it
localized, as I can't imagine a case where formatting eleventy billion IP
addresses as padded binary is all that time-sensitive.  On the other hand,
I'm also not sure how Pythonic it is to stick an import statement 20 lines
deep in a dunder method, so I'm open to suggestions.

eric

--

___
Python tracker 

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



[issue32933] mock_open does not support iteration around text files.

2018-03-04 Thread Anthony Flury

Change by Anthony Flury :


--
pull_requests: +5741

___
Python tracker 

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



[issue32933] mock_open does not support iteration around text files.

2018-03-04 Thread Anthony Flury

Change by Anthony Flury :


--
pull_requests: +5742

___
Python tracker 

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



[issue32933] mock_open does not support iteration around text files.

2018-03-04 Thread bbayles

Change by bbayles :


--
nosy: +bbayles

___
Python tracker 

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



[issue32991] AttributeError in doctest.DocTestFinder.find

2018-03-04 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

The main questions I have before proceeding with creating tests relate to what 
interfaces Python wishes to support. Here's the decision tree I have in my head.

- Retain the change of adding a __file__ attribute to namespace packages for 
Python 3.7?
  yes:
  - Should inspect.getfile still raise a TypeError on a namespace package?
no:
- The NEWS file should reflect this change also.
- doctest.DocTestFinder.find should account for this change.
yes:
- Capture with a test and and restore that expectation.
  no:
  - The change should be reverted.
- Regardless, the test suite should capture and assert that 
doctest.DocTestFinder.find should succeed on a namespace package.

--

___
Python tracker 

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



[issue32933] mock_open does not support iteration around text files.

2018-03-04 Thread Anthony Flury

Change by Anthony Flury :


--
pull_requests: +5743

___
Python tracker 

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



[issue32991] AttributeError in doctest.DocTestFinder.find

2018-03-04 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I tried creating a test, but I'm struggling. I added [this 
patch](https://gist.github.com/e795a9a34594d202711aedf22c484af9), and tried to 
run it, but it's not being run.

```
$ ./python.exe Tools/scripts/run_tests.py 'test_doctest'
/Users/jaraco/Dropbox/code/public/cpython/python.exe -u -W default -bb -E -m 
test -r -w -j 0 -u all,-largefile,-audio,-gui test_doctest
Using random seed 3885464
Run tests in parallel using 6 child processes
0:00:00 load avg: 2.02 [1/1] test_doctest passed
1 test OK.

Total duration: 828 ms
Tests result: SUCCESS
```

I'm pretty sure doctest doesn't have any unit tests, but only functional tests 
exercising actual doctests.

I don't understand Python test framework enough to know how to create a 
discoverable unit test. I could use some help with how one could wire up the 
test_doctest module to run a unit test.

--

___
Python tracker 

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



[issue32993] issue30657 Incomplete fix

2018-03-04 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

@Yao, sorry, I don't understand it.
What is POC trying to demonstrate? How is it related to 
https://bugs.python.org/issue30657 

And CVE is this: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-1521

--
nosy: +orsenthil

___
Python tracker 

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



[issue28626] Tutorial: rearrange discussion of output formatting to encourage f-strings

2018-03-04 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

@akuchling

Would you be able to make a PR for this patch?  Thanks.

--
nosy: +csabella
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue32994] Building the html documentation is broken

2018-03-04 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

$ make html BLURB="python3 -m blurb"
mkdir -p build
Building NEWS from Misc/NEWS.d with blurb
PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees -D 
latex_elements.papersize=  . build/html 
Running Sphinx v1.5.6
loading pickled environment... not yet created

Theme error:
no theme named 'python_docs_theme' found (missing theme.conf?)
Makefile:43: recipe for target 'build' failed
make: *** [build] Error 1

--
components: Build
messages: 313219
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Building the html documentation is broken
type: behavior
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



[issue32994] Building the html documentation is broken

2018-03-04 Thread Ned Deily

Ned Deily  added the comment:

You need to install that component.  The easiest way is:

cd Doc
make venv
make html

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



[issue32994] Building the html documentation is broken

2018-03-04 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you! All works now.

I tried `make clean` before, but not `make venv`.

--

___
Python tracker 

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



[issue32854] Add ** Map Unpacking Support for namedtuple

2018-03-04 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue30974] Update os.samefile docstring to match documentation

2018-03-04 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +easy
stage:  -> needs patch
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue14266] pyunit script as shorthand for python -m unittest

2018-03-04 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Is there still interest in this?  Should it be converted to a PR for 3.8?

--
nosy: +csabella

___
Python tracker 

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



[issue14266] pyunit script as shorthand for python -m unittest

2018-03-04 Thread Ned Deily

Ned Deily  added the comment:

-0.5.  I have mixed feelings about this.  While I can see the utility of it, I 
think more recently we have been moving away from the concept of installed 
scripts for standard library features primarily because they are difficult to 
manage when there are multiple versions of Python installed and with virtual 
environments.  Speaking of which, how would this work in practice within venvs? 
And how would it work with the Windows launcher, py?

--
nosy: +ned.deily

___
Python tracker 

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



[issue30147] Change in re.escape output is not documented in whatsnew

2018-03-04 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +patch
pull_requests: +5744
stage: needs patch -> patch review

___
Python tracker 

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



[issue32991] AttributeError in doctest.DocTestFinder.find

2018-03-04 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

Okay. I've wired up some unittests in test_doctest, and with [this 
patch](https://gist.github.com/jaraco/ea992719ac931fa761a6e9ef7a354542), it now 
captures the failed expectation of this ticket.

--

___
Python tracker 

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



[issue32991] AttributeError in doctest.DocTestFinder.find

2018-03-04 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

And [this patch](https://gist.github.com/7184fa32670f2c6377ddeb710676) 
corrects the failure such that the test passes. It does so by restoring the 
expectation that inspect.getfile will once again raise a TypeError for these 
namespace packages (the yes/yes path in the decision tree). That's my 
recommendation going forward.

Feel free to review the work and apply the patches. As time permits, I may 
revisit the Developers Guide and learn the new process for submitting pull 
requests.

--

___
Python tracker 

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



[issue30147] Change in re.escape output is not documented in whatsnew

2018-03-04 Thread Ned Deily

Ned Deily  added the comment:


New changeset 18fd89246333bfa1b76c1623df689214f3ce2bf3 by Ned Deily (Cheryl 
Sabella) in branch 'master':
bpo-30147: Add re.escape changes to 3.7 What's New (GH-5978)
https://github.com/python/cpython/commit/18fd89246333bfa1b76c1623df689214f3ce2bf3


--
nosy: +ned.deily

___
Python tracker 

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



[issue30147] Change in re.escape output is not documented in whatsnew

2018-03-04 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5745

___
Python tracker 

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



[issue30147] Change in re.escape output is not documented in whatsnew

2018-03-04 Thread Ned Deily

Ned Deily  added the comment:


New changeset f92478d57a6b4014dcc0882d43b534fae1e7b929 by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
[3.7] bpo-30147: Add re.escape changes to 3.7 What's New (GH-5978) (GH-5979)
https://github.com/python/cpython/commit/f92478d57a6b4014dcc0882d43b534fae1e7b929


--

___
Python tracker 

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



[issue30147] Change in re.escape output is not documented in 3.7 whatsnew

2018-03-04 Thread Ned Deily

Ned Deily  added the comment:

Thanks, @csabella, for the PR!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: Change in re.escape output is not documented in whatsnew -> Change in 
re.escape output is not documented in 3.7 whatsnew
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



[issue32056] Improve exceptions in aifc, sunau and wave

2018-03-04 Thread Ned Deily

Ned Deily  added the comment:

> For any program which receive external file, to check the input file is 
> necessary to do, isn't it?

Yes and no.  wave.py is doing checking and can raise various exceptions.  So a 
well-designed program has to be prepared to handle exceptions when calling 
wave.py.  The suggested fix would provide a more specific error message and 
exception, rather than a division by zero one, but the net effect to the caller 
of wave.py is the same.

> And program error lead to security bug, that's not right?

No. Just because a program can terminate due to an uncaught exception is not by 
itself considered a security error.  See https://www.python.org/news/security/ 
for a discussion. In particular, "The general rule is any attack worth 
reporting via the security address must allow an attacker to affect the 
confidentiality, integrity and availability of the Python application or its 
system for which the attacker does not already have the capability."  As things 
stand now, if an application is vulnerable to a denial-of-service attack due to 
a faulty wav file, it is a failure in that application to be handling possible 
exceptions from wave.py, not a security issue in Python itself.

--

___
Python tracker 

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



[issue25197] Allow documentation switcher to change url to /3/ and /dev/

2018-03-04 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

With the current dropdown for the documentation switcher (it has dev, 
prerelease, and stable options) and the addition of the language switcher, I 
believe this issue may be out of date.  Can it be closed?  Thanks!

--
nosy: +csabella

___
Python tracker 

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



[issue32130] xml.sax parser validation sometimes fails when obtaining DTDs from https sites

2018-03-04 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue32989] IDLE: Fix pyparse.find_good_parse_start and its bad editor call

2018-03-04 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

> In the meanwhile, to get some idea of how well find_good_parse_start finds 
> good parse starts, I restarted IDLE in a console with the print still added, 
> loaded editor.py, and hit RETURN followed by UNDO, in various places. The 
> first non-zero bod, 812, comes with the cursor at the end of 'def 
> _sphinx_version():'  812 is probably the beginning of the line.  After "if 
> __name__ == '__main__':" near the end, 1416.  After the final 
> "run(_editor_window)", 1654.  The highest value I got in about 10 tries past 
> the middle, 1931.  To me, this is pathetically bad.

Print `startat` too.  `num_context_lines` isn't CodeContext (although I thought 
it was too); that's just unfortunate naming.  `num_context_lines` is just a 
list = [50, 500, 5000]. First it looks at the code going back 50 lines from the 
current line and it only sends the text to `find_good_parse_start()` from this 
line onward.  `bod` is calculated from that point, not from the beginning of 
the file.  Because the start point is always 50 lines back, `bod` seems to 
always be in a similar range once you get to line 50 or higher in the code.

It seems that the purpose of the parsing is to apply the translate, etc to as 
few lines as possible.  So, it tries to make sure it includes the openers (':' 
ending lines) and closers (return, pass, etc) and the beginning of the brackets 
and continuation lines.  The big thing is that it wants to make sure it's not 
in a string or comment.  So, I think the program almost overcompensates for the 
idea of a 'large string'.  It is very complex and very hard to figure out 
exactly what it is trying to accomplish, even with the comments.  Maybe modern 
computing power (compared to 2000) has made it such that translating a whole 
source file is quick enough to not need fancy parsing.  :-)

--

___
Python tracker 

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



[issue15631] Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders

2018-03-04 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue31658] xml.sax.parse won't accept path objects

2018-03-04 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue32993] issue30657 Incomplete fix

2018-03-04 Thread yao zhihua

yao zhihua  added the comment:

Okay my falut.I made the wrong issue.The issue is issue11662.Urlopen function 
can use the file protocol, when an attacker input file:///etc/passwd, it can 
leak the contents of the passwd file.

--

___
Python tracker 

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



[issue32993] issue11662 Incomplete fix

2018-03-04 Thread yao zhihua

Change by yao zhihua :


--
title: issue30657 Incomplete fix -> issue11662 Incomplete fix

___
Python tracker 

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



[issue17239] XML vulnerabilities in Python

2018-03-04 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue17318] xml.sax and xml.dom fetch DTDs by default

2018-03-04 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue32921] .pth files cannot contain folders with utf-8 names

2018-03-04 Thread R. David Murray

Change by R. David Murray :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue32991] AttributeError in doctest.DocTestFinder.find

2018-03-04 Thread Jason R. Coombs

Change by Jason R. Coombs :


--
keywords: +patch
pull_requests: +5746
stage:  -> patch review

___
Python tracker 

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



[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-03-04 Thread Thomas Wouters

Thomas Wouters  added the comment:

Re: Petr: we can't expect extension module authors to retroactively fix 
released modules. We can't even expect everyone to fix this for future 
releases; moving away from globals (which may not be specific to the Python 
extension module) may be a lot of effort. Just look at how much work it's 
taking to move CPython itself to stop using globals in so many places. And 
while it may be necessary for sub-interpreters (which is only the case for 
global state that's Python objects), many people just don't care about 
sub-interpreters.

Re: Stefan: the init function pointer isn't known until much later in the 
current process, and calculated from the module name. There is not currently a 
way to import a module with a different init function pointer. I don't think 
this warrants that much of a rewrite.

--

___
Python tracker 

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



[issue32871] Interrupt .communicate() on SIGTERM/INT

2018-03-04 Thread ajk225

ajk225  added the comment:

Is this still open?  If so, can I take this on as my first issue?

--
nosy: +ajk225

___
Python tracker 

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



[issue32993] issue11662 Incomplete fix

2018-03-04 Thread yao zhihua

yao zhihua  added the comment:

I also found a function without filtering file protocol.

poc:

import webbrowser
webbrowser.open('file:///etc/passwd')

--

___
Python tracker 

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



[issue32871] Interrupt .communicate() on SIGTERM/INT

2018-03-04 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

@ajk225 It may be useful to look at #25942 before working on this.

--
nosy: +izbyshev

___
Python tracker 

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



[issue32984] IDLE: set and unset __file__ for startup files

2018-03-04 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +5747
stage: needs patch -> patch review

___
Python tracker 

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



[issue32993] issue11662 Incomplete fix

2018-03-04 Thread yao zhihua

yao zhihua  added the comment:

I tried again, webbrowser module can only open file:///etc/passwd.

--

___
Python tracker 

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



[issue32984] IDLE: set and unset __file__ for startup files

2018-03-04 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

With the PR, IDLE behaves the same as Python on Windows.
   .../3x> python -m idlelib -r f:/python/a/tem2.py
(see original post for content of tem2.py)
prints __file__ instead of raising NameError, while
  >>> __file__ continues to raise NameError

Cheryl, I really expect the PR to work on linux, but can you manually test it 
anyway?  If you think the blurb needs rst markup and feel like adding some, go 
ahead.

--
nosy: +csabella
stage: patch review -> needs patch

___
Python tracker 

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