Extractcode FileNotFoundError if using replace-originals option
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 58/100
Hướng nghiên cứu
Tái hiện lỗi bằng extractcode --verbose --replace-originals với ví dụ về một archive lồng nhau, sau đó kiểm tra extract.py trong phương thức extract và vòng lặp extract_events được nêu trong issue. Xác minh rằng lỗi trích xuất không kích hoạt việc di chuyển một thư mục đầu ra bị thiếu, và xác nhận rằng lệnh kết thúc mà không có FileNotFoundError được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
If extractcodes tries to extract and get some errors and afterwards tries to clean, up you will get error with filenotfound exception.
e.g. again gcc magic issue6550.gz archive
here traces without replace-originals
λ extractcode --verbose D:\test-extractcode\test.zip
Extracting archives...
Extracting: test.zip
Extracting: test.zip
Extracting: zweite_ebene.zip
Extracting: issue6550.gz
ERROR extracting: D:/test-extractcode/test.zip-extract/zweite_ebene.zip-extract/issue6550.gz: Error -3 while decompressing data: too many length or distance symbols
Extracting done.
with replace originals
λ extractcode --verbose --replace-originals D:\test-extractcode\test.zip
Extracting archives...
Extracting: test.zip
Extracting: test.zip
Extracting: zweite_ebene.zip
Extracting: issue6550.gz
Extracting: issue6550.gz
Traceback (most recent call last):
File "C:\WS\tools\Python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\WS\tools\Python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\WS\tools\scancode-toolkit-21.3.31\Scripts\extractcode.exe\__main__.py", line 7, in <module>
File "c:\ws\tools\scancode-toolkit-21.3.31\lib\site-packages\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "c:\ws\tools\scancode-toolkit-21.3.31\lib\site-packages\commoncode\cliutils.py", line 87, in main
**extra,
File "c:\ws\tools\scancode-toolkit-21.3.31\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "c:\ws\tools\scancode-toolkit-21.3.31\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\ws\tools\scancode-toolkit-21.3.31\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "c:\ws\tools\scancode-toolkit-21.3.31\lib\site-packages\click\decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "c:\ws\tools\scancode-toolkit-21.3.31\lib\site-packages\extractcode\cli.py", line 184, in extractcode
for xev in extraction_events:
File "c:\ws\tools\scancode-toolkit-21.3.31\lib\site-packages\click\_termui_impl.py", line 259, in next
rv = next(self.iter)
File "c:\ws\tools\scancode-toolkit-21.3.31\lib\site-packages\extractcode\api.py", line 42, in extract_archives
ignore_pattern=ignore_pattern
File "c:\ws\tools\scancode-toolkit-21.3.31\lib\site-packages\extractcode\extract.py", line 142, in extract
fileutils.copytree(target, source)
File "c:\ws\tools\scancode-toolkit-21.3.31\lib\site-packages\commoncode\fileutils.py", line 403, in copytree
names = os.listdir(src)
FileNotFoundError: [WinError 3] Das System kann den angegebenen Pfad nicht finden: 'D:\\test-extractcode\\test.zip-extract\\zweite_ebene.zip-extract\\issue6550.gz-extract'
can be fixed in the extract.py in method extract to skip moving file when event has errors.
I mean here for example:
for event in extract_events:
yield event
if replace_originals:
processed_events_append(event)
- Ngôn ngữ chính
- Python
- Star
- 39
- Fork
- 23
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aboutcode-org/extractcode
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
aboutcode-org/extractcode#77 ·
-
Investigate failing testsĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
aboutcode-org/extractcode#75 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
aboutcode-org/extractcode#73 · 4 reaction ·
-
QA Failure for vmimage extractor (vmimage.py): libguestfs configuration on UbuntuCó thể đã có người làm @ArkaprabhaChakraborty đã nhận 642 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
aboutcode-org/extractcode#69 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
aboutcode-org/extractcode#66 ·
Tất cả issue của aboutcode-org/extractcode
Issue tương tự
-
priority middle
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
KATO-Hiro/AtCoderClans#12940 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
huggingface/huggingface_hub#5283 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
ccxt/ccxt#31045 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug example
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày