Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(v0.6.16) System ERROR: cannot fit 'int' into an index-sized integer #35

Closed
Frozen5293 opened this issue Apr 15, 2021 · 10 comments
Closed

Comments

@Frozen5293
Copy link

Frozen5293 commented Apr 15, 2021

As the title says , when I downloading.

@PeterDing
Copy link
Owner

请务必确保你的描述依从 bug issus 模板,不然无法找到问题。

@Frozen5293
Copy link
Author

Frozen5293 commented Apr 15, 2021

003.png
002.png
001.png

  • BaiduPCS-Py Version: v0.6.16
  • Python Version: 3.7.7
  • OS:Windows10 2004

复现方式:

​ 1.添加用户

​ 2.下载

​ 3.问题出现

找不到这个

  • Runing log / 运行日志 Please follow steps to paste the content of file ~/.baidupcs-py/running.log.

@PeterDing
Copy link
Owner

PeterDing commented Apr 15, 2021

运行日志:

  1. 删除 ~/.baidupcs-py/running.log,如果存在。
  2. 在问题发生的命令前加入环境变量 LOG_LEVEL=DEBUG
    例如:LOG_LEVEL=DEBUG BaiduPCS-Py upload /abc /
    Windows 上,设置环境变量如下:
set LOG_LEVEL=DEBUG

然后再运行出现问题的命令。
3. 在问题出现后,贴出 ~/.baidupcs-py/running.log 中的内容。

@Frozen5293
Copy link
Author

2021-04-15 13:44:53,533 | DEBUG | download: download: sifters: [], recursive: False, from_index: 0, downloader: Downloader.me, downloadparams: DownloadParams(chunk_size='1048576', concurrency=5, quiet=False), out_cmd: False, has encrypt_password: False
2021-04-15 13:44:53,533 | DEBUG | download: download: remotepaths should be uniq 1 == 1
2021-04-15 13:44:56,136 | DEBUG | app: app: _exit_progress_bar: stop progress bar
2021-04-15 13:44:56,157 | DEBUG | app: app: System Error: Traceback (most recent call last):
File "c:\users\USR\appdata\local\programs\python\python37-32\lib\site-packages\baidupcs_py\app\app.py", line 117, in wrap
return func(*args, **kwargs)
File "c:\users\USR\appdata\local\programs\python\python37-32\lib\site-packages\baidupcs_py\app\app.py", line 175, in wrap
return func(*args, **kwargs)
File "c:\users\USR\appdata\local\programs\python\python37-32\lib\site-packages\baidupcs_py\app\app.py", line 984, in download
encrypt_password=encrypt_password,
File "c:\users\USR\appdata\local\programs\python\python37-32\lib\site-packages\baidupcs_py\commands\download.py", line 405, in download
encrypt_password=encrypt_password,
File "c:\users\USR\appdata\local\programs\python\python37-32\lib\site-packages\baidupcs_py\commands\download.py", line 311, in download_file
encrypt_password=encrypt_password,
File "c:\users\USR\appdata\local\programs\python\python37-32\lib\site-packages\baidupcs_py\commands\download.py", line 84, in download
encrypt_password=encrypt_password,
File "c:\users\USR\appdata\local\programs\python\python37-32\lib\site-packages\baidupcs_py\commands\download.py", line 175, in _me_download
length = len(meDownloader)
File "c:\users\USR\appdata\local\programs\python\python37-32\lib\site-packages\baidupcs_py\common\io.py", line 1051, in len
return len(self._auto_decrypt_request)
OverflowError: cannot fit 'int' into an index-sized integer

2021-04-15 13:44:56,657 | DEBUG | app: app: _teardown: start
2021-04-15 13:44:56,657 | DEBUG | app: app: _teardown: end

running.log

@PeterDing
Copy link
Owner

你运行的 python3 应该是 32位的吧。
32位的 python3 在处理一些大数的时候,可能有一些问题,见 boto/boto3#2457

你可以换用 64位的 python3 试试。 比如 https://www.python.org/ftp/python/3.9.4/python-3.9.4-amd64.exe

@PeterDing
Copy link
Owner

python 的 int 数据应该不会有大小限制。出这个错,我目前也不太明白。但是换 64位的试试吧

@PeterDing
Copy link
Owner

@Frozen5293
Copy link
Author

但是之前运行过一次,是可以使用的,这不是很奇怪吗

@PeterDing
Copy link
Owner

出现报错的文件 是.7 应该大于或等于 2G 吧。
好像 python 32位的 __len__ 方法返回结果大于 2G 就是这个错。

你可以自己检查一下:
用python 32 位运行下面的代码:

class A:
    def __len__(self):
        return 1 << 33

a = A()
len(a)

应该会报 OverflowError: cannot fit 'int' into an index-sized integer

@Frozen5293
Copy link
Author

Frozen5293 commented Apr 15, 2021

虽然我把32位的卸载了,应该就是这个问题了,感谢回复
之前下载的就是小于2G的,这次几个测试都是大于的

ps:装回来了
004.png

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants