Make path to file on Windows works on Linux

How fix_retry_env works?

  1. This is Windows path, we’re running on Windows.
  2. This is Windows path, we’re running on POSIX.
  • python-dotenv support only POSIX-type slashes
  • Windows works fine with “incorrect” slashes, it can successfully resolve them.

This is Windows path, we’re running on Windows.

This is Windows path, we’re running on POSIX.

  1. To use another separator instead of os.pathsep (check docstring of fix_retry_env() function how to do it).
  2. Don’t specify driver later inside path (may be Windows will correctly recognize it, I didn’t check) .
  3. To define mount without driver latter (on POSIX or inside Docker container).

--

--

--

Senior Software Engineer at Pursway

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Amazing Ways You Can Use Java

How I got into tech through apprenticeship

Preventing Your Cloud Migration And Management Costs From Going Off the Rail

CI/CD For Python Code Using Azure, Jenkins, Nginx, and GitHub: Part One

Letter for a PO

Fun with AWS Lambda, illustrated by cats

Critical Analysis Of KDT — a reply to Nikolay Advolodkin

How embedded databases help make grids smarter

RaimaDMA030 - How embedded databases help make grids smarter - Pic1

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
alex_ber

alex_ber

Senior Software Engineer at Pursway

More from Medium

Elementary operations in PyCUDA

10 PSQL String FunctionsThat You Must Know

1-Introduction to Python

Python Lambda Function