Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(130412)

#10496: "import site failed" when Python can't find home directory (sysconfig._getuserbase)

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years, 7 months ago by bbi5291
Modified:
7 years, 8 months ago
Reviewers:
merwok
CC:
loewis, Georg, arekm_maven.pl, haypo, christian.heimes, nadeem.vawda, tarek_ziade.org, ned.deily, eric.araujo, Graham.Dumpleton_gmail.com, r.david.murray, Charles-François Natali, fgiunchedi_gmail.com, xuanji, bbi5291_gmail.com, denis.barmenkov_gmail.com, ali_ikinci.info, storchaka, matrixise, zaytsev, seirl, Chi Hsuan Yen, jonathon.reinhart_gmail.com, surajssd009005_gmail.com, izbyshev_ispras.ru, cinerar, nickbroon_gmail.com, mariatta.wijaya+miss-islington_gmail.com
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/site.py View 2 chunks +6 lines, -2 lines 1 comment Download
Lib/sysconfig.py View 1 2 chunks +13 lines, -2 lines 1 comment Download

Messages

Total messages: 1
eric.araujo
7 years, 8 months ago #1
http://bugs.python.org/review/10496/diff/2543/6113
File Lib/site.py (right):

http://bugs.python.org/review/10496/diff/2543/6113#newcode254
Lib/site.py:254: except KeyError:
I’m worried the KeyError could come from code on get_path that is not the pwd
error; I’d prefer to add a guard in the site.main function and not call
addusersitepackages if the pwd call fails.

http://bugs.python.org/review/10496/diff/2543/6114
File Lib/sysconfig.py (right):

http://bugs.python.org/review/10496/diff/2543/6114#newcode175
Lib/sysconfig.py:175: except AttributeError:
I’d prefer code that makes the intent cleaner, for example that removes schemes
ending in '_user' when the pwd call fails.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+