python-decouple icon indicating copy to clipboard operation
python-decouple copied to clipboard

Fix infinite recursion on Windows

Open ibachar-es opened this issue 2 years ago • 1 comments

On windows, when running using VSCode and using the integrated terminal to launch my application, _caller_path returns a path starting with c:\ (lowercase) while os.path.abspath(os.sep) return C:\ (uppercase). This causes infinite recursion in _find_file

ibachar-es avatar Jun 09 '22 06:06 ibachar-es

Can you please provide a test case?

henriquebastos avatar Jun 09 '22 13:06 henriquebastos

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.19%.

Quality metrics Before After Change
Complexity 1.86 ⭐ 1.81 ⭐ -0.05 👍
Method Length 40.66 ⭐ 41.12 ⭐ 0.46 👎
Working memory 5.46 ⭐ 5.39 ⭐ -0.07 👍
Quality 84.47% 84.66% 0.19% 👍
Other metrics Before After Change
Lines 296 304 8
Changed files Quality Before Quality After Quality Change
decouple.py 82.34% ⭐ 82.22% ⭐ -0.12% 👎
tests/test_autoconfig.py 88.93% ⭐ 89.34% ⭐ 0.41% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
decouple.py RepositoryEnv.__init__ 10 🙂 114 🙂 11 😞 55.54% 🙂 Extract out complex expressions
decouple.py Config.get 7 ⭐ 81 🙂 11 😞 62.91% 🙂 Extract out complex expressions
decouple.py Csv.__init__ 0 ⭐ 42 ⭐ 10 😞 77.78% ⭐ Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

sourcery-ai[bot] avatar Nov 13 '22 08:11 sourcery-ai[bot]

@henriquebastos Done

ibachar-es avatar Nov 13 '22 08:11 ibachar-es

@henriquebastos It seems Sourcery complains about lines of code I didn't change in this PR

ibachar-es avatar Dec 04 '22 10:12 ibachar-es