Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9c99824d
Commit
9c99824d
authored
Jun 13, 2011
by
Brian Curtin
Browse files
Options
Browse Files
Download
Plain Diff
branch merge?
parents
f7fb46d1
1c35b0dd
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
192 additions
and
97 deletions
+192
-97
Lib/test/support.py
Lib/test/support.py
+1
-1
Lib/test/test_os.py
Lib/test/test_os.py
+45
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/posixmodule.c
Modules/posixmodule.c
+143
-96
No files found.
Lib/test/support.py
View file @
9c99824d
...
@@ -1491,7 +1491,7 @@ def can_symlink():
...
@@ -1491,7 +1491,7 @@ def can_symlink():
try
:
try
:
os
.
symlink
(
TESTFN
,
symlink_path
)
os
.
symlink
(
TESTFN
,
symlink_path
)
can
=
True
can
=
True
except
(
OSError
,
NotImplementedError
):
except
(
OSError
,
NotImplementedError
,
AttributeError
):
can
=
False
can
=
False
else
:
else
:
os
.
remove
(
symlink_path
)
os
.
remove
(
symlink_path
)
...
...
Lib/test/test_os.py
View file @
9c99824d
...
@@ -1243,6 +1243,51 @@ class Win32SymlinkTests(unittest.TestCase):
...
@@ -1243,6 +1243,51 @@ class Win32SymlinkTests(unittest.TestCase):
self
.
assertEqual
(
os
.
stat
(
link
),
os
.
stat
(
target
))
self
.
assertEqual
(
os
.
stat
(
link
),
os
.
stat
(
target
))
self
.
assertNotEqual
(
os
.
lstat
(
link
),
os
.
stat
(
link
))
self
.
assertNotEqual
(
os
.
lstat
(
link
),
os
.
stat
(
link
))
bytes_link
=
os
.
fsencode
(
link
)
self
.
assertEqual
(
os
.
stat
(
bytes_link
),
os
.
stat
(
target
))
self
.
assertNotEqual
(
os
.
lstat
(
bytes_link
),
os
.
stat
(
bytes_link
))
def
test_12084
(
self
):
level1
=
os
.
path
.
abspath
(
support
.
TESTFN
)
level2
=
os
.
path
.
join
(
level1
,
"level2"
)
level3
=
os
.
path
.
join
(
level2
,
"level3"
)
try
:
os
.
mkdir
(
level1
)
os
.
mkdir
(
level2
)
os
.
mkdir
(
level3
)
file1
=
os
.
path
.
abspath
(
os
.
path
.
join
(
level1
,
"file1"
))
with
open
(
file1
,
"w"
)
as
f
:
f
.
write
(
"file1"
)
orig_dir
=
os
.
getcwd
()
try
:
os
.
chdir
(
level2
)
link
=
os
.
path
.
join
(
level2
,
"link"
)
os
.
symlink
(
os
.
path
.
relpath
(
file1
),
"link"
)
self
.
assertIn
(
"link"
,
os
.
listdir
(
os
.
getcwd
()))
# Check os.stat calls from the same dir as the link
self
.
assertEqual
(
os
.
stat
(
file1
),
os
.
stat
(
"link"
))
# Check os.stat calls from a dir below the link
os
.
chdir
(
level1
)
self
.
assertEqual
(
os
.
stat
(
file1
),
os
.
stat
(
os
.
path
.
relpath
(
link
)))
# Check os.stat calls from a dir above the link
os
.
chdir
(
level3
)
self
.
assertEqual
(
os
.
stat
(
file1
),
os
.
stat
(
os
.
path
.
relpath
(
link
)))
finally
:
os
.
chdir
(
orig_dir
)
except
OSError
as
err
:
self
.
fail
(
err
)
finally
:
os
.
remove
(
file1
)
shutil
.
rmtree
(
level1
)
class
FSEncodingTests
(
unittest
.
TestCase
):
class
FSEncodingTests
(
unittest
.
TestCase
):
def
test_nop
(
self
):
def
test_nop
(
self
):
...
...
Misc/NEWS
View file @
9c99824d
...
@@ -10,6 +10,9 @@ What's New in Python 3.2.1 release candidate 2?
...
@@ -10,6 +10,9 @@ What's New in Python 3.2.1 release candidate 2?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #12084: os.stat on Windows now works properly with relative symbolic
links when called from any directory.
- Issue #1195: my_fgets() now always clears errors before calling fgets(). Fix
- Issue #1195: my_fgets() now always clears errors before calling fgets(). Fix
the following case: sys.stdin.read() stopped with CTRL+d (end of file),
the following case: sys.stdin.read() stopped with CTRL+d (end of file),
raw_input() interrupted by CTRL+c.
raw_input() interrupted by CTRL+c.
...
...
Modules/posixmodule.c
View file @
9c99824d
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment