-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
Error with CACHE_URL passwords that end with '=' #200
Comments
The "=" is often used as a padding character at the end of base64-encoded strings. Is the password really just the base64 of a long array of random bytes? |
Correct. |
Revert "add configuration as suggested from @blueyed"
A few more examples for which a
I came across this when I tried to set the value of |
Possible related #288 (comment) I'll try to sort out |
This is resolved in |
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [django-environ](https://django-environ.readthedocs.org) ([source](https://togithub.com/joke2k/django-environ), [changelog](https://django-environ.readthedocs.org/en/latest/changelog.html)) | `==0.6.0` -> `==0.7.0` | [![age](https://badges.renovateapi.com/packages/pypi/django-environ/0.7.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/django-environ/0.7.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/django-environ/0.7.0/compatibility-slim/0.6.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/django-environ/0.7.0/confidence-slim/0.6.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>joke2k/django-environ</summary> ### [`v0.7.0`](https://togithub.com/joke2k/django-environ/blob/master/CHANGELOG.rst#v070---11-September-2021) [Compare Source](https://togithub.com/joke2k/django-environ/compare/v0.6.0...v0.7.0) Added \+++++ - Added support for negative float strings `#​160 <https://github.com/joke2k/django-environ/issues/160>`\_. - Added Elasticsearch5 to search scheme `#​297 <https://github.com/joke2k/django-environ/pull/297>`\_. - Added Elasticsearch7 to search scheme `#​314 <https://github.com/joke2k/django-environ/issues/314>`\_. - Added the ability to use `bytes` or `str` as a default value for `Env.bytes()`. Fixed \+++++ - Fixed links in the documentation. - Use default option in `Env.bytes()` `#​206 <https://github.com/joke2k/django-environ/pull/206>`\_. - Safely evaluate a string containing an invalid Python literal `#​200 <https://github.com/joke2k/django-environ/issues/200>`\_. Changed \+++++++ - Added 'Funding' and 'Say Thanks!' project urls on pypi. - Stop raising `UserWarning` if `.env` file isn't found. Log a message with `INFO` log level instead `#​243 <https://github.com/joke2k/django-environ/issues/243>`\_. </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/GoogleCloudPlatform/python-docs-samples).
This is somewhat similar to #194. A cache password that ends with the
=
character raises an error when callingenv.cache
. Even escaping it (%3D
) will not work.It looks like the
cast
method works by trying to just convert to a value and if that fails with aValueError
, it assumes the value is string (see code). However, a string that ends in a=
will throw aSyntaxError
instead of aValueError
:If you think the solution is just to catch a
SyntaxError
in addition to aValueError
, I'm happy to make a PR.Normally I'd just change the password but on Azure the generated cache passwords always end with a
=
for some reason.The text was updated successfully, but these errors were encountered: