[issue32920] Implement PEP 529 for os.getcwdb on Windows

2018-02-22 Thread Eryk Sun

New submission from Eryk Sun :

When reviewing issue 32904 I noticed that os.getcwdb still calls the CRT 
_getcwd function. Apparently this was overlooked when implementing PEP 529. For 
example:

>>> os.getcwd()
'C:\\Temp\\Lang\\αβγδ'
>>> os.getcwdb()
b'C:\\Temp\\Lang\\a\xdf?d'

Not only is the encoding wrong, but because the CRT uses GetFullPathNameA (the 
CRT's implementation of _getcwd is convoluted, IMO), the call fails if the 
current directory exceeds MAX_PATH. Python 3.6+ on Windows 10 otherwise 
supports long paths.

--
components: Library (Lib), Unicode, Windows
messages: 312620
nosy: eryksun, ezio.melotti, paul.moore, steve.dower, tim.golden, vstinner, 
zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Implement PEP 529 for os.getcwdb on Windows
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32917] ConfigParser writes a superfluous final blank line

2018-02-22 Thread TitanSnow

TitanSnow  added the comment:

**It's not final newline \n !**

Maybe what I said confused. The "final blank line"
does not mean the "final newline char".
It means an extra blank line after last line.

It might be clearer to represent it in a string::

'[section1]\nkey = value\n\n[section2]\nkey = value\n\n'

It has *two* \n at end. I think it should be only one.

--

___
Python tracker 

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



[issue30028] make test.support.temp_cwd() fork-safe

2018-02-22 Thread miss-islington

miss-islington  added the comment:


New changeset 694c5e0e1f7f23595fab314f26b89e241477ff18 by Miss Islington (bot) 
in branch '3.7':
bpo-30028: make test.support.temp_cwd() fork-safe (GH-1066)
https://github.com/python/cpython/commit/694c5e0e1f7f23595fab314f26b89e241477ff18


--
nosy: +miss-islington

___
Python tracker 

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



[issue32919] csv.reader() to support QUOTE_ALL

2018-02-22 Thread Pavel Shpilev

New submission from Pavel Shpilev :

It appears that in current implementation csv.QUOTE_ALL has no effect on csv. 
reader(), it only affects csv.writer(). I know that csv is a poorly defined 
format and all, but I think this might be useful to distinguish None and '' 
values for the sources that use such quoting.

Example:

"1","Noneval",,"9"
"2","Emptystr","","10"
"3","somethingelse","","8"

Reader converts all values in the third column to empty strings. The suggestion 
is to adjust reader's behaviour so when quoting=csv.QUOTE_ALL that would 
instruct reader to convert empty values (like the one in the first row) to None 
instead.

--
components: Extension Modules
messages: 312617
nosy: Pavel Shpilev
priority: normal
severity: normal
status: open
title: csv.reader() to support QUOTE_ALL
type: enhancement
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue32917] ConfigParser writes a superfluous final blank line

2018-02-22 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Oh, I forgot... even if it is decided that this trim_final_blankline parameter 
was desirable, the patch isn't sufficient to be accepted. You would need to 
also supply documentation and tests.

--

___
Python tracker 

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



[issue32917] ConfigParser writes a superfluous final blank line

2018-02-22 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Its not a superfluous blank line. It is standard convention for Unix tools to 
end text files (of which ini files are a kind of text file) with a final 
newline \n. There are various reasons for this, but it doesn't matter what 
those reasons are, the important thing is that it is (or at least, ought to be) 
intentional for the ini file to end with a \n.

It is not an error for the file to end with one (or more) blank lines, 
regardless of the platform; it is more convenient for all lines to a \n 
delimiter, rather than making the last line special.

I do not believe there is any good reason to complicate the code and the API 
with an unnecessary "trim_final_blankline" parameter, but even if there is a 
good reason, the default would have to be False to remain backwards compatible.

Unless you have a good reason why it should be considered an error for the INI 
file to end in a blank, this patch should be rejected, and instead we should 
have an explicit test to ensure that the INI file is always written with a 
final blank.

(Of course, when *reading* INI files, it should accept them either with or 
without final blank.)

--
nosy: +steven.daprano

___
Python tracker 

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



[issue32918] IDLE: make smart indent after comment line consistent

2018-02-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

So I am proposing _junkre = re.compile(r"(?:[ \t]*|##.*)\n").match with test 
change to match.

--
assignee:  -> terry.reedy
components: +IDLE
stage: patch review -> test needed

___
Python tracker 

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



[issue32918] IDLE: make smart indent after comment line consistent

2018-02-22 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +patch
pull_requests: +5602
stage: test needed -> patch review

___
Python tracker 

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



[issue32918] IDLE: make smart indent after comment line consistent

2018-02-22 Thread Terry J. Reedy

New submission from Terry J. Reedy :

https://docs.python.org/3/reference/lexical_analysis.html#blank-lines says "A 
logical line that contains only spaces, tabs, formfeeds and possibly a comment, 
is ignored" but notes that REPLs might not ignore them during interactive 
input.  The same is true of editors as lines are typed.  In particular, even a 
no-code comment line can suggest where a smart indenter should indent.  In any 
case, Python does not care what follows '#', and IDLE should not either (except 
when uncommenting-out lines). 

Suppose one types the following:

if 1:
if 2:
print(3)
#
#x
# x

Currently, IDLE indents 4 columns after '#' and '# x' and 8 columns after '#x'. 
If one moves the comments to the margin, the indents are 0 and 8 columns.  This 
is because pyparse.Parser._study2 ignores lines that match _junkre and _junkre 
only  matches comments with '#' followed by a non-space (/B) character.

I think that IDLE should generally assume that the comment starts on a legal 
column and that the comment will apply to the next line typed, which will have 
the same indent, and that the lack of space after '#' (there have been many 
such in idlelib) is preference, indifference, or error.

