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

Require Werkzeug and import safe_utils from there, not Flask #360

Merged
merged 1 commit into from
Mar 30, 2022

Conversation

bryce-carson
Copy link
Contributor

@bryce-carson bryce-carson commented Mar 29, 2022

Flask removed the already deprecated function safe_utils in 2.1.0.

This shoudl be enough to resolve #359

Flask removed the already deprecated function `safe_utils` in `2.1.0`.
@zodman
Copy link

zodman commented Mar 30, 2022

works for me!

@joeyespo joeyespo merged commit 575498f into joeyespo:master Mar 30, 2022
@joeyespo
Copy link
Owner

Thanks for the PR, @bryce-carson!

I started looking at this after the 4.6.0 was released, but wanted to spend more time making sure it was still compatible with older Flask/Werkzeug versions. Crediting you in CHANGES.md since you got this PR up so quickly after Flask's recent release 😃

If you're curious, here's what was done for backwards compatibility

  • Port Flask's behavior of raising an exception in the error case since Werkzeug's implementation returns None instead (details)
  • Fix a test that identified an edge case between Flask/Werkzeug versions (details).

This should allow Grip to continue to function when using older versions Flask and Werkzeug (until support is officially dropped in the next major release of Grip).

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Apr 30, 2024
- Fix "ImportError: cannot import name 'safe_join' from 'flask'" when using Flask 2.1.0+ ([#360](joeyespo/grip#360) - thanks, [@bryce-carson][]!)

- Update output and **fix style issues**
- Add support for **Python 3.7, 3.8, 3.9, 3.10**
- Improve handling of PDFs and other binary files
- Fix deprecation warnings from newer dependency versions

- End-of-life [Python versions](https://devguide.python.org/#status-of-python-branches) no longer intentionally supported
  - Python 2.6, 2.7 (Python 2 compatibility will be removed entirely in the next major release)
  - Python 3.0, 3.1, 3.2, 3.3 ([#275](joeyespo/grip#275) - thanks, [@svisser][]!), 3.4, 3.5, 3.6
- Current [dependency versions](requirements.txt) (more recent versions will be required in the next major release)

- Fix typo in error message ([#266](joeyespo/grip#266) - thanks, [@Godron629][]!)
- Update HTML/CSS scaffold to match GitHub ([#297](joeyespo/grip#297) - thanks, [@phyllisstein][]!)
- Fix tests by adding a missing `USER_CONTEXT` argument to one of the `GitHubRenderer` calls
- Serve non-`text/` MIME types as raw files for better handling of, e.g. PDF files ([#234](joeyespo/grip#234) - thanks, [@wvspee][]!)
- Fix style parsing, which caused some styles to be missing ([#347](joeyespo/grip#347))

- Readme: Update to correct `--no-inline` option ([#267](joeyespo/grip#267) - thanks, [@TomDLT][]!)
- Readme: Fix links to Grip class ([#276](joeyespo/grip#276) - thanks, [@jacebrowning][]!)
- Readme: Clarify that this sends your markdown to GitHub ([#251](joeyespo/grip#251) - thanks, [@courajs][]!)
- Update `pytest` usages (see [pytest 3.0.0 changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst#300-2016-08-18))
- Add `.pytest_cache` to `.gitignore` ([#287](joeyespo/grip#287) - thanks, [@svisser][]!)
- Add `.venv` and `.idea` to `.gitignore` and clean up
- Add `flake8` test dependency and fix linting errors ([#299](joeyespo/grip#299))
- Add `pytest` test dependency ([#294](joeyespo/grip#294) - thanks, [@Methacrylon][]!)
- License: Distribute LICENSE file ([#274](joeyespo/grip#274) - thanks, [@synapticarbors][]!)
- License: Update year
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.

safe_join in Flask is deprecated
3 participants