[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Vajrasky Kok added the comment: Correction: 1. broken symlink overwrites valid symlink, 2. ordinary file overwrites broken symlink. -- ___ Python tracker ___

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Vajrasky Kok added the comment: Martin, thank you for your advice. I have added additional two test cases for broken symlink case. 1. broken symlink overwrites ordinary file, 2. ordinary file overwrites broken symlink. I hope that is enough. Let me know if you have another concern.

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Vajrasky Kok added the comment: I have added test case for broken symlinks. I am not sure whether this is necessary or not. But anyway I have added it. -- ___ Python tracker

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Vajrasky Kok added the comment: After experimenting with lexists, I don't think I can simplify it with lexists. -- ___ Python tracker ___

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Martin Panter
Martin Panter added the comment: About “lexists”, I meant using it instead of “os.path.exits” (not “islink”). On Linux: >>> targetpath = 'target' >>> os.symlink('nonexistant', dst=targetpath) # Make a broken symlink >>> os.system('ls -l') total 0 lrwxrwxrwx 1 vadmium vadmium 11 Jan 6 09:28

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Vajrasky Kok added the comment: Sorry, Martin. I just understood what you suggested. I thought you were saying lexists to replace islink, but it is to replace the complex if condition. Let me work on it. -- ___ Python tracker

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Vajrasky Kok added the comment: "I could not find a case where these methods return different result." -> This is wrong. My mistake. os.lexists returns True for non symbolic link file while os.islink returns False. -- ___ Python tracker

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Vajrasky Kok added the comment: Martin Panter, I have modernized the patch. About your suggestion: 1. "import errno" -> Yes, this is unnecessary. I have removed it. 2. Use os.path.lexists instead of os.path.islink for broken symlink -> The thing is os.path.islink returns True also for

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Change by Vajrasky Kok : -- pull_requests: +10895, 10896, 10897, 10898 stage: needs patch -> patch review ___ Python tracker ___

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Change by Vajrasky Kok : -- pull_requests: +10895, 10896, 10898 stage: needs patch -> patch review ___ Python tracker ___ ___

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Change by Vajrasky Kok : -- pull_requests: +10895, 10896 stage: needs patch -> patch review ___ Python tracker ___ ___

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Change by Vajrasky Kok : -- pull_requests: +10895 stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue19974] tarfile doesn't overwrite symlink by directory

2018-12-17 Thread Vajrasky Kok
Vajrasky Kok added the comment: Martin Panter, thank you for reviewing my patch. Let me rework it. It has been a while (4 years!!!). -- ___ Python tracker ___

[issue19974] tarfile doesn't overwrite symlink by directory

2018-12-17 Thread STINNER Victor
STINNER Victor added the comment: Martin: you review a patch written 4 years ago at https://bugs.python.org/review/19974/diff/11106/Lib/tarfile.py Oh wow, I didn't know that Rietveld was still working :-D It's maybe time to convert the old patch to a proper pull request on GitHub, no? :-)

[issue19974] tarfile doesn't overwrite symlink by directory

2018-12-15 Thread Martin Panter
Martin Panter added the comment: I’m not sure if this should be considered a bug fix, but if it goes into 2.7 it would overlap with Issue 10761 and Issue 12088. In 2.7 existing directory entries (including broken symlinks, but not including subdirectories) may be replaced by symbolic and

[issue19974] tarfile doesn't overwrite symlink by directory

2017-03-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +haypo ___ Python tracker ___ ___

[issue19974] tarfile doesn't overwrite symlink by directory

2014-06-11 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19974 ___ ___ Python-bugs-list mailing list

[issue19974] tarfile doesn't overwrite symlink by directory

2014-02-20 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the preliminary patch to address Serhiy's concern. I added some regression tests as well. Give me a time to think how to refactor the code (especially the test). -- Added file:

[issue19974] tarfile doesn't overwrite symlink by directory

2014-02-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are several issues with last patch. * Fails to extract tarfiles containing the ./ directory (very common case). * And even more common case -- fails to extract non-empty directory. -- ___ Python tracker

[issue19974] tarfile doesn't overwrite symlink by directory

2014-02-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19974 ___ ___

[issue19974] tarfile doesn't overwrite symlink by directory

2014-02-09 Thread Vajrasky Kok
Vajrasky Kok added the comment: Yeah, you are right, Serhiy. I check the behaviour of GNU tar command line. It always replaces the target no matter what kind of file source and target are. -- ___ Python tracker rep...@bugs.python.org

[issue19974] tarfile doesn't overwrite symlink by directory

2014-01-19 Thread Vajrasky Kok
Vajrasky Kok added the comment: Ah, thanks for the review, Serhiy. My bad. There is no underlying bug of tar. I was confused by the behaviour of tar which is converting the absolute path to relative path. So, adding '/home/user/dir/file' to tar when you are in '/home/user/dir' then

[issue19974] tarfile doesn't overwrite symlink by directory

2014-01-19 Thread Vajrasky Kok
Vajrasky Kok added the comment: Serhiy commented, I think we should remove targetpath in all cases. Not only when softlink is extracted. I already did that in my latest patch but I am a little bit wary of this behaviour. -- ___ Python tracker

[issue19974] tarfile doesn't overwrite symlink by directory

2014-01-16 Thread Chris Morgan
Chris Morgan added the comment: Testing passed on OSX Mavericks. -- nosy: +drpotato ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19974 ___ ___

[issue19974] tarfile doesn't overwrite symlink by directory

2014-01-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19974 ___ ___

[issue19974] tarfile doesn't overwrite symlink by directory

2014-01-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: patch review - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19974 ___ ___

[issue19974] tarfile doesn't overwrite symlink by directory

2013-12-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch that works both on Windows and Linux. -- Added file: http://bugs.python.org/file33147/fix_tarfile_overwrites_symlink_v2.patch ___ Python tracker rep...@bugs.python.org

[issue19974] tarfile doesn't overwrite symlink by directory

2013-12-14 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the preliminary path. It works and tested on Linux. I'll check the behaviour on Windows later. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file33128/fix_tarfile_overwrites_symlink.patch

[issue19974] tarfile doesn't overwrite symlink by directory

2013-12-14 Thread Vajrasky Kok
Changes by Vajrasky Kok sky@speaklikeaking.com: Removed file: http://bugs.python.org/file33128/fix_tarfile_overwrites_symlink.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19974 ___

[issue19974] tarfile doesn't overwrite symlink by directory

2013-12-14 Thread Vajrasky Kok
Changes by Vajrasky Kok sky@speaklikeaking.com: Added file: http://bugs.python.org/file33129/fix_tarfile_overwrites_symlink.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19974 ___

[issue19974] tarfile doesn't overwrite symlink by directory

2013-12-13 Thread Antony Mayi
New submission from Antony Mayi: tarfile.py compared to GNU tar doesn't overwrite existing symlink with directory of same name if such directory exists in the extracted tarball. -- components: Library (Lib) messages: 206066 nosy: antonymayi priority: normal severity: normal status:

[issue19974] tarfile doesn't overwrite symlink by directory

2013-12-13 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +lars.gustaebel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19974 ___ ___

[issue19974] tarfile doesn't overwrite symlink by directory

2013-12-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19974 ___