The only exception relevant to IDLE is '##' inserted at the beginning of code 
lines  to (temporarily) make them ignored.  If one places the cursor at the end 
of such a line and hits return to insert new lines, some indent is likely 
wanted if the line above is indented.  Matching '##.*\n' is easy enough.

Note that smart indent always uses the line above, if there is one, because 
there typically is not one below, and if there is, either choice is arbitrary 
and being smarter would cost time.  (This should be in revised doc.)

--
messages: 312613
nosy: csabella, terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: make smart indent after comment line consistent
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue20928] xml.etree.ElementInclude does not include nested xincludes

2018-02-22 Thread ruffsl

ruffsl  added the comment:

> Included file paths should be collected only along an inclusion path and not 
> across independent subtrees.

Yes, well put.

> Maybe we should add a "max_depth" parameter to limit the maximum recursion 
> depth, defaulting to e.g. 5, that users would have to pass in order to say "I 
> know what I'm doing".

Could that be set to false by the user, just in case we don't know beforehand 
how deep the rabbit hole goes, but we're feeling overly committed to see it 
through?

Not to detract from the ticket, but I'd just like to share to a question 
related to this topic about the expected behavior of Xinclude [1]. You could 
also see it as a use case example for the recursive import feature we are 
currently deciding, of which would help avoid one more non system library to 
workaround [2].

[1] https://stackoverflow.com/q/48857647/2577586
[2] 
https://github.com/ComArmor/comarmor/blob/856dd339b090c28e86206d4d6af0fac050618e74/comarmor/__init__.py#L116

--

___
Python tracker 

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



[issue17232] Improve -O docs

2018-02-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

We don't change the extension on optimised pyc files any more, we add an 
optimisation marker to the name without changing the file extension: 
https://www.python.org/dev/peps/pep-0488/

(This means `-O` and `-OO` don't tread on each other any more)

--

___
Python tracker 

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



[issue32912] Raise non-silent warning for invalid escape sequences

2018-02-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

+1 for the DeprecationWarning->SyntaxWarning->SyntaxError approach from me 
(especially as 3.7 will make the existing deprecation warning visible in 
interactive shells and __main__ modules by default).

--

___
Python tracker 

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



[issue30028] make test.support.temp_cwd() fork-safe

2018-02-22 Thread miss-islington

Change by miss-islington :


--
keywords: +patch
pull_requests: +5601

___
Python tracker 

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



[issue30028] make test.support.temp_cwd() fork-safe

2018-02-22 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset 33dddac00ba8d9b72cf21b8698504077eb3c23ad by Gregory P. Smith 
(Anselm Kruis) in branch 'master':
bpo-30028: make test.support.temp_cwd() fork-safe (GH-1066)
https://github.com/python/cpython/commit/33dddac00ba8d9b72cf21b8698504077eb3c23ad


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



[issue32917] ConfigParser writes a superfluous final blank line

2018-02-22 Thread TitanSnow

New submission from TitanSnow :

``ConfigParser.write()`` writes a superfluous final blank line.

Example::

import configparser
cp = configparser.ConfigParser()
cp['section1'] = {'key': 'value'}
cp['section2'] = {'key': 'value'}
with open('configparser.ini', 'w') as f:
cp.write(f)

The output file 'configparser.ini' will be:: (I added line number)

  1 [section1]
  2 key = value
  3 
  4 [section2]
  5 key = value 
  6 

with a superfluous final blank line.


Compare to ``GLib.KeyFile``::

import gi
gi.require_version('GLib', '2.0')
from gi.repository import GLib
kf = GLib.KeyFile()
kf.set_string('section1', 'key', 'value')
kf.set_string('section2', 'key', 'value')
kf.save_to_file('glib.ini')

The output file 'glib.ini' will be:: (I added line number)

  1 [section1]
  2 key=value
  3 
  4 [section2]
  5 key=value

without a superfluous final blank line.

--
components: Library (Lib)
files: final_blank_line.patch
keywords: patch
messages: 312608
nosy: tttnns
priority: normal
severity: normal
status: open
title: ConfigParser writes a superfluous final blank line
type: behavior
Added file: https://bugs.python.org/file47460/final_blank_line.patch

___
Python tracker 

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



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Please go ahead, but coordinate.  This issue contains miscellaneous pyparse 
issues that I thought of while reviewing the tests, plus Serhiy's idea.

There should be multiple PRs on dependency issues (which might have more than 
one closely related PR). #32905 and now #32916 are examples.  If you open a 
spinoff, I will assume that you are working on a PR.

--
dependencies: +IDLE: change 'str' to 'code' in idlelib.pyparse.PyParse and users

___
Python tracker 

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



[issue32916] IDLE: change 'str' to 'code' in idlelib.pyparse.PyParse and users

2018-02-22 Thread Terry J. Reedy

New submission from Terry J. Reedy :

Change 'str' to 'code' in pyparse and code that uses it.  'str' conflicts with 
the built-in name and it too general for 'the block of python code being 
processed'.  'code' is what the string is.  The change applies to local 'str', 
'self.str' references, and the 'set_str' method.  The latter requires renames 
in other modules.  From grep:

F:\dev\3x\lib\idlelib\editor.py: 1305: y.set_str(rawtext)
F:\dev\3x\lib\idlelib\editor.py: 1319: y.set_str(rawtext)
F:\dev\3x\lib\idlelib\hyperparser.py: 47:
  parser.set_str(text.get(startatindex, stopatindex)+' \n')
F:\dev\3x\lib\idlelib\hyperparser.py: 63:
  parser.set_str(text.get(startatindex, stopatindex)+' \n')

editor imports pyparse and calls Parser once in 
  y = pyparse.Parser...
and never references y.str

hyperparser imports pyparse and calls Parser once in
  parser = pyparse.Parser...
and does reference the modifies parser.str once in line 67
  self.rawtext = parser.str[:-2]

set_str is not called within pyparse itself

The existing pyparse tests are sufficient for pyparse since they execute every 
line containig 'str'.  The hyperparser test covers the above lines in 
Hyperparser.__init__, but test_editor covers almost nothing and would miss the 
editor lines.

The two files access various methods and the editor code, the C_ constants, so 
I am not inclined to change names that are not so actively obnoxious.

Since this will impact other pyparse changes, I think it should be next. 
Cheryl, respond here if you want to do the PR.

--
assignee: terry.reedy
components: IDLE
messages: 312606
nosy: csabella, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: change 'str' to 'code' in idlelib.pyparse.PyParse and users
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32901] Update 3.7 and 3.8 Windows and macOS installer builds to tcl/tk 8.6.8

