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
672422a3
Kaydet (Commit)
672422a3
authored
Eki 24, 2009
tarafından
Tarek Ziadé
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#7066 - Fixed distutils.archive_util.make_archive behavior so it restores the cwd
üst
1d6e2e18
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
archive_util.py
Lib/distutils/archive_util.py
+6
-4
test_archive_util.py
Lib/distutils/tests/test_archive_util.py
+16
-1
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/distutils/archive_util.py
Dosyayı görüntüle @
672422a3
...
@@ -233,9 +233,11 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
...
@@ -233,9 +233,11 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
kwargs
[
'owner'
]
=
owner
kwargs
[
'owner'
]
=
owner
kwargs
[
'group'
]
=
group
kwargs
[
'group'
]
=
group
filename
=
func
(
base_name
,
base_dir
,
**
kwargs
)
try
:
if
root_dir
is
not
None
:
filename
=
func
(
base_name
,
base_dir
,
**
kwargs
)
log
.
debug
(
"changing back to '
%
s'"
,
save_cwd
)
finally
:
os
.
chdir
(
save_cwd
)
if
root_dir
is
not
None
:
log
.
debug
(
"changing back to '
%
s'"
,
save_cwd
)
os
.
chdir
(
save_cwd
)
return
filename
return
filename
Lib/distutils/tests/test_archive_util.py
Dosyayı görüntüle @
672422a3
...
@@ -8,7 +8,8 @@ from os.path import splitdrive
...
@@ -8,7 +8,8 @@ from os.path import splitdrive
import
warnings
import
warnings
from
distutils.archive_util
import
(
check_archive_formats
,
make_tarball
,
from
distutils.archive_util
import
(
check_archive_formats
,
make_tarball
,
make_zipfile
,
make_archive
)
make_zipfile
,
make_archive
,
ARCHIVE_FORMATS
)
from
distutils.spawn
import
find_executable
,
spawn
from
distutils.spawn
import
find_executable
,
spawn
from
distutils.tests
import
support
from
distutils.tests
import
support
from
test.test_support
import
check_warnings
from
test.test_support
import
check_warnings
...
@@ -262,6 +263,20 @@ class ArchiveUtilTestCase(support.TempdirManager,
...
@@ -262,6 +263,20 @@ class ArchiveUtilTestCase(support.TempdirManager,
finally
:
finally
:
archive
.
close
()
archive
.
close
()
def
test_make_archive_cwd
(
self
):
current_dir
=
os
.
getcwd
()
def
_breaks
(
*
args
,
**
kw
):
raise
RuntimeError
()
ARCHIVE_FORMATS
[
'xxx'
]
=
(
_breaks
,
[],
'xxx file'
)
try
:
try
:
make_archive
(
'xxx'
,
'xxx'
,
root_dir
=
self
.
mkdtemp
())
except
:
pass
self
.
assertEquals
(
os
.
getcwd
(),
current_dir
)
finally
:
del
ARCHIVE_FORMATS
[
'xxx'
]
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
ArchiveUtilTestCase
)
return
unittest
.
makeSuite
(
ArchiveUtilTestCase
)
...
...
Misc/NEWS
Dosyayı görüntüle @
672422a3
...
@@ -418,6 +418,9 @@ Core and Builtins
...
@@ -418,6 +418,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #7066: archive_util.make_archive now restores the cwd if an error is
raised. Initial patch by Ezio Melotti.
- Issue #6218: io.StringIO and io.BytesIO instances are now picklable with
- Issue #6218: io.StringIO and io.BytesIO instances are now picklable with
protocol 2.
protocol 2.
...
...
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