[issue30303] IDLE: Add _utest to textview and add textview tests

2017-05-27 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests:  -1923

___
Python tracker 

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



[issue30290] IDLE: add tests for help_about.py

2017-05-27 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests:  -1922

___
Python tracker 

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



[issue30290] IDLE: add tests for help_about.py

2017-05-27 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +1927

___
Python tracker 

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



[issue30486] Allow setting cell value

2017-05-27 Thread Lisa Roach

Changes by Lisa Roach :


--
pull_requests: +1925

___
Python tracker 

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



[issue13349] Non-informative error message in index() and remove() functions

2017-05-27 Thread Nick Coghlan

Nick Coghlan added the comment:

While I agree it's reasonable to keep arbitrary value repr's out of these 
messages by default, I do think it would be desirable for someone sufficiently 
motivated to file a separate RFE about adding the value as a structured 
exception attribute so that custom sys.excepthook implementations and other 
"unhandled runtime exception" loggers may choose to handle the situation 
differently.

This wouldn't be about the cases where code is handling the remove() or index() 
call directly, but rather about those where third party library code isn't 
handling missing values correctly, so the debugging scenario a developer is 
faced with looks more like this than it does the examples in the OP here:

```
>>> some_library_function()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in some_library_function
  File "", line 2, in some_other_library_function
ValueError: list.remove(x): x not in list
```

Getting that kind of traceback in the logs for a production failure in a 
distributed system is all kinds of frustrating since you *know* the interpreter 
knew what "x" was when the error happened, it just isn't passing that 
information along to the developer that's trying to figure out how and why it 
broke.

--

___
Python tracker 

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



[issue30495] IDLE: modernize textview module

2017-05-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I plan to merge when checks pass.

Not reusing module names avoids noise when grepping for a module name ;-).  A 
final search for 'textview', match case, whole word, gave 18 hits, which were 
easy to check.

--

___
Python tracker 

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



[issue30290] IDLE: add tests for help_about.py

2017-05-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

pr 1839 is now attached to new issue #30495.  This issue is closed except for 
trivial bugs in the two merged PRs and backports.

--

___
Python tracker 

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



[issue30495] IDLE: modernize textview module

2017-05-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Grepping shows that other references to textview objects (other than in 
test_textview) are to unchanged class and function names.

--

___
Python tracker 

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




[issue30495] IDLE: modernize textview module

2017-05-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The initial patch, https://github.com/python/cpython/pull/1839, adds missing 
docstrings to textview and changes names to conform to PEP 8.  It was 
originally attached to #30290. I changed the bpo # in the title to 30495.  We 
will see if Belvedere bot corrects the linkage.

Cheryl: I forgot to mention something very important.  When we change 
externally accessible names  -- those of functions, classes, and attributes -- 
in module xyz (here textview), we must grep idlelib *recursively* to find 
modules and test modules that import xyz and then check all accesses to names 
within xyz to discover and fix any that we have broken.  (If everything were 
perfectly tested, discovery would be trivial: run test_idlelib.  But it is not, 
so we must grep.)

In this case, the change from textview.TextViewer.textView to 
textview.TextViewer.textview broke the  two copies of
   dialog._current_textview.textView.get('1.0', '1.end'))
in test_help_about.  Running test_idle, which should always be done before IDLE 
commits, would have caught this.  When Appveyor ran test_idle, it properly 
failed.  I am mystified the it did not in the Travis run.

I will change the attribute name to 'text' both to avoid confusion with the 
module name and since the value is a Text instance.  I will also change all the 
new uses of 'textview' as an attribute.

--

___
Python tracker 

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



[issue30495] IDLE: modernize textview module

2017-05-27 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +1924

___
Python tracker 

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



[issue30495] IDLE: modernize textview module

2017-05-27 Thread Terry J. Reedy

New submission from Terry J. Reedy:

First get issue #.