2018-02-22 Thread Steve Dower

Change by Steve Dower :


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

___
Python tracker 

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



[issue9635] Add Py_BREAKPOINT and sys._breakpoint hooks

2018-02-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Did PEP553 make this issue obsolete?

--
nosy: +csabella

___
Python tracker 

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



[issue32915] Running Python 2 with -3 flag doesn't complain about cmp/__cmp__

2018-02-22 Thread Trey Hunner

New submission from Trey Hunner :

I might be misunderstanding the use of the -3 flag, but it seems like cmp() and 
__cmp__ should result in warnings being displayed.

--
components: 2to3 (2.x to 3.x conversion tool)
files: caseless.py
messages: 312604
nosy: trey
priority: normal
severity: normal
status: open
title: Running Python 2 with -3 flag doesn't complain about cmp/__cmp__
versions: Python 2.7
Added file: https://bugs.python.org/file47459/caseless.py

___
Python tracker 

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



[issue25170] 3.4.4, 3.4.5, 3.5.0, 3.5.1, 3.5.2 documentation archives missing

2018-02-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

It appears that all the docs from the issue title (and the subsequent releases) 
exist on https://www.python.org/ftp/python/doc/ now, except that the 3.5.0 ones 
are for alpha releases instead of the final.  Larry mentioned that in 
msg271236.  Not sure if fixing that is something that can still be done or if 
this issue can be closed as resolved?

Thanks!

--
nosy: +csabella

___
Python tracker 

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



[issue32914] python3-config --ldflags gives a CMP0004 error due to a whitespace

2018-02-22 Thread Stig-Ørjan Smelror

New submission from Stig-Ørjan Smelror :

Hi.

I bumped into an interesting compilation issue when I was compiling ecFlow with 
Python 3 support.

It turns out that python3-config --ldflags gave me this:
" -L/usr/lib64 -lpython3.6m -lpthread -ldl  -lutil -lm  -Xlinker 
-export-dynamic"

This caused a CMP0004 error due to the space before -L.

With this patch applied, the command gives me:
"-L/usr/lib64  -lpython3.6m -lpthread -ldl  -lutil -lm  -Xlinker 
-export-dynamic"

Attached is the patch I made to fix this issue. It's as simple as moving 
$LIBPLUSED one place so that -L$libdir is first.

--
components: Library (Lib)
files: python3-3.6.2-python3-config-LIBPLUSED-cmp0004-error.patch
keywords: patch
messages: 312602
nosy: kekePower
priority: normal
severity: normal
status: open
title: python3-config --ldflags gives a CMP0004 error due to a whitespace
type: compile error
versions: Python 3.6
Added file: 
https://bugs.python.org/file47458/python3-3.6.2-python3-config-LIBPLUSED-cmp0004-error.patch

___
Python tracker 

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



[issue30935] document the new behavior of get_event_loop() in Python 3.6

2018-02-22 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
stage: needs patch -> patch review
type:  -> enhancement

___
Python tracker 

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



[issue26018] documentation of ZipFile file name encoding

2018-02-22 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +easy
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



[issue19412] Add docs for test.support.requires_docstrings decorator

2018-02-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I added `HAVE_DOCSTRINGS`,`MISSING_C_DOCSTRINGS`, `requires_docstring` to the 
test.support documentation under issue11015.  Additional changes to those three 
have been made under issue32843, so I am closing this issue in favor of 
issue32843.  Please comment on that PR if the wording still needs to be 
adjusted.  Thanks!

--
nosy: +csabella
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> More revisions to test.support docs

___
Python tracker 

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



[issue17232] Improve -O docs

2018-02-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Cheryl: yes, with changes in responses to Ezio's review.

Nick or Antoine: has there been any change to meaning of -O or -OO that I am 
not remembering?

--
versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue18356] help(numpy) causes segfault on exit

2018-02-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

It appears that the suggested change from SO was implemented under issue23374 
and issue23792.  I cannot recreate this on Ubuntu 16.04, so closing as resolved.

--
assignee: docs@python -> 
nosy: +csabella
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



[issue32901] Update 3.7 and 3.8 Windows and macOS installer builds to tcl/tk 8.6.8

2018-02-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Is "this will only be useful on Windows," in the source-deps readme still true? 
It appears that the tcl/tk tar.gz source is meant for Mac also.  (IE, has Xcode 
project files.)
https://tcl.tk/software/tcltk/download.html

Looking ahead, there is an 8.7a1 release.  I am hoping that 8.7 will be 
available for our 3.8, as it should include a rewritten Text widget that, among 
other things, will fix the slow long lines problem.  Do we wait for 8.7 final 
or do we start testing and, if necessary, adapting _tkinter and tkinter with, 
say, their .b1?

--

___
Python tracker 

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



[issue17232] Improve -O docs

2018-02-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Should I make a pull request for Terry's last patch?

--
nosy: +csabella

___
Python tracker 

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



[issue32489] Allow 'continue' in 'finally' clause

2018-02-22 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +5599

___
Python tracker 

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



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-02-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 520b7ae27e39d1c77ea74ccd1b184d7cb43f9dcb by Serhiy Storchaka in 
branch 'master':
bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter to 
compiler. (GH-5006)
https://github.com/python/cpython/commit/520b7ae27e39d1c77ea74ccd1b184d7cb43f9dcb


