[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-03-31 Thread Donald Stufft

Changes by Donald Stufft :


--
pull_requests: +1007

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-30 Thread Ned Deily

Ned Deily added the comment:

The fix looks good and the dmg buildbots are happy again.  Thanks, Martin and 
David.

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

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-29 Thread Martin Panter

Martin Panter added the comment:

I pushed the simpler 2.6-compatible option. Keeping this open to check the 
buildbot is happy overnight.

--
stage: needs patch -> resolved

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9880928ec962 by Martin Panter in branch '3.5':
Issue #29349: Use __future__ print_function; Sphinx may use Python 2.6+
https://hg.python.org/cpython/rev/9880928ec962

New changeset 1708afd284ff by Martin Panter in branch '3.6':
Issues #29349: Merge Py 2.6+ compatibility from 3.5
https://hg.python.org/cpython/rev/1708afd284ff

New changeset e50058ecd808 by Martin Panter in branch 'default':
Issues #29349: Merge Py 2.6+ compatibility from 3.6
https://hg.python.org/cpython/rev/e50058ecd808

--

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-29 Thread David Bolen

David Bolen added the comment:

Whoops, I just realized that the patch still needs adjusting to be 2.x 
compatible, so obviously the extra build still won't work.

But at this point it should be safe to assume 2.6+ such as for the rest of the 
sphinx processing.

--

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-29 Thread David Bolen

David Bolen added the comment:

2.7.12 (/usr/local/bin) is used for the build slave and main external commands 
(such as hg and sphinx) and is in the buildslave path, but 2.5.1 is still the 
default in /usr/bin so can get used for processes with a restricted 
environment.  Tiger's original 2.3 is present but unused.

The DMG build-installer script itself runs under 2.5.1, because it specifies 
"python2.5" in its command to the slave.  I believe that was originally added 
once the system 2.3 couldn't be used.

During the DMG construction process, a particular step might, I suppose use 
2.5.1 or 2.7.12 depending on whether it's internal to the build script, 
something using the same executable as the script, a subprocess with limited 
path, or an independent utility (like sphinx) referencing 2.7.

I believe Ned's comment in issue 17861 about 2.6+ is a reference to the sphinx 
step, which is covered by the fact that sphinx is using the newer 2.7.12.

What appears to break in this specific case is some of the preparation - 
specifically the Makefile referencing patchlevel is running "python".  That 
should work (2.7.12) if it inherits the overall build slave environment (which 
has /usr/local/bin first) but I think the install script filters that, so it's 
probably getting the /usr/bin/python 2.5.1 version.

I've just changed the default /usr/bin/python to be 2.7 so external processes 
run by build-installer should get 2.7.  I don't think that will break anything 
else currently done on the machine, but I'll deal with any fallout if needed.  
I'm rerunning build 59 now.

As in issue 28039 there's no immediate need to change the installer script 
itself, but since it's clearly the last hold out, I'll find some time to test 
that I've got any pre-requisites for it set up at which point the build master 
could be changed to remove the python2.5 reference.

--

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-29 Thread Martin Panter

Martin Panter added the comment:

According to , Ned says 2.6+ is 
already needed to build the Python 3.5 documentation, so maybe Sphinx uses that.

--

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-29 Thread Ned Deily

Ned Deily added the comment:

Dunno for sure, perhaps David can answer that.  But the Sphinx docs imply that 
Sphinx 1.4.6 requires at least 2.6 and I don't test the installer build with 
anything less than 2.7.

--

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-29 Thread Martin Panter

Martin Panter added the comment:

Thanks Ned. Do you know what version of Python Sphinx uses (which runs 
patchlevel.py)?

According to Issue 28039, David set up Python 2.7 so that “make touch” would 
work. But the log also uses a python2.5 command, and apparently Python 2.3 also 
installed on that buildbot.

If we can rely on 2.6+, we just need to add “from __future__ import 
print_function”. Otherwise, we may need something like

if sys.stderr is not None:
sys.stderr.write(...)

and also do something about that “with” statement.

--
nosy: +db3l

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-29 Thread Ned Deily

Ned Deily added the comment:

These changes have broken some buildbots, for example, the OS X dmg buildbots 
which are still using Python 2 for sphinx builds of the docs.  They should be 
version agnostic as much as possible.

http://buildbot.python.org/all/builders/bolen-dmg-3.x/builds/59

--
nosy: +ned.deily
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-29 Thread Martin Panter

Martin Panter added the comment:

I think the general rule is to clean up code if you are doing something else in 
nearby code, but don’t go out of your way with unnecessary cleanups to 
arbitrary code. Otherwise it adds too much noise to the repository history, 
review process, risks adding bugs, etc, for little gain.

Anyway, thanks for the patch!

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed
versions:  -Python 3.4

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ecdc864884a9 by Martin Panter in branch '3.5':
Issue #29349: Fix Python 2 syntax in documentation build code
https://hg.python.org/cpython/rev/ecdc864884a9

New changeset cdcb33f37bf3 by Martin Panter in branch '3.6':
Issues #29349: Merge Py 2 fix 3.5
https://hg.python.org/cpython/rev/cdcb33f37bf3

New changeset db8b917bbfdd by Martin Panter in branch 'default':
Issues #29349: Merge Py 2 fix 3.6
https://hg.python.org/cpython/rev/db8b917bbfdd

New changeset ca7d2af9920e by Martin Panter in branch 'default':
Issues #29349: Add NEWS for 3.7; use “with” statement
https://hg.python.org/cpython/rev/ca7d2af9920e

--
nosy: +python-dev

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-24 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


Added file: http://bugs.python.org/file46406/patchlevel_with.patch

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-24 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

I'm breaking these to separate files to make it easier to apply. I also noticed 
that other files in `Doc/tools/extensions/` use old constructs so I'm not sure 
about the *with*.

I'm guessing that either it should be changed in other files too or, since it's 
working fine, leave it as is.

--
Added file: http://bugs.python.org/file46405/patchlevel_print.patch

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-23 Thread Martin Panter

Martin Panter added the comment:

Is it okay to only fix this in 3.5+? 3.4 only gets security fixes now.

Either way, the “with” statement changes is not a bug fix and should only go 
into 3.7.

--
nosy: +martin.panter
stage:  -> commit review

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-23 Thread Jim Fasarakis-Hilliard

New submission from Jim Fasarakis-Hilliard:

There's a hidden Python 2 print call in the script that only gets reached after 
you move the Doc/ folder outside the main CPython directory and run `make 
html`. 

Additionally, an obsolete way of assuring a file gets closed is used (changed 
to use `with` statement).

P.S: Tagged this with the Documentation component, maybe build is more 
applicable but I wasn't sure.

--
assignee: docs@python
components: Documentation
files: patchlevel.patch
keywords: patch
messages: 286065
nosy: Jim Fasarakis-Hilliard, docs@python
priority: normal
severity: normal
status: open
title: Update old Python 2 code in Docs/tools/extensions/patchlevel.py
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46387/patchlevel.patch

___
Python tracker 

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