This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: using zipfile with root privilege shows FileNotFoundError
Type: behavior Stage: resolved
Components: Versions: Python 3.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Patrick Liu, iritkatriel
Priority: normal Keywords:

Created on 2019-12-28 09:56 by Patrick Liu, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg358937 - (view) Author: (Patrick Liu) Date: 2019-12-28 09:56
When I run the python script with root privilege, it can clone the repo successfully but with the error message as follow.
However, it runs correctly with normal user.
Why it cannot find the html file? Thanks.

Python 3.7.4 (default, Aug 13 2019, 20:35:49) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from git_clone import git_clone
>>> git_clone('https://github.com/android9527/android9527.github.io')
13472.0 KB, 13574 KB/s, 0.99 seconds passed         Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/anaconda3/lib/python3.7/site-packages/git_clone/git_clone.py", line 53, in git_clone
    f.extractall(path + '/.')
  File "/root/anaconda3/lib/python3.7/zipfile.py", line 1619, in extractall
    self._extract_member(zipinfo, path, pwd)
  File "/root/anaconda3/lib/python3.7/zipfile.py", line 1673, in _extract_member
    open(targetpath, "wb") as target:
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/fit-Knowledgezoo/test/android9527.github.io-master/2019/01/24/2019-01-24-Java 重入锁 synchronized /index.html'
>>> exit()
msg410991 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-19 23:53
3.7 is no longer maintained. Please create a new issue if you are having this problem on a current version (>= 3.9).
History
Date User Action Args
2022-04-11 14:59:24adminsetgithub: 83328
2022-01-19 23:53:54iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg410991

resolution: out of date
stage: resolved
2019-12-28 09:56:02Patrick Liucreate