--

___
Python tracker 

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



[issue32913] Improve regular expression HOWTO

2018-02-22 Thread Joshua Li

Change by Joshua Li :


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

___
Python tracker 

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



[issue32457] Windows Python cannot handle an early PATH entry containing ".." and python.exe

2018-02-22 Thread Steve Dower

Steve Dower  added the comment:


New changeset 1d3c518c5ecbd78478738f068f4f035f81f035f9 by Steve Dower in branch 
'3.6':
bpo-32457: Improves handling of denormalized executable path when launching 
Python (GH-5756) (#5818)
https://github.com/python/cpython/commit/1d3c518c5ecbd78478738f068f4f035f81f035f9


--

___
Python tracker 

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



[issue32901] Update 3.7 and 3.8 Windows and macOS installer builds to tcl/tk 8.6.8

2018-02-22 Thread Steve Dower

Steve Dower  added the comment:

Still working on this - X11 and the WinSDK aren't playing nicely together. I 
might need a special build configuration to build this, or to submit fixes (and 
apply patches) to Tk.

--

___
Python tracker 

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



[issue32838] Fix Python versions in the table of magic numbers

2018-02-22 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5595

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-02-22 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5596

___
Python tracker 

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



[issue32838] Fix Python versions in the table of magic numbers

2018-02-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 4af8fd561433826ac897c55e41a087a5c5dbacf3 by Serhiy Storchaka in 
branch 'master':
bpo-32838: Fix Python versions in the table of magic numbers. (#5658)
https://github.com/python/cpython/commit/4af8fd561433826ac897c55e41a087a5c5dbacf3


--

___
Python tracker 

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



[issue32913] Improve regular expression HOWTO

2018-02-22 Thread Joshua Li

New submission from Joshua Li :

"Python HOWTOs are documents that cover a single, specific topic, and attempt 
to cover it fairly completely."

It would be quite helpful if the section "non-capturing-and-named-groups" in 
the regex HOWTO contained at least a mention and short usage example of the 
re.match.groupdict method, something I have found to be pythonic and useful, 
yet it does not appear frequently in the docs.

I will be submitting a PR for this.

--
assignee: docs@python
components: Documentation
messages: 312592
nosy: JoshuaRLi, docs@python
priority: normal
severity: normal
status: open
title: Improve regular expression HOWTO
type: enhancement

___
Python tracker 

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



[issue32901] Update 3.7 and 3.8 Windows and macOS installer builds to tcl/tk 8.6.8

2018-02-22 Thread Steve Dower

Steve Dower  added the comment:

I'm already most of the way through doing the sources this time - just running 
into ssh/GitHub troubles getting them online.

--

___
Python tracker 

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



[issue32909] ApplePersistenceIgnoreState warning on macOS

2018-02-22 Thread Ned Deily

Ned Deily  added the comment:

I don't know much about this but it seems to be due to the application Resume 
feature added in OS X 10.7 and has to do with the persistence of application 
windows.  Python itself does not create any such windows; they are created by 
the GUI toolkits used in Python applications, like Tk (used by the standard 
library tkinter) or other third-party modules that interface to other toolkits 
(PyQT, PyObjC, etc). I took a quick look and didn't see any application bundle 
keys that could be added to the Python.app Info.plist to disable persistence 
globally in a Python framework build and, even if there were one, I'm not sure 
that is desirable.  Perhaps the best way is for each tool kit to do it.  
Ronald, anyone else: have any suggestions?

https://developer.apple.com/library/content/documentation/DataManagement/Conceptual/DocBasedAppProgrammingGuideForOSX/StandardBehaviors/StandardBehaviors.html

--

___
Python tracker 

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



[issue32900] Teach pdb to step through asyncio et al.

2018-02-22 Thread ppperry

Change by ppperry :


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



[issue32457] Windows Python cannot handle an early PATH entry containing ".." and python.exe

2018-02-22 Thread Steve Dower

Change by Steve Dower :


--
pull_requests: +5594

___
Python tracker 

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



[issue32900] Teach pdb to step through asyncio et al.

2018-02-22 Thread Matthias Urlichs

Matthias Urlichs  added the comment:

Ah. Thank you for pointing me to that feature, I completely missed it.

The proposed enhancement thus boils down to "implement a couple of pdb commands 
to display and modify this skip list". I'm +1 on keeping the default empty.

When you're already in the debugger, mired in the guts of an intractable bug, 
restarting it all just to set up a skip list isn't sufficient.

--

___
Python tracker 

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



[issue32911] Doc strings omitted from AST

2018-02-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It may be worth to include docstrings explicitly in the grammar.

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

___
Python tracker 

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



[issue32912] Raise non-silent warning for invalid escape sequences

2018-02-22 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ncoghlan, r.david.murray, serhiy.storchaka

___
Python tracker 

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



[issue32457] Windows Python cannot handle an early PATH entry containing ".." and python.exe

2018-02-22 Thread miss-islington

miss-islington  added the comment:


New changeset e5a9b3574c89a070fbc43caf541759f504e3d492 by Miss Islington (bot) 
in branch '3.7':
bpo-32457: Improves handling of denormalized executable path when launching 
Python (GH-5756)
https://github.com/python/cpython/commit/e5a9b3574c89a070fbc43caf541759f504e3d492


--
nosy: +miss-islington

___
Python tracker 

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



[issue32901] Update 3.7 and 3.8 Windows and macOS installer builds to tcl/tk 8.6.8

2018-02-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I'll give it a shot.  :-)

--
nosy: +csabella

___
Python tracker 

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



[issue32556] support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname

2018-02-22 Thread miss-islington

miss-islington  added the comment:


New changeset 01dd52fb29566893dde59dea7bca582625c04762 by Miss Islington (bot) 
in branch '3.7':
bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage now 
correctly convert from bytes. (GH-5761)
https://github.com/python/cpython/commit/01dd52fb29566893dde59dea7bca582625c04762


--
nosy: +miss-islington

___
Python tracker 

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



[issue32901] Update 3.7 and 3.8 Windows and macOS installer builds to tcl/tk 8.6.8

2018-02-22 Thread Zachary Ware

Zachary Ware  added the comment:

True :).  I'll get the sources up if I get a chance to do it before you do.

(Anyone else can feel free to take a crack at it as well, see 
https://github.com/python/cpython-source-deps/blob/master/README.rst for 
instructions that should hopefully work :))

