classification
Title: Little enhancements of _bootstrap.py
Type: enhancement Stage: committed/rejected
Components: Interpreter Core Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Arfrever, brett.cannon, ncoghlan, python-dev, serhiy.storchaka, zach.ware
Priority: normal Keywords: patch

Created on 2013-02-17 17:50 by serhiy.storchaka, last changed 2013-02-25 22:10 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
_bootstrap.diff serhiy.storchaka, 2013-02-17 17:50 review
Messages (8)
msg182280 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-02-17 17:50
The proposed patch a little cleans and optimizes some bits of _bootstrap.py.
msg182331 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-02-18 18:33
It all LGTM. Nice cleanup! Totally didn't remember about to_bytes and from_bytes.

If you are feeling adventurous you can look at possibly porting the changes you made to _path_join() and _path_split() to os.py since I mostly copied them.
msg182333 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-02-18 18:47
_path_join() and _path_split() do not look as join() and split() from ntpath or posixpath. They rather look as very simplified and limited versions of join() and split(). Perhaps they are enough for _bootstrap.py, but real os.path functions are more complicated.
msg182936 - (view) Author: Roundup Robot (python-dev) Date: 2013-02-25 13:44
New changeset 2528e4aea338 by Serhiy Storchaka in branch 'default':
Issue #17220: Little cleanup of _bootstrap.py.
http://hg.python.org/cpython/rev/2528e4aea338
msg182983 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-02-25 21:14
2528e4aea338 seems to have broken building on Windows: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/1517
msg182989 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-02-25 21:48
I dug into http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/1517/steps/compile/logs/stdio and found this traceback:

EXEC : Fatal Python error : Py_Initialize: unable to load the file system codec [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\ssl.vcxproj]
  Traceback (most recent call last):
    File "<frozen importlib._bootstrap>", line 1570, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1537, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 572, in _check_name_wrapper
    File "<frozen importlib._bootstrap>", line 1035, in load_module
    File "<frozen importlib._bootstrap>", line 1016, in load_module
    File "<frozen importlib._bootstrap>", line 536, in module_for_loader_wrapper
    File "<frozen importlib._bootstrap>", line 859, in is_package
    File "<frozen importlib._bootstrap>", line 77, in _path_split
  ValueError: too many values to unpack (expected 2)

Looks like Serhiy forgot to cap the rsplit() call to a single split (which rpartition does implicitly). I'll fix it shortly.
msg182991 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-02-25 22:06
Found another bug introduced by this patch which I will have a patch for shortly.
msg182992 - (view) Author: Roundup Robot (python-dev) Date: 2013-02-25 22:10
New changeset d98a82f4c9bd by Brett Cannon in branch 'default':
Issue #17220: two fixes for changeset 2528e4aea338.
http://hg.python.org/cpython/rev/d98a82f4c9bd
History
Date User Action Args
2013-02-25 22:10:21python-devsetmessages: + msg182992
2013-02-25 22:06:26brett.cannonsetmessages: + msg182991
2013-02-25 21:48:13brett.cannonsetmessages: + msg182989
2013-02-25 21:14:32zach.waresetnosy: + zach.ware
messages: + msg182983
2013-02-25 13:59:27serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: commit review -> committed/rejected
2013-02-25 13:44:44python-devsetnosy: + python-dev
messages: + msg182936
2013-02-18 18:47:52serhiy.storchakasetmessages: + msg182333
2013-02-18 18:33:13brett.cannonsetassignee: serhiy.storchaka
messages: + msg182331
stage: patch review -> commit review
2013-02-17 20:57:13Arfreversetnosy: + Arfrever
2013-02-17 17:50:23serhiy.storchakacreate