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

Jishaku version occasionally appears as vNone in selftest #205

Closed
4 tasks done
tuna2134 opened this issue May 7, 2023 · 5 comments
Closed
4 tasks done

Jishaku version occasionally appears as vNone in selftest #205

tuna2134 opened this issue May 7, 2023 · 5 comments

Comments

@tuna2134
Copy link
Contributor

tuna2134 commented May 7, 2023

Summary

When I run jsk root command, jishaku show me like this image.
IMG_0470

Reproduction steps

When I run jsk command.

Checklist

  • I have updated discord.py and jishaku to the latest available versions and have confirmed that this issue is still present
  • I have searched the open issues for duplicates
  • I have shown the entire traceback, if possible
  • I have removed my token from display, if visible

System information

- Python v3.10.7-final
- discord.py v2.2.2-final
- aiohttp v3.8.3
- system info: Linux 5.15.0-48-generic #54~20.04.1-Ubuntu SMP Thu Sep 1 16:17:26 UTC 2022
@tuna2134 tuna2134 changed the title I can’t look jishaku version I can’t took jishaku version May 8, 2023
@scarletcafe
Copy link
Owner

I've encountered this a few times around the place, and last I checked, it traces back to module lookup creation in distutils. If with pip you somehow break one of your packages - or one ends up in a transient state while distutils is trying to deal with it, the creation will fail and distutils will remain forever unable to pull information from any package until the interpreter is restarted.

It's not an easy bug to reproduce, and its root cause is not possible to fix because it is caused by pip not us. But, some kind of workaround should be implemented that maybe doesn't rely on distutils if it coughs up evidence that it broke its database.

@tuna2134
Copy link
Contributor Author

tuna2134 commented May 16, 2023

なにか必要な情報ありますか?

@scarletcafe
Copy link
Owner

jishakuのバージョン情報を取得するには二つの方法があります:
① jishaku内のバージョン情報 (jishaku.version_info, jishaku.__version__)
② pkg_resourcesの記録されたバージョン (つまり pip show とかで出るバージョン)
内容はほとんど同じですが、 GitHubからインストールした場合、gitハッシュとコミット数 (a1234+g1234abc.master の部分) はもちろんパッケージに埋め込んでないので、selftestはそれを表示するには 3fd1470 で取得方法は ① から ② になりました。
ですが、pkg_resourcesはなぜかかなり敏感なもので、一瞬でも異常事態が起こったら (例えばpipがクラッシュするとか) 内部データベースが破損されてしまい、お待ちかねの vNone が出てしまいます。
だから、正確に言えばこれは jishaku 自体のバグじゃないけど、それでも煩わしいので修正したいです。今破損してる環境持ってないので、site-packagesのコンテンツをzipにしてアップロードできれば助かるけど、そうではない場合は自分でこの状態になるまで待つしかない。

逆に早速で直したいのであれば、site-packagesを確認して異変があるかを確かめてみてください。おそらく、~が先頭にある (例えば ~iohttp とか) pipの痕跡フォルダーが残っていて、それを消してインタプリタを再起動すればデータベースが無事に再構築されるはず。

@scarletcafe scarletcafe changed the title I can’t took jishaku version Jishaku version occasionally appears as vNone in selftest May 17, 2023
@tuna2134
Copy link
Contributor Author

tuna2134 commented May 17, 2023

Okay, I'll do after I finish exam.

@scarletcafe
Copy link
Owner

pkg_resources usage was replaced in #213. I'm going to assume that this fixes this issue. If it occurs again just reopen.

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

No branches or pull requests

2 participants