--

___
Python tracker 

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



[issue18943] argparse: default args in mutually exclusive groups

2018-02-22 Thread Daniel Himmelstein

Change by Daniel Himmelstein :


--
pull_requests: +5593
stage:  -> patch review

___
Python tracker 

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



[issue32901] Update 3.7 and 3.8 Windows and macOS installer builds to tcl/tk 8.6.8

2018-02-22 Thread Ned Deily

Ned Deily  added the comment:

Yeah, we should do that for the macOS installers as well.

--
components: +macOS
nosy: +ned.deily, ronaldoussoren
priority: normal -> release blocker
title: Update Windows 3.7/8 builds to tcl/tk 8.6.8 -> Update 3.7 and 3.8 
Windows and macOS installer builds to tcl/tk 8.6.8

___
Python tracker 

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



[issue32900] Teach pdb to step through asyncio et al.

2018-02-22 Thread ppperry

ppperry  added the comment:

Just to be clear, I'm not opposing having the default value for `skip` be 
something other than the empty set, but it should be overridable, and the 
default should include some other things this patch omits, like 
`importlib._bootstrap(_external)?`

--

___
Python tracker 

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



[issue32900] Teach pdb to step through asyncio et al.

2018-02-22 Thread ppperry

ppperry  added the comment:

This feature already exists and doesn't need to be reimplemented; use 
`pdb.Pdb(skip={"trio", "contextlib", ...}).run(...)`, and in any case should be 
disableable. I don't use asyncio, but happen to have a habit of running pdb 
through the standard library for no reason and don't want to have that option 
taken away.

--
nosy: +ppperry

___
Python tracker 

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



[issue32911] Doc strings omitted from AST

2018-02-22 Thread Ned Deily

Ned Deily  added the comment:

It seems we have a difference of opinion here.  Serhiy closed this issue so, 
Mark, if you feel strongly enough to pursue it, you should reopen it and 
solicit other opinions.  The clock has just about run out to change the now 
current behavior for 3.7.0.

--
nosy: +ned.deily

___
Python tracker 

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



[issue32901] Update Windows 3.7/8 builds to tcl/tk 8.6.8

2018-02-22 Thread Steve Dower

Steve Dower  added the comment:

Yay, more work...

(btw Zach, nothing stopping you from putting the sources up for me :) I just 
need to hit the buttons to make the build.)

--

___
Python tracker 

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



[issue32457] Windows Python cannot handle an early PATH entry containing ".." and python.exe

2018-02-22 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5592

___
Python tracker 

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



[issue32457] Windows Python cannot handle an early PATH entry containing ".." and python.exe

2018-02-22 Thread Steve Dower

Steve Dower  added the comment:


New changeset 48e8c82fc63d2ddcddce8aa637a892839b551619 by Steve Dower in branch 
'master':
bpo-32457: Improves handling of denormalized executable path when launching 
Python (GH-5756)
https://github.com/python/cpython/commit/48e8c82fc63d2ddcddce8aa637a892839b551619


--

___
Python tracker 

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



[issue32556] support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname

2018-02-22 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5591

___
Python tracker 

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



[issue32556] support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname

2018-02-22 Thread Steve Dower

Steve Dower  added the comment:


New changeset 23ad6d0d1a7a6145a01494f4f3913a63d1f0250c by Steve Dower in branch 
'master':
bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage now 
correctly convert from bytes. (GH-5761)
https://github.com/python/cpython/commit/23ad6d0d1a7a6145a01494f4f3913a63d1f0250c


--

___
Python tracker 

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



[issue27364] Deprecate invalid escape sequences in str/bytes

2018-02-22 Thread Emanuel Barry

Emanuel Barry  added the comment:

I have created Issue32912 as a follow-up to this issue for 3.8.

--

___
Python tracker 

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



[issue32912] Raise non-silent warning for invalid escape sequences

2018-02-22 Thread Emanuel Barry

New submission from Emanuel Barry :

This is a follow-up to Issue27364.

Back in Python 3.6, a silent warning was added for all invalid escape sequences 
in str and bytes. It was suggested that it would remain a silent warning (which 
still impacts tests, while not visually annoying the average user) for two 
releases (3.6 and 3.7), then would be upgraded to a non-silent warning for two 
subsequent releases (3.8 and 3.9) before becoming a full-on syntax error. With 
the 3.7 feature freeze on and going, I think it's time to evaluate the approach 
we take for 3.8 :)

I suggest upgrading the DeprecationWarning to a SyntaxWarning, which is visible 
by default, for 3.8 and 3.9. I have cross-linked #27364 to this issue as well.

-Em

--
components: Interpreter Core
messages: 312575
nosy: ebarry
priority: normal
severity: normal
stage: needs patch
status: open
title: Raise non-silent warning for invalid escape sequences
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



[issue30449] Improve __slots__ datamodel documentation

2018-02-22 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 6eab93cfe5ee08a6168e5bb69474e461cc7ac535 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-30449: Improve __slots__ documentation (GH-1819)
https://github.com/python/cpython/commit/6eab93cfe5ee08a6168e5bb69474e461cc7ac535


--

___
Python tracker 

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



[issue25427] Remove the pyvenv script in Python 3.8

2018-02-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Ping since we're now on 3.8.  :-)

--
nosy: +csabella
stage:  -> needs patch
type:  -> enhancement
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