--
assignee: terry.reedy
components: IDLE
messages: 294622
nosy: csabella, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: IDLE: modernize textview module
type: enhancement
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



[issue30303] IDLE: Add _utest to textview and add textview tests

2017-05-27 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +1923

___
Python tracker 

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



[issue30494] python.exe crashed when open long path in windows 7

2017-05-27 Thread Eryk Sun

Eryk Sun added the comment:

Your example works fine for me in Windows 10, and I see no reason why it would 
fail in Windows 7. The crash dialog in your screenshot shows that the problem 
occurred in a DLL named "winhadnt.dll". I suspect that this is malware injected 
into the python.exe process. Even if it's part of a legitimately installed 
program on your machine, this DLL has nothing to do with Python, so I'm closing 
this issue as 3rd party. 

By the way, Python 2 doesn't completely support raw unicode strings. '\u' and 
'\U' are still parsed as Unicode escape sequences. You can use forward slash 
for the path literal instead. Then normalize the path to use backslash at 
runtime.

--
nosy: +eryksun
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type:  -> crash

___
Python tracker 

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



[issue30290] IDLE: add tests for help_about.py

2017-05-27 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Thanks Terry.  I've submitted a PR for the textview docstrings and PEP8 names 
and I'll work on the ttk conversion and the refactoring.

--

___
Python tracker 

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



[issue30290] IDLE: add tests for help_about.py

2017-05-27 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +1922

___
Python tracker 

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



[issue29626] Issue with spacing in argparse module while using help

2017-05-27 Thread Cheryl Sabella

Cheryl Sabella added the comment:

I submitted a PR for this based on paul.j3's suggested change:

  def _format_action_invocation(self, action):
   
   for option_string in action.option_strings:
   if len(args_string)>0:
parts.append('%s %s' % (option_string, args_string))
   else:
parts.append('%s' % option_string)
   

I created a test that would have duplicated the original issue and, with the 
change, no longer prints the extra blank.

To Serhiy's point, I'm not sure if an empty metavar makes sense since it's 
intention is to give the parser a way to refer to the expected arguments within 
the help messages. 

However, with no metavar at all, the help output is:
  -f FOO, --foo FOO

With metavar = '' (and this change), the output is:
-f, --foo 

With metavar = '' (and without this change), the output is:
-f , --foo

--
nosy: +csabella

___
Python tracker 

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



[issue30494] python.exe crashed when open long path in windows 7

2017-05-27 Thread aokaywe

New submission from aokaywe:

1. 
os.makedirs(ur'\\?\c:\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹')
2. 
open(ur'\\?\c:\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\t.txt','w')

you can see python was crashed.

--
components: Windows
files: python.png
messages: 294618
nosy: aokaywe, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: python.exe crashed when open long path in windows 7
versions: Python 2.7
Added file: http://bugs.python.org/file46907/python.png

___
Python tracker 

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



[issue30492] 'make clinic' does not work for out of tree builds / clinic.py is not in the devguide

2017-05-27 Thread Gregory P. Smith

Gregory P. Smith added the comment:


New changeset 178418ad6791b6ef5ba610ed93fab75fc1567ad2 by Gregory P. Smith in 
branch 'master':
bpo-30492: Allow make clinic to work out of tree. (#1836)
https://github.com/python/cpython/commit/178418ad6791b6ef5ba610ed93fab75fc1567ad2


--

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-05-27 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
nosy: +mbussonn

___
Python tracker 

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



[issue30290] IDLE: add tests for help_about.py

2017-05-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

While reviewing, I decided to draw a widget tree.  I believe it would have been 
easier if packs and grids were grouped.

I want to continue with 'IDLE: modernize help-about' and ditto for textview.  
The help_about issue can begin with ttk conversion: change imports and remove 
an invalid option or two.  The textview issue can begin with the still missing 
docstrings.  I want to refactor both the way I discussed in the roadmap issue: 
make separate Toplevel and Frame subclasses.  The Toplevel subclass instance 
creates a Frame subclass instance which becomes an attribute of the toplevel.  
Help.py already has this structure.

--
stage: needs patch -> commit review

___
Python tracker 

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



[issue29626] Issue with spacing in argparse module while using help

2017-05-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Does an empty metavar make sense? This makes the option with argument 
non-distinguising from the option without argument.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30493] Increase coverage of base64

