Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93f5cd4

Browse files
author
Victor Stinner
committed
Merged revisions 85386-85387,85389 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ........ r85386 | victor.stinner | 2010-10-13 00:23:23 +0200 (mer., 13 oct. 2010) | 3 lines Issue #6612: Fix site and sysconfig to catch os.getcwd() error, eg. if the current directory was deleted. ........ r85387 | victor.stinner | 2010-10-13 00:26:08 +0200 (mer., 13 oct. 2010) | 2 lines #6612: add the author of the patch (W. Trevor King) ........ r85389 | victor.stinner | 2010-10-13 00:42:37 +0200 (mer., 13 oct. 2010) | 2 lines NEWS: Move #6612 to Library section ........
1 parent 33d6e97 commit 93f5cd4

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

Lib/site.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@
6767

6868

6969
def makepath(*paths):
70-
dir = os.path.abspath(os.path.join(*paths))
70+
dir = os.path.join(*paths)
71+
try:
72+
dir = os.path.abspath(dir)
73+
except OSError:
74+
pass
7175
return dir, os.path.normcase(dir)
7276

7377

@@ -78,8 +82,8 @@ def abs__file__():
7882
continue # don't mess with a PEP 302-supplied __file__
7983
try:
8084
m.__file__ = os.path.abspath(m.__file__)
81-
except AttributeError:
82-
continue
85+
except (AttributeError, OSError):
86+
pass
8387

8488

8589
def removeduppaths():

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ Vivek Khera
414414
Akira Kitada
415415
Mads Kiilerich
416416
Taek Joo Kim
417+
W. Trevor King
417418
Paul Kippes
418419
Steve Kirsch
419420
Sebastian Kirsche

Misc/NEWS

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ C-API
122122
Library
123123
-------
124124

125+
- Issue #6612: Fix site and sysconfig to catch os.getcwd() error, eg. if the
126+
current directory was deleted. Patch written by W. Trevor King.
127+
125128
- Issue #9759: GzipFile now raises ValueError when an operation is attempted
126129
after the file is closed. Patch by Jeffrey Finkelstein.
127130

@@ -188,7 +191,7 @@ Library
188191
- Issue #8750: Fixed MutableSet's methods to correctly handle
189192
reflexive operations, namely x -= x and x ^= x.
190193

191-
- Issue #9129: smtpd.py is vulnerable to DoS attacks deriving from missing
194+
- Issue #9129: smtpd.py is vulnerable to DoS attacks deriving from missing
192195
error handling when accepting a new connection.
193196

194197
- Issue #658749: asyncore's connect() method now correctly interprets winsock
@@ -543,7 +546,7 @@ Extension Modules
543546
-----------------
544547

545548
- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
546-
introduced by issue #9324.
549+
introduced by issue #9324.
547550

548551
- Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
549552
descriptor is provided. Patch by Pascal Chambon.

0 commit comments

Comments
 (0)