[issue30449] Improve __slots__ datamodel documentation

2018-02-22 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Yes I think we can backport this to 3.6 and 2.7.

--

___
Python tracker 

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



[issue30449] Improve __slots__ datamodel documentation

2018-02-22 Thread miss-islington

Change by miss-islington :


--
keywords: +patch
pull_requests: +5590
stage: backport needed -> patch review

___
Python tracker 

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



[issue30449] Improve __slots__ datamodel documentation

2018-02-22 Thread Mariatta Wijaya via Python-bugs-list

Change by Mariatta Wijaya :


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



[issue30449] Improve __slots__ datamodel documentation

2018-02-22 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

We can't auto backport to 2.7 because of conflict.
Aaron can you prepare the backport PR?

--

___
Python tracker 

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



[issue29636] Specifying indent in the json.tool command

2018-02-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I don't think this PR should be merged. It adds too much options. I think that 
if one needs more control than the current json.tools command line interface 
gives, he should use the Python interface. Don't forget, that Python is a 
programming language.

--

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-02-22 Thread Paul Ganssle

Change by Paul Ganssle :


--
pull_requests: +5588

___
Python tracker 

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



[issue32403] date, time and datetime alternate constructors should take fast construction path

2018-02-22 Thread Paul Ganssle

Change by Paul Ganssle :


--
pull_requests: +5589

___
Python tracker 

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



[issue32886] new Boolean ABC in numbers module

2018-02-22 Thread Sylvain Marie

Change by Sylvain Marie :


Added file: https://bugs.python.org/file47457/proposal.py

___
Python tracker 

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



[issue26792] docstrings of runpy.run_{module,path} are rather sparse

2018-02-22 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +easy
stage:  -> needs patch
type:  -> 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



[issue30449] Improve __slots__ datamodel documentation

2018-02-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Mariatta,

Do you think this one needs to be backported?  You had originally added the 
labels on the pull request, then removed them.  I wasn't sure if that was 
needed before being able to close this.

Thanks!

--
nosy: +Mariatta

___
Python tracker 

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



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Terry,

In order to not duplicate effort, are you going to be working on these or is it 
ok if I look at them?  Should all the changes happen in one PR or do you want 
to break them down?

Thanks!

--

___
Python tracker 

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



[issue32911] Doc strings omitted from AST

2018-02-22 Thread Mark Shannon

Mark Shannon  added the comment:

Stating that "this is a feature not a bug" does not make it so.
This breaks existing code and reduces the capabilities of the `ast` module.
For example, how does one get the location of the docstring now?

>From a syntactic point of view.
def foo():
   "help"
and
def foo():
   b'"help"
barely differ.
The S in AST stands for Syntax not Semantics.

--

___
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-02-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I've added the tests for `after` and `after_idle`.  I used `update` and 
`update_idletasks` to make sure they processed.  Even scheduling an after event 
for 0 ms didn't guarantee it would process, but I wasn't sure if there was a 
better way besides `update` to get it to process?

--

___
Python tracker 

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



[issue32911] Doc strings omitted from AST

2018-02-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This isn't a bug, but a feature. You no longer need to check and skip the first 
statement if it is a literal string. The body attribute now always represents a 
sequence of statements, and the docstring attribute represents a docstring.

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



[issue32911] Doc strings omitted from AST

2018-02-22 Thread INADA Naoki

Change by INADA Naoki :


--
components: +Interpreter Core -Library (Lib)

___
Python tracker 

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



[issue32911] Doc strings omitted from AST

2018-02-22 Thread INADA Naoki

INADA Naoki  added the comment:

