Message223568
set root_dir do not work
output:
=====================================================
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import shutil
>>> shutil.make_archive("tmp.tar.gz", "gztar", "c:/xjtu", "c:/tmp")
'C:\\Python34\\tmp.tar.gz.tar.gz'
=====================================================
source code of make_archive()
=====================================================
756 save_cwd = os.getcwd()
757 if root_dir is not None:
758 if logger is not None:
759 logger.debug("changing into '%s'", root_dir)
760 base_name = os.path.abspath(base_name)
761 if not dry_run:
762 os.chdir(root_dir)
...
...
782 try:
783 filename = func(base_name, base_dir, **kwargs)
784 finally:
=====================================================
base_name is set before chdir, so the archive always be created in cwd, whether set root_dir or not.
so, line 760 should be move below line 762 |
|
Date |
User |
Action |
Args |
2014-07-21 09:50:13 | DemoHT | set | recipients:
+ DemoHT |
2014-07-21 09:50:13 | DemoHT | set | messageid: <1405936213.68.0.143186152462.issue22021@psf.upfronthosting.co.za> |
2014-07-21 09:50:13 | DemoHT | link | issue22021 messages |
2014-07-21 09:50:13 | DemoHT | create | |
|