Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
268e61cf
Kaydet (Commit)
268e61cf
authored
Haz 03, 2005
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
component of the path.
üst
56616999
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
posixpath.py
Lib/posixpath.py
+1
-1
test_posixpath.py
Lib/test/test_posixpath.py
+20
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/posixpath.py
Dosyayı görüntüle @
268e61cf
...
...
@@ -414,7 +414,7 @@ symbolic links encountered in the path."""
if
isabs
(
filename
):
bits
=
[
'/'
]
+
filename
.
split
(
'/'
)[
1
:]
else
:
bits
=
filename
.
split
(
'/'
)
bits
=
[
''
]
+
filename
.
split
(
'/'
)
for
i
in
range
(
2
,
len
(
bits
)
+
1
):
component
=
join
(
*
bits
[
0
:
i
])
...
...
Lib/test/test_posixpath.py
Dosyayı görüntüle @
268e61cf
...
...
@@ -476,6 +476,26 @@ class PosixPathTest(unittest.TestCase):
self
.
safe_rmdir
(
ABSTFN
+
"/k/y"
)
self
.
safe_rmdir
(
ABSTFN
+
"/k"
)
self
.
safe_rmdir
(
ABSTFN
)
def
test_realpath_resolve_first
(
self
):
# Bug #1213894: The first component of the path, if not absolute,
# must be resolved too.
try
:
old_path
=
abspath
(
'.'
)
os
.
mkdir
(
ABSTFN
)
os
.
mkdir
(
ABSTFN
+
"/k"
)
os
.
symlink
(
ABSTFN
,
ABSTFN
+
"link"
)
os
.
chdir
(
dirname
(
ABSTFN
))
base
=
basename
(
ABSTFN
)
self
.
assertEqual
(
realpath
(
base
+
"link"
),
ABSTFN
)
self
.
assertEqual
(
realpath
(
base
+
"link/k"
),
ABSTFN
+
"/k"
)
finally
:
os
.
chdir
(
old_path
)
self
.
safe_remove
(
ABSTFN
+
"link"
)
self
.
safe_rmdir
(
ABSTFN
+
"/k"
)
self
.
safe_rmdir
(
ABSTFN
)
# Convenience functions for removing temporary files.
def
pass_os_error
(
self
,
func
,
filename
):
...
...
Misc/NEWS
Dosyayı görüntüle @
268e61cf
...
...
@@ -136,6 +136,9 @@ Extension Modules
Library
-------
- Bug #1213894: os.path.realpath didn'
t
resolve
symlinks
that
were
the
first
component
of
the
path
.
-
Patch
#
1120353
:
The
xmlrpclib
module
provides
better
,
more
transparent
,
support
for
datetime
.{
datetime
,
date
,
time
}
objects
.
With
use_datetime
set
to
True
,
applications
shouldn
't have to fiddle with the DateTime wrapper
...
...
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