We implemented AST-level constant folding (#29469) based on the AST change 
(#29463).

I feel it's possible to revert AST change without reverting AST constant 
folding:

* Docstring is exposed from AST before calling AST optimizer.
* AST optimizer removes unused constant.

But I don't remember how difficult it is because since this change is made one 
year ago (GH-46)...

--
nosy: +benjamin.peterson, georg.brandl, rhettinger, serhiy.storchaka, vstinner

___
Python tracker 

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



[issue32886] new Boolean ABC in numbers module

2018-02-22 Thread Sylvain Marie

Sylvain Marie  added the comment:

@Mark : the '__invert__' method is out of the game since Josh comment (and my 
reply https://bugs.python.org/issue32886#msg312478 )

So the remaining operations *are* an abstraction of both python bool and numpy 
bool_ behaviour (and a minimal representation of boolean logic operations that 
will seem natural to anyone, don't you think ?)

--

___
Python tracker 

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



[issue32911] Doc strings omitted from AST

2018-02-22 Thread Mark Shannon

Mark Shannon  added the comment:

That issue has to do with bytecode generation, not the AST.

The AST should be an accurate representation of the Python source code.
Making a better representation of the source would be fine, but this makes it 
worse.

Doc-strings may be semantically distinct from other expressions, but they are 
syntactically the same.

--

___
Python tracker 

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



[issue32016] Python 3.6.3 venv FAILURE

2018-02-22 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
resolution:  -> works for me
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



[issue32911] Doc strings omitted from AST

2018-02-22 Thread INADA Naoki

INADA Naoki  added the comment:

ref: https://bugs.python.org/issue29463

--

___
Python tracker 

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



[issue32900] Teach pdb to step through asyncio et al.

2018-02-22 Thread Matthias Urlichs

Matthias Urlichs  added the comment:

*Sigh*. ... if you need Python 3.5 compatibility ... obviously.

--

___
Python tracker 

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



[issue32911] Doc strings omitted from AST

2018-02-22 Thread Mark Shannon

Mark Shannon  added the comment:

This is an unnecessary and breaking change.
Changes like this should not be made unless necessary to fix a bug.

--

___
Python tracker 

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



[issue32911] Doc strings omitted from AST

2018-02-22 Thread INADA Naoki

INADA Naoki  added the comment:

AST is changed slightly from Python 3.7.
ast.get_docstring() works for both of 3.6 and 3.7.

$ ./python
Python 3.8.0a0 (heads/master-dirty:451d1edaf4, Feb 22 2018, 21:11:54)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> m = ast.parse("def foo():\n   'help'")
>>> ast.get_docstring(m.body[0])
'help'

--
nosy: +inada.naoki

___
Python tracker 

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



[issue32911] Doc strings omitted from AST

2018-02-22 Thread Mark Shannon

New submission from Mark Shannon :

Python 3.7.0b1+ (heads/3.7:dfa1144, Feb 22 2018, 12:10:59) 

>>> m = ast.parse("def foo():\n   'help'")
>>> m.body[0].body
[]


Correct behaviour (3.6 or earlier)

>>> m = ast.parse("def foo():\n   'help'")
>>> m.body[0].body
[<_ast.Expr object at 0x7fb9eeb1d4e0>]

--
components: Library (Lib)
keywords: 3.7regression
messages: 312557
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Doc strings omitted from AST
type: behavior
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



[issue32910] venv: Deactivate.ps1 is not created when Activate.ps1 was used

2018-02-22 Thread Kirill Balunov

Kirill Balunov  added the comment:

Yes, I agree, I did not understand the documentation correctly. It seems to me 
that the problem in the perception arose because of the fact that "deactivate" 
is not formatted as shell command, while `Deactivate.ps1` and others are. So I 
think simple formatting will be enough.

Also, it is not mentioned in the documentation that it is possible to activate 
environment in Powershell with "Drive:\> \Scripts\activate", but maybe 
it's not always true and I have nowhere to check.

--

___
Python tracker 

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



[issue32900] Teach pdb to step through asyncio et al.

2018-02-22 Thread Matthias Urlichs

Matthias Urlichs  added the comment:

"Example of a problem"? Well, just single-step into, and then back out of, an 
@asynccontextmanager-decorated function.

@asynccontextmanager
async def gen():
yield 1234

async def foo():
import pdb;pdb.set_trace()
async with gen() as x:
assert x == 1234
print("done")

trio.run(foo)
# asyncio.get_event_loop().run_until_complete(foo())

Let's assume that you want to single step through that context manager. Now 
count how often you need to press "s" until you arrive at the print statement. 
With my patch it's 7. Without the patch there are 30 additional steps within 
the asynccontextmanager. If you need Python 3.6 compatibility and also use 
@async_generator you need to hit Return ~130 times. That's way too much.

Or: let's say you want to step across an await statement that actually goes 
through a context switch. You hit "n" and see a . With something like 
my patch, and assuming there's no other context to switch to, hitting "s" gets 
you back to the current context.

--

___
Python tracker 

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



[issue32910] venv: Deactivate.ps1 is not created when Activate.ps1 was used

2018-02-22 Thread Paul Moore

Paul Moore  added the comment:

As noted in the related issue that you link to, there is not meant to be a 
deactivate.ps1 script - the deactivate command is provided via a global 
deactivate function created when you run activate.ps1 (although this is an 
implementation detail, all that matters is that a "deactivate" command exists, 
not how it is implemented).

The documentation of the implementation-specific behaviour is incorrect, but as 
it's describing internal implementation details, it shouldn't be relied on 
anyway.

Suggested documentation fix:

"""
You can deactivate a virtual environment by typing “deactivate” in your shell. 
The exact mechanism is platform-specific and is an internal implementation 
detail (typically a script of shell function will be used).
"""

--
assignee: docs@python -> 
nosy:  -docs@python
status:  -> open

___
Python tracker 

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



[issue32910] venv: Deactivate.ps1 is not created when Activate.ps1 was used

2018-02-22 Thread Kirill Balunov

Kirill Balunov  added the comment:

Sorry, `deactivate` works in both cases `Scripts/Activate.ps1` and 
`Scripts/activate`. Only `Deactivate.ps1` is not created for the former, but 
the docs says that it should.

--

___
Python tracker 

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



[issue32910] venv: Deactivate.ps1 is not created when Activate.ps1 was used

2018-02-22 Thread Kirill Balunov

New submission from Kirill Balunov :

There was a related issue, which was closed https://bugs.python.org/issue26715.

If virtual environment was activated using Powershell script - Activate.ps1, 
the Deactivate.ps1 was not created, while the documentation says that it should.

"You can deactivate a virtual environment by typing “deactivate” in your shell. 
The exact mechanism is platform-specific: for example, the Bash activation 
script defines a “deactivate” function, whereas on Windows there are separate 
scripts called deactivate.bat and Deactivate.ps1 which are installed when the 
virtual environment is created."

Way to reproduce under Windows 10, Python 3.6.4

1. Open elevated Powershell (Administrator access).
2. Activate virtual environment using Activate.ps1.
3. There is no Deactivate.ps1

Also, when the environment was activated with Activate.ps1, `deactivate` will 
not work. On the other hand, if the environment was activated simply with 
`activate` (it works) in Powershell, `deactivate` will also work.

--
components: Windows
messages: 312551
nosy: godaygo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: venv: Deactivate.ps1 is not created when Activate.ps1 was used
type: behavior
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



[issue32909] ApplePersistenceIgnoreState warning on macOS

2018-02-22 Thread cbrnr

New submission from cbrnr :

There seems to be a problem with using certain Python packages and the 
application resume feature of recent macOS versions. Specifically, whenever I 
"import matplotlib.plyplot" or run the magic command "%matplotlib" in IPython, 
I get the following warning message:

2018-02-22 10:35:38.287 Python[4145:281298] ApplePersistenceIgnoreState: 
Existing state will not be touched. New state will be written to (null)

There's an issue in the matplotlib repo 
(https://github.com/matplotlib/matplotlib/issues/6242), but I don't think this 
problem can be fixed by matplotlib. Instead, according to this SO post 
(https://stackoverflow.com/a/21567601/1112283), the following command fixes the 
behavior:

defaults write org.python.python ApplePersistenceIgnoreState NO

Since this problem also comes up with Homebrew, I created an issue 
(https://github.com/Homebrew/homebrew-core/issues/24424), but the maintainers 
indicated that (1) this might be a Python issue and should be addressed 
upstream, and (2) the solution above is not a real fix and the correct behavior 
should be implemented programmatically by Python itself.

--
components: macOS
messages: 312550
nosy: cbrnr, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: ApplePersistenceIgnoreState warning on macOS
type: behavior
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



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The ()[]{} match manager is in parenmatch.py.  It imports Hyperparser, which 
uses pyparse.Parser.  When one types a closer, the corresponding opener is also 
highlighted and, depending on the configured style, everything in between.  
Very handy for showing when enough closers have been typed. Edit => Show 
surrounding parens, ^0 on Windows, which is essentially ^) on US keyboards, 
highlights out to the nearest pair.  One can select one end of a pair by 
putting the cursor just inside a fence char.  (A tk Text cursor is between 
characters, not on.)

I don't think I would like automatic flashes when merely moving the cursor, or 
maybe I don't understand what you propose.

On the hand, moving to the nearest opener to the left or closer to the right 
could be useful.  ^] is already used for indent region, but ^{ and ^} 
(control-shift-bracket) are available and mnemonic.  What shortcuts do you know 
of?

--

___
Python tracker 

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



[issue29636] Specifying indent in the json.tool command

2018-02-22 Thread INADA Naoki

INADA Naoki  added the comment:

I'm OK to options in current pull request.
And I think this bike-shedding discussion is not so important to pay our time 
and energy.

Does anyone have strong opinion?
If no, I'll merge the PR.

--

___
Python tracker 

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



[issue29636] Specifying indent in the json.tool command

2018-02-22 Thread INADA Naoki

Change by INADA Naoki :


--
components: +Library (Lib) -IO
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



[issue32908] decimal ROUND_HALF_UP not according to spec for 9.95 to 10.0

2018-02-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

This isn't a bug. When you do `Decimal(9.95)`, you're converting the binary 
floating-point number `9.95` to a `Decimal` instance. The conversion is 
performed exactly, with no change in the value. But the *input* to the 
conversion, the float `9.95` can't be stored exactly in IEEE 754 binary64 
format, so what you end up with is something very slightly smaller.

>>> from decimal import Decimal
>>> Decimal(9.95)
Decimal('9.949289457264239899814128875732421875')

That's the reason that it rounds down.

Good practice is to create your Decimal instances from strings rather than 
floats.

>>> Decimal(9.95).quantize(Decimal('1.1'),ROUND_HALF_UP)
Decimal('9.9')
>>> Decimal('9.95').quantize(Decimal('1.1'),ROUND_HALF_UP)
Decimal('10.0')

--
nosy: +mark.dickinson
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32908] decimal ROUND_HALF_UP not according to spec for 9.95 to 10.0

2018-02-22 Thread felix.engelmann

New submission from felix.engelmann :

As described in https://www.python.org/dev/peps/pep-0327/#rounding-algorithms
round-half-up: If the discarded digits represent greater than or equal to half 
(0.5) then the result should be incremented by 1; otherwise the discarded 
digits are ignored.

Rounding 9.95 to 1 decimal with ROUND_HALD_UP results in 9.9 instead of 10.0:
 
Decimal(9.95).quantize(Decimal('1.1'),ROUND_HALF_UP)
Out[49]: Decimal('9.9')

It does not matter at wich position this rounding with influence on another 
digit happens:

Decimal(9.995).quantize(Decimal('1.11'),ROUND_HALF_UP)
Out[50]: Decimal('9.99')

It is a specific problem with the 5, because 9.96 works as expected

Decimal(9.96).quantize(Decimal('1.1'),ROUND_HALF_UP)
Out[40]: Decimal('10.0')

System:

Python 3.6.4

import decimal
decimal.__version__ : '1.70'

--
components: Library (Lib)
messages: 312546
nosy: felix.engelmann
priority: normal
severity: normal
status: open
title: decimal ROUND_HALF_UP not according to spec for 9.95 to 10.0
type: behavior
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



[issue32907] pathlib: test_resolve_common fails on Windows

2018-02-22 Thread Alexey Izbyshev

Change by Alexey Izbyshev :


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

___
Python tracker 

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



[issue32907] pathlib: test_resolve_common fails on Windows

2018-02-22 Thread Alexey Izbyshev

New submission from Alexey Izbyshev :

==
FAIL: test_resolve_common (test.test_pathlib.PathTest)
--
Traceback (most recent call last):
  File "C:\workspace\cpython-3.8a\lib\test\test_pathlib.py", line 1538, in 
test_resolve_common
self._check_resolve_relative(p, P(d, 'foo', 'in', 'spam'), False)
  File "C:\workspace\cpython-3.8a\lib\test\test_pathlib.py", line 1477, in 
_check_resolve
self.assertEqual(q, expected)
AssertionError: 
WindowsPath('C:/Users/longusername/AppData/Local/Temp/tmpbenaiqaa-[
13 chars]pam') != WindowsPath('C:/Users/LONGUS~1/AppData/Local/Temp/tmpbenaiqaa-
dirD/foo/in/spam')

==

The problem is that the temporary directory path returned by tempfile.mkdtemp() 
contains the username in "short" (8.3) format, but Path.resolve() converts 
short names to long ones (thanks to ntpath._getfinalpathname()).

Since os.path.realpath() still doesn't resolve symlinks on Windows (#9949, 
#14094), and users of ntpath._getfinalpathname() have to deal with '\\?\' 
prefix, I think I'll just use Path.resolve() for the tmp dir path as a 
workaround.

--
components: Tests, Windows
messages: 312545
nosy: izbyshev, paul.moore, pitrou, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: pathlib: test_resolve_common fails on Windows
type: behavior
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



  1   2   >