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

自動的にブラウザでURLを開く #37

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

clcl777
Copy link
Contributor

@clcl777 clcl777 commented Jun 15, 2024

今までは出力されたauthorization_urlを手動で開いていたが、自動で開くように修正しました。

@liebe-magi
Copy link
Owner

@clcl777
PRありがとうございました。
申し訳ございませんが、こちらの処理はどのような環境(OSやバージョン)で検証していますでしょうか?
手元のWSL2(5.15.153.1-microsoft-standard-WSL2)で動作検証したところ、以下のエラーが発生し、それ以上進めませんでした (Ctrl+Cで抜けるしかない状態になります)

Please input oauth verifier : tcgetpgrp failed: Not a tty

ちなみにブラウザで認証ページ自体は開くのでちょっと謎です…

@clcl777
Copy link
Contributor Author

clcl777 commented Jul 7, 2024

@liebe-magi
ごめんなさい、エラーがありました。
以下だと、WSLで実行したときに、Windows のデフォルトブラウザを起動できないみたいです。

webbrowser.open(authorization_url)

そのため、分岐を作成してWSLの場合とそれ以外で処理を分けました。また、ブラウザが自動で起動しなかった場合のことを考えて従来のままURLを出力するようにしました。

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

Successfully merging this pull request may close these issues.

2 participants