load_dotenv() default behavior change in PyCharm interactive console
まだ誰も着手していません。
評価
調査の方向性
Start by reproducing the reported load_dotenv() and find_dotenv(usecwd=True) calls in a PyCharm interactive console with the .env file in the project root, comparing package versions 1.0.0 and 1.0.1+. Trace the default path-selection entry point and add or update regression coverage for the console scenario; done means the intended behavior is documented and verified.
索引モデルが issue の本文から書いたものです。
説明
Python Versions tested: 3.10, 3.11, 3.12.10
Environment: Windows (10, 11) in PyCharm interactive console
Affected package versions: 1.0.1+
When using the pycharm interactive console, the following code no longer finds the .env file by default (as of version 1.0.1).
from dotenv import load_dotenv
load_dotenv()
When testing in version 1.0.0, the load_dotenv() function will correctly find the .env file without any additional arguments. In order to successfully load a .env file located within the project's root directory, the following code must be used.
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv(usecwd=True))
From reading the documentation, it suggests that find_dotenv() doesn't use the CWD by default and works based upon the calling file's location. This creates somewhat unexpected behavior for use in pycharm's interactive console. I wouldn't have expected a change in default behavior like this in a patch release.
PyCharm and Env file Notes
- .env file is located in the project's root directory
- PyCharm console is running in the project's root directory
- 主要言語
- Python
- スター
- 8.9k
- フォーク
- 581
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
theskumar/python-dotenv のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
theskumar/python-dotenv#699 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
theskumar/python-dotenv#697 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
theskumar/python-dotenv#693 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
theskumar/python-dotenv#683 · コメント 4 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
theskumar/python-dotenv#644 · コメント 2 件 ·
theskumar/python-dotenv の issue をすべて見る
似ている issue
-
link-check link-check:sphinx-theme
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
OpenHands/extensions#626 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
CSCfi/sd-search-api#39 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100