2017-05-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Please don't change the code of base64. It is correct.

1. Python is a dynamically-typed language. Arbitrary exceptions can be raised 
in unexpected places. For example TypeError can be raised if `b[i:i + 5]` 
return non-iterable object.

2. `read(n)` of unbuffered object (like sys.stdin.buffer.raw or socket) can 
return less than n bytes.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue13349] Non-informative error message in index() and remove() functions

2017-05-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> I'm fine with not changing this

Thanks Brett.  I'm going to mark this as closed/rejected.  After five years, it 
is time to put it to rest and let it stop consuming our mental clock cycles.

> I don't think you're guaranteed to have access to the object
> that triggered the ValueError.

I'm not sure I follow what you're saying.  To call index() or remove() you 
already have to have the object to search for.   The ValueError is raised when 
the searched for object is not found, not by some unknown object inside the 
container.

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



[issue30431] input function truncates prompt by NULL byte

2017-05-27 Thread Eryk Sun

Eryk Sun added the comment:

The solution to raise a ValueError for the PyOS_Readline case won't change the 
behavior of input() in cases where the prompt is written to sys.stdout.

As to copying what print() would do, I guess it's possible to fake it for 
common platforms. You'd have to process the prompt string to emulate the 
platform behavior, which commonly means either ignoring '\0' or replacing it 
with space. However, this can't emulate raw console or terminal modes that 
actually write '\0'. 

A Linux terminal ignores '\0' characters written to it, e.g. "some\0text" 
prints as "sometext". I didn't look into modifying the terminal settings, but 
it wouldn't surprise me if different behavior is possible. 

The Windows console replaces '\0' with a space when the screen buffer is in the 
default cooked mode (i.e. ENABLE_PROCESSED_OUTPUT). For raw output it writes 
'\0' to the screen buffer, which displays like a space, but copy and paste 
won't work as expected.

> I am surprised it does not, as "input(prompt)" has been 
> described as shorthand for "print(prompt, end=''); input()"

That's how the fallback case works, such as in IDLE. In the readline case, it 
doesn't even write the prompt to C stdout. It gets written to stderr...

For Windows, if stderr is a console screen buffer, it transcodes the prompt 
from UTF-8 to UTF-16 and writes it via WriteConsoleW. Otherwise it calls 
fprintf to write it to stderr.

--

___
Python tracker 

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



[issue29626] Issue with spacing in argparse module while using help

2017-05-27 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue30493] Increase coverage of base64

2017-05-27 Thread Lee Cannon

Changes by Lee Cannon :


--
pull_requests: +1921

___
Python tracker 

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



[issue30493] Increase coverage of base64

2017-05-27 Thread Lee Cannon

New submission from Lee Cannon:

Added tests to ensure a85decode correctly handles the 'y' character within the 
byte like object when foldspaces is true.


While attempting to increase coverage I found two lines of code within 
base64.py that appear to never execute:
  - line 472
  - line 501


Line 472:
The only time the TypeError except block (line 467) executes is when _b85dec[c] 
resolves to None for one of the c (characters) in chunk.

Then within the except block the c (characters) within chunk are iterated 
through until the None is hit then a ValueError is raised (line 470). Making it 
impossible for line 472 to execute.


Line 501:
s is assigned a value in the expression `s = input.read(MAXBINSIZE)` (line 
494), due to this len(s) is only ever not equal to MAXBINSIZE if the end of 
input has been reached and nothing was read or the last chunk of data was read 
from input which has a len less than MAXBINSIZE but non-zero.

Therefore the only way to enter into the while loop (line 497) is if there are 
no more characters left to be read from input, yet all that happens in the 
while loop is the read function is called on input with a non zero parameter 
(`MAXBINSIZE-len(s)` must be greater than zero for the while to have executed) 
then when it returns nothing (it always will) execution breaks out of the while 
loop without modifiying s.

--
components: Tests
messages: 294611
nosy: leecannon
priority: normal
severity: normal
status: open
title: Increase coverage of base64
type: enhancement
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



[issue30386] Add a build infrastructure for Android

2017-05-27 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Details of commit "Add Makefile targets to implement the buildbot steps" in 
543a287c32a714a668e426ceb80f4add92cc5de4:

The following buildbot steps, as defined by the UnixBuild class of the 
master.cfg buildbot configuration file, have now their corresponding commands:
* Configure: makesetup configureFlags && make configure
* Compile:   make host
* Test:  make buildbottest
* Clean: make hostclean

The 'configure' Makefile target builds the native interpreter, the external 
libraries and runs configure for the target host on its first execution. 
Afterwards it mainly runs configure.  As it is, the native interpreter is not 
distclean(ed) by the above four steps and therefore changes made in Setup.dist 
are ignored by the successive rebuilds of the native interpreter.
The 'buildbottest' Makefile target invokes the 'buildbottest' target of the 
host Python Makefile and runs using also the variables: TESTPYTHONOPTS, 
TESTTIMEOUT, TESTOPTS.

The following changes have also been made:
* The new Makefile target 'kill_emulator' allows to shutdown the emulator.
* All the shell and python scripts are now copied to the emulator at 
/bin (i.e. /data/local/tmp/python/bin).
* The python_shell.sh script run by the user in interactive sessions 
('install', 'emulator', 'adb_shell') and the shell scripts run by the 'python' 
and 'buildbottest' targets now change the current directory to 
 (i.e. /data/local/tmp/python) instead of its parent 
previously.  As a result, the temporary files and directories left over by 
'buildbottest' are removed on the next run with the removal of the content of 
the previous  directory before the new installation.
* Fix file names whose size exceed MAX_FNAME_SIZE.

--

___
Python tracker 

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



[issue13349] Non-informative error message in index() and remove() functions

2017-05-27 Thread Brett Cannon

Brett Cannon added the comment:

I'm fine with not changing this, but I did want to say that I don't think 
you're guaranteed to have access to the object that triggered the ValueError. 
If the value that is searched for is in some extension module where it's 
calculated using C code then you have no way of accessing that value unless the 
extension module was nice enough to provide the object in the exception, give 
the repr in the exception message, or document how exactly the transformation 
from input to what you searched for is.

--

___
Python tracker 

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



[issue30290] IDLE: add tests for help_about.py

2017-05-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 5a346d5dbc1f0f70eca706a8ba19f7645bf17837 by terryjreedy 
(csabella) in branch 'master':
bpo-30290: IDLE: Refactor help_about to PEP8 names (#1714)
https://github.com/python/cpython/commit/5a346d5dbc1f0f70eca706a8ba19f7645bf17837


--

___
Python tracker 

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



[issue30492] 'make clinic' does not work for out of tree builds / clinic.py is not in the devguide

2017-05-27 Thread Gregory P. Smith

Gregory P. Smith added the comment:

My PR doesn't address the potential issue of needing to have done a make all 
before doing a make clinic.  I'll leave that for something else, there could be 
bootstrapping issues in that situation depending on what the developer is doing.

In that less common case, running clinic.py oneself under a stable python3 
interpreter is probably advisable.

The devguide docs still need to mention 'make clinic' and point to the argument 
clinic docs in some section talking about the Modules/ tree.

--

___
Python tracker 

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



[issue30492] 'make clinic' does not work for out of tree builds / clinic.py is not in the devguide

2017-05-27 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
pull_requests: +1920

___
Python tracker 

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



[issue13349] Non-informative error message in index() and remove() functions

2017-05-27 Thread Joe Jevnik

Changes by Joe Jevnik :


--
pull_requests: +1919

___
Python tracker 

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



[issue30477] tuple.index error message improvement

2017-05-27 Thread Brett Cannon

Changes by Brett Cannon :


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



[issue30492] 'make clinic' does not work for out of tree builds / clinic.py is not in the devguide

2017-05-27 Thread Gregory P. Smith

Gregory P. Smith added the comment:

The Makefile knows where the source tree is, I think we can make it tell 
clinic.py.  Let me whip something up.

--

___
Python tracker 

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



[issue29626] Issue with spacing in argparse module while using help

2017-05-27 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +1918

___
Python tracker 

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



[issue30492] 'make clinic' does not work for out of tree builds / clinic.py is not in the devguide

2017-05-27 Thread Larry Hastings

Larry Hastings added the comment:

I don't know how to fix it.  "make clinic" needs to be run in-tree anyway as 
it's modifying the C source code in place.

Can you suggest a patch?

--

___
Python tracker 

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



[issue16500] Allow registering at-fork handlers

2017-05-27 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
pull_requests: +1917

___
Python tracker 

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



[issue30492] 'make clinic' does not work for out of tree builds / clinic.py is not in the devguide

2017-05-27 Thread Gregory P. Smith

New submission from Gregory P. Smith:

I never do in-tree builds anymore because they make me feel dirty and leave 
build artifacts cluttering up my source tree.

make clinic does not work for out of tree builds.

To reproduce:

~$ git clone ...cpython repo...
~$ mkdir build && cd build
~/build$ ../cpython/configure --with-pydebug
~/build$ make clinic
./python -E ./Tools/clinic/clinic.py --make
./python: can't open file './Tools/clinic/clinic.py': [Errno 2] No such file or 
directory
Makefile:545: recipe for target 'clinic' failed
make: *** [clinic] Error 2

Per https://docs.python.org/3/howto/clinic.html it looks like I can just 
manually run clinic.py on the files I have modified.  Ideally the build system 
would take care of that for me.  But all I really want is a single command that 
keeps me up to date.

python3 Tools/clinic/clinic.py  appears to be that command.  Even if it isn't 
fixed for out of tree builds, use of clinic needs to be in the devguide.

--
assignee: docs@python
components: Argument Clinic, Documentation
messages: 294604
nosy: docs@python, gregory.p.smith, larry
priority: normal
severity: normal
stage: needs patch
status: open
title: 'make clinic' does not work for out of tree builds / clinic.py is not in 
the devguide
type: compile error
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



[issue13349] Non-informative error message in index() and remove() functions

2017-05-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thinking back over my 17 years of using Python, I really don't think this is 
needed at all.  I can't think of a single situation where it would have helped.

In some cases, the change would be detrimental to readability, introducing 
clutter into an otherwise clear error message.  The OP's example of 
"ValueError: 4 is not in list" is atypical. A more typical example would be 
"ValueError: <__main__.TensorElementPlaceholder object at 0x106489e48> is not 
in list".

As a Python instructor, I've become acutely aware that tracebacks already have 
usability issues due to visual clutter and an unpleasant overall appearance.  
IMO, this proposal would sometimes make it worse by adding more noise for the 
reader to filter out.

Brett's idea is an improvement to the original proposal. By attaching the 
object to the exception rather than squeezing its representation into the 
string, you avoid making the error message hard to read and avoid the 
speed/space costs from computing the __repr__ on arbitrary objects.  That said, 
I don't think there is any programmatic benefit to having the object in the 
exception.  When you call "a.remove(b)", you already have "b" and it would be 
pointless to re-extract it with "except ValueError as e:  b = e.args[-1]".

I'm also concerned that the proposed changes sweep across the core affecting 
code that has been deployed and stable for almost two decades.

Given the dubious benefits and potential detriments, I vote for declining this 
proposal and favoring the stable deployed code that has worked fine for many 
years.

--

___
Python tracker 

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



[issue22702] to improve documentation for join() (str method)

2017-05-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Do you think that's sufficient to fully resolve the request here,

Thanks Nick.  That will suffice.

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

___
Python tracker 

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



[issue30444] Add ability to change "-- more --" text in pager module

2017-05-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

My preference is to keep pydoc focused on its primary task.  

This proposal seems like "feature creep" and the benefit is of questionable 
importance.

--
nosy: +rhettinger

___
Python tracker 

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



[issue20210] Support the *disabled* marker in Setup files

2017-05-27 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
title: Provide configure options to enable/disable Python modules and 
extensions -> Support the *disabled* marker in Setup files

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2017-05-27 Thread Xavier de Gaye

Xavier de Gaye added the comment:


New changeset c0364fc7c2693fb070917ee62aeb8d2551710821 by xdegaye in branch 
'master':
bpo-20210: Support the *disabled* marker in Setup files (GH-132)
https://github.com/python/cpython/commit/c0364fc7c2693fb070917ee62aeb8d2551710821


--

___
Python tracker 

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



[issue30444] Add ability to change "-- more --" text in pager module

2017-05-27 Thread Gautam krishna.R

Gautam krishna.R added the comment:

Yes even if it was built for PyDoc why cant we can extend its functionality to 
make it work with others too, Without breaking its current functionality...

--

___
Python tracker 

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



[issue29828] Allow registering after-fork initializers in multiprocessing

2017-05-27 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Superseded by issue 16500, which has now been resolved!

--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Allow registering at-fork handlers

___
Python tracker 

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



[issue16500] Allow registering at-fork handlers

2017-05-27 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



[issue16500] Allow registering at-fork handlers

2017-05-27 Thread Antoine Pitrou

Antoine Pitrou added the comment:


New changeset 346cbd351ee0dd3ab9cb9f0e4cb625556707877e by Antoine Pitrou in 
branch 'master':
bpo-16500: Allow registering at-fork handlers (#1715)
https://github.com/python/cpython/commit/346cbd351ee0dd3ab9cb9f0e4cb625556707877e


--

___
Python tracker 

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



[issue30470] Deprecate invalid ctypes call protection on Windows

2017-05-27 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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

___
Python tracker 

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



[issue30470] Deprecate invalid ctypes call protection on Windows

2017-05-27 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 2ee91c8ad825079cdfc0d98f3f439f3b1c8ca471 by Mariatta in branch 
'3.6':
[3.6] bpo-30470: Deprecate invalid ctypes call protection on Windows. (GH-1810) 
(GH-1833)
https://github.com/python/cpython/commit/2ee91c8ad825079cdfc0d98f3f439f3b1c8ca471


--

___
Python tracker 

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



[issue30431] input function truncates prompt by NULL byte

2017-05-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

As near as I can tell, the patch introduces a regression.  The doc for 
input(prompt) says "If the prompt argument is present, it is written to 
standard output without a trailing newline."  The handling of the prompt is up 
to stdout.write and thence physical displays devices.  Python does not specify 
what happens with any particular character, including \r, \t, and astral chars.

C:\Users\Terry>python -c "import sys; sys.stdout.write('some\0 text\n')
some  text

The bug on Windows is that input('some\0 text\n') does not produce the same 
display.

--

___
Python tracker 

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



[issue30470] Deprecate invalid ctypes call protection on Windows

2017-05-27 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +1916

___
Python tracker 

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



[issue30470] Deprecate invalid ctypes call protection on Windows

2017-05-27 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset f931fd1c2ad969db72460d3ab41e3d1a4a62c371 by Mariatta in branch 
'master':
bpo-30470: Deprecate invalid ctypes call protection on Windows. (GH-1810)
https://github.com/python/cpython/commit/f931fd1c2ad969db72460d3ab41e3d1a4a62c371


--

___
Python tracker 

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



[issue29960] _random.Random state corrupted on exception

2017-05-27 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks Bryan and Serhiy.

--
resolution:  -> fixed
stage: backport needed -> 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



[issue29960] _random.Random state corrupted on exception

2017-05-27 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 1626a479e22db3d44bcd6736d571243433cb6d0e by Mariatta in branch 
'2.7':
[2.7] bpo-29960 _random.Random corrupted on exception in setstate(). … (#1289)
https://github.com/python/cpython/commit/1626a479e22db3d44bcd6736d571243433cb6d0e


--

___
Python tracker 

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



[issue29960] _random.Random state corrupted on exception

2017-05-27 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 94d8261d1ca3f0c551d9d43a4db342d806af7a6a by Mariatta in branch 
'3.6':
[3.6] bpo-29960 _random.Random corrupted on exception in setstate(). … (#1287)
https://github.com/python/cpython/commit/94d8261d1ca3f0c551d9d43a4db342d806af7a6a


--

___
Python tracker 

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



[issue29960] _random.Random state corrupted on exception

2017-05-27 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 440bc4f4b2690b99541e87bedfdb0dc4abbc0501 by Mariatta in branch 
'3.5':
[3.5] bpo-29960 _random.Random corrupted on exception in setstate(). … (#1288)
https://github.com/python/cpython/commit/440bc4f4b2690b99541e87bedfdb0dc4abbc0501


--
nosy: +Mariatta

___
Python tracker 

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



[issue30431] input function truncates prompt by NULL byte

2017-05-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Experiments running 3.6.1 on Windows in console:

>python -c "print('some\0 text')
some  text  # \0 printed as ' ', as determined by
# >python -c "for c in 'some  text': print(ord(c))" printing 32 32

>python -c "input('some\0 text')
some

In IDLE, both print full string with actual null byte.  As a result, attempting 
the ord() test above generates "SyntaxError: source code string cannot contain 
null bytes".  Cutting the output from IDLE and pasting here (FireFox) results 
in a truncated 'some'.

Conclusions: 
1. Python is emitting \0 to stdout.  That is what python should do when asked 
to, as documented.
2. Currently, if one wants to prompt with strings containing \0, use IDLE or a 
similar GUI-based shell.
3. input() should *not* reject prompts with \0
4. If \0 is a problem for a particular stdout, its handler could raise 
ValueError, or replace \0 with r'\0', or replace \0 with ' ' (as with print to 
Widows console.
5. When running in Windows console, the prompt output part of input(prompt) 
should treat \0 the same as print(prompt) does.  I am surprised it does not, as 
"input(prompt)" has been described as shorthand for "print(prompt, end=''); 
input()"

--
nosy: +terry.reedy

___
Python tracker 

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



[issue30310] tkFont.py assumes that all font families are encoded as ascii in Python 2.7

2017-05-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset a92adf8f0782a1ccdc68942767bdb357a9281b30 by Serhiy Storchaka in 
branch 'master':
bpo-30310: Add a test for non-ascii font family. (#1567) (#1832)
https://github.com/python/cpython/commit/a92adf8f0782a1ccdc68942767bdb357a9281b30


--

___
Python tracker 

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



[issue30398] Add a docstring for re.error

2017-05-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue30398] Add a docstring for re.error

2017-05-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset a815b5a100f38b883b08d39567c5557de2c19a53 by Serhiy Storchaka in 
branch '3.5':
[3.5] bpo-30398: Add a docstring for re.error. (GH-1647) (#1831)
https://github.com/python/cpython/commit/a815b5a100f38b883b08d39567c5557de2c19a53


--

___
Python tracker 

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



[issue30398] Add a docstring for re.error

2017-05-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset b52c68a5a3f546cbbe1589f8bb3e51bfd55a6c15 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30398: Add a docstring for re.error. (GH-1647) (#1830)
https://github.com/python/cpython/commit/b52c68a5a3f546cbbe1589f8bb3e51bfd55a6c15


--

___
Python tracker 

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



[issue30310] tkFont.py assumes that all font families are encoded as ascii in Python 2.7

2017-05-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1915

___
Python tracker 

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



[issue30398] Add a docstring for re.error

2017-05-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1914

___
Python tracker 

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



[issue30398] Add a docstring for re.error

2017-05-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1913

___
Python tracker 

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



[issue30398] Add a docstring for re.error

2017-05-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 12d6b5d156377c0877931a03ef2439dccb2f3711 by Serhiy Storchaka in 
branch 'master':
bpo-30398: Add a docstring for re.error. (#1647)
https://github.com/python/cpython/commit/12d6b5d156377c0877931a03ef2439dccb2f3711


--

___
Python tracker 

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



[issue30482] socket.getservbyname(), socket.getservbyport(), socket.getprotobyname() are not threadsafe

2017-05-27 Thread Nathaniel Smith

Changes by Nathaniel Smith :


--
nosy: +njs

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-05-27 Thread Nathaniel Smith

New submission from Nathaniel Smith:

A common problem when working with async functions is to attempt to call them 
but forget the 'await', which eventually leads to a 'Warning: coroutine ... was 
never awaited' (possibly buried in the middle of a bunch of traceback shrapnel 
caused by follow-on errors). This can be confusing, lead to spuriously passing 
tests, and generally isn't a great experience for the dev who makes the 
mistake. To improve this, I'd like to do things like have a test harness 
reliably detect when this has happened inside a test case, or have trio's main 
loop check occasionally to see if this has happened and immediately raise a 
useful error. (Unfortunately, it *doesn't* work to promote the warning to an 
error using the usual warnings filter machinery, because the warning is raised 
inside a __del__ method, which suppresses exception propagation.)

In principle this is possible with sys.setcoroutinewrapper, but that adds 
non-trivial runtime overhead to every async function invocation, which is 
something we'd like to avoid. (It's OK for a "debug mode", but "modes" are also 
a poor dev experience: they certainly have their place, but whenever possible 
it's much nicer to give a proper error in the first place instead of relying on 
the dev to realize they need to enable debug mode and then remember how to do 
it.)

Therefore I propose that CPython keep a thread-local counter of how many 
coroutine objects currently exist in a created-but-not-yet-started state -- so 
corofn.__call__ would increment this counter, and the first call to 
coroobj.__next__/send/throw would decrement it. And there's some way to access 
it e.g. via a magic function in the sys module. Then test harnesses can assert 
that this is zero, trio could occasionally poll this from its run loop and 
assert that it's zero, etc., with very low overhead.

(This is a slight modification of the version I discussed with Yury and others 
at PyCon last week; the previous request was to keep a count of how many times 
the "coroutine '...' was never awaited" warning had been emitted. The problem 
with the original idea is that the warning message doesn't fire until the 
garbage collector has collected the coroutine object, and that might not happen 
at a convenient time if we're using PyPy, or if there are cycles, or in a test 
where the missing 'await' eventually leads to an exception whose traceback pins 
the coroutine object in memory just long enough for the warning to be detected 
on the *next* test and confuse everyone. Thanks to Matthias Bussonnier for 
spurring the new idea, and see discussion here: 
https://github.com/python-trio/trio/issues/79#issuecomment-304364010)

--
components: asyncio
messages: 294584
nosy: giampaolo.rodola, haypo, ncoghlan, njs, yselivanov
priority: normal
severity: normal
status: open
title: Add a lightweight mechanism for detecting un-awaited coroutine objects
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



[issue30486] Allow setting cell value

2017-05-27 Thread Nick Coghlan

Nick Coghlan added the comment:

+1 from me, as this also has potential value in testing use cases and in 
dealing with some of the consequences of the zero-arg super() design (i.e. it 
will make the injected __class__ cell writable)

--

___
Python tracker 

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