MarkupSafe 1.1.0 Released

written by David Lord on 2018-11-05 in Releases

Changelog

  • Dropped support for Python 2.6 and 3.3.
  • Using newer CPython APIs gave the C extension a 1.5x speedup on Python 3. Python 2 will still get the same speed as before, but you should consider upgrading if possible.
  • The escape function uses the __html__ method on an object if it's available. It will now ensure that result is wrapped in the Markup class, for consistency with other behavior.

Platform Wheels

Installing from PyPI with pip will now install a precompiled wheel if available. Wheels have been compiled for supported CPython versions on Linux, Mac, and Windows.

MarkupSafe comes with a C extension that adds a significant speedup to escaping. However, if a compiler or headers aren't available, the install will fall back to a native Python implementation. Previously, the user would see no indication that they didn't get the speedups, or would see confusing error messages even though the install succeeded. Now, many more users will be able to take advantage of the speedups provided by MarkupSafe without extra configuration.

Documentation

Full documentation has been added in place of the previous README. It is available through Read the Docs at https://markupsafe.palletsprojects.com/.

Install or Upgrade

Install from PyPI with pip:

pip install -U MarkupSafe

We accept donations through the Python Software Foundation in order to support our efforts to maintain the projects and grow the community. Click here to donate.

itsdangerous 1.1.0 Released

written by David Lord on 2018-10-26 in Releases

itsdangerous 1.1.0 has been released to fix compatibility issues that were affecting projects while upgrading. Due to these issues, we had to make a quick decision and pull itsdangerous 1.0.0 from PyPI earlier today to prevent more projects from being affected. We appologize for the difficulty this caused, and the changes in this release should address compatibilty going forward.

1.0.0 changed the default digest algorithm from SHA-1 to SHA-512. SHA-1 as used by itsdangerous was never suceptible to the collision issue published last year, but the change was made for peace of mind. However, this change invalidated existing signatures that were in use.

To address this, 1.1.0 reverts the default digest to SHA-1. It also adds a fallback mechanism to try other algorithms when unsigning. This gives projects a safe way to upgrade signing parameters in the future, while still supporting existing signatures during the upgrade period. A default fallback for SHA-512 was added to support projects that were already affected by the 1.0.0 version. 1.1.0 is therefore compatible with both 0.24 and 1.0.0, so upgrading should be safe in either case.

Additionally, we reverted a change to the project name in setup.py. 1.0.0 changed the capitalization from "itsdangerous" to "ItsDangerous", but this caused issues with some systems. The name will remain as "itsdangerous".

We appologize again for the issues and thank everyone in the community who contributed to the discussion.

Upgrade

Install from PyPI with pip:

pip install -U itsdangerous

It's Dangerous 1.0.0 Released

written by David Lord on 2018-10-18 in Releases

It's Dangerous 1.0.0 has been released. See the changelog for a list of changes since the last release on 2014-03-28.

It's Dangerous provides secure message signing and serialization. Without the secret key used to sign a message, the content cannot be changed without invalidating the signature. This allows, for example, Flask to store information in a session cookie that is transmitted over public networks, and be sure that the data has not been tampered with when loading a subsequent request.

Install or Upgrade

Install from PyPI with pip:

pip install -U ItsDangerous

Imports will change

Previously, It's Dangerous was a single Python module with about 1000 lines of code. The project has been reorganized as a package with submodules, which will make the code easier to navigate going forward.

However, this means that everything that It's Dangerous imported or defined used to be importable from itsdangerous. With the reorganization, only the public API is importable from itsdangerous. To ease transition, "public" was defined as any name that was previously documented in the API section. These compatibility imports will be deprecated and removed in future releases. If you were importing undocumented names, you'll need to import them from the correct submodule now.

Read the Docs

It's Dangerous has moved its docs to Read the Docs. The new URL for the docs is https://itsdangerous.palletsprojects.com/.

The docs were previously hosted on PyPI's docs site (pythonhosted.org/itsdangerous), but this site has been deprecated and it is no longer possible to upload new docs there. Unfortunately, due to the deprecation, there is no way to add a redirect to the new docs. As of this release, any URLs pointing to the old site will break.

Get Involved

The Pallets team depends on you, the community, to help keep our projects sustainable. Whether you report issues, write documentation, create patches, or answer questions, we appreciate all the help you provide. Star the project on GitHub to show support, and watch the repository to see discussions and pull requests as they happen.

We accept donations through the Python Software Foundation in order to support our efforts to maintain the projects and grow the community. Click here to donate.

Click 7.0 Released

written by David Lord on 2018-09-25 in Releases

The Pallets team is pleased to release Click 7.0. Thank you to everyone who contributed online and in person at the PyCon US 2018 sprint! With the help of the community as well as some new maintainers, we've managed to resolve hundreds of long standing issues and pull requests.

Due to the length of time since the last release, there are a significant number of new features and fixes. Check out the changelog for a list of all code changes and links to the relevant issues. Changes include:

  • Shell autocompletion has improved in a number of areas.
    • Native ZSH completion was added, and supports its enhanced parameter documentation.
    • The choice type can be completed.
    • Completion correctly handles chained commands, spaces, defaults, and partial completions.
    • Parameters can provide a callback to customize completion.
  • On Windows click.echo can now output more than 16k characters in one call. On Windows 7, a 64k limit on binary stream output is also worked around.
  • click.getchar returns Unicode on Windows.
  • When piping input and output, more cases of closed pipes are detected and handled instead of raising errors.
  • The CliRunner used for testing separates stdout and stderr.
  • New DateTime and FloatRange parameter types.
  • Flags to mark a parameter as hidden or deprecated.
  • Numerous improvements and fixes to i/o, help, parameters, and testing.

Read the Docs

Click is the first Pallets project to move its docs to Read the Docs. Our projects currently use a custom builder and hosting, but this became too difficult with limited maintainer time. Thank you to everyone at RTD who helped with the transition!

The new URL for the docs is https://click.palletsprojects.com/. The old http://click.pocoo.org/ domain will redirect to the new one while we continue to migrate, but will eventually go away. Please use the new URL going forward.

Click's docs use a custom Sphinx theme and extensions. As part of the move, these were extracted to a separate Python package. Install Pallets-Sphinx-Themes to use Click's theme when writing extensions for a more cohesive look.

Install or Upgrade

Install from PyPI with pip:

pip install -U Click

Get Involved

Click and the Pallets team depends on you, the community. Whether you report issues, write documentation, create patches, or answer questions, we appreciate all the help you provide. Star the project on GitHub to show support, and watch the repository to see discussions and pull requests as they happen.

We now accept donations through the Python Software Foundation in order to support our efforts to maintain the projects and grow the community. Click here to donate.

PyCon and Adding Maintainers to Click

written by David Lord on 2018-06-01 in Meta

In May I attended PyCon US 2018 in Cleveland, Ohio. It's a great opportunity to meet people interested in the Pallets projects and Python web applications. It can be a little intimidating, but also a lot of fun. The biggest difficulty is that there are too many things to do, and I always wish everyone could have a few more days together.

During the main conference, while talks are happening, anyone can organize "open spaces," impromptu meetings for any topic. I organized a Pallets open space, and we had a huge turnout. I was kind of unprepared for the size, so we started with people asking me questions, and then split up into tables for new users, Flask, Click, and Jinja.

Open space announcement

For up to four days after the talks, developers get together for sprints, working together to contribute to Python open source projects. Experienced developers help new ones learn how to contribute, and everyone gets to learn about new projects and meet the developers behind them.

Pallets open space

At the open space, I had mentioned that no one had really been maintaining Click for the past year. It turns out a lot of people use Click. They came motivated from the open space to contribute during the sprint. Some were new to contributing, but they all had one thing in common: they knew how Click was being used more than I did! So I took a chance and gave them all write permissions to the repository. Click started at ~250 open issues and 68 pull requests. After 2 days, it was at 140 issues and 22 pull requests. Wow! With that success, I'm officially welcoming all these new maintainers to the Pallets Click team. While Click stole the show, we had great contributions to Werkzeug, Flask, and Jinja as well.

Dinner with Pallets sprinters

If you want to get involved, a great way is to watch our repositories on GitHub. You'll get notifications for each issue, so you can see what's happening and start contributing. You can help by triaging issues, improving tests and documentation, and fixing bugs. If your company uses a Pallets project like Flask, Click, or Jinja, consider pointing them to our PSF donation page. Donations will help get maintainers to more events so we can do more sprints like this one. Thank you to everyone at PyCon and in the community for making Pallets a success!

Donate to Support Pallets

written by David Lord on 2018-04-26 in Meta

Pallets is excited to announce that we have joined the Python Software Foundation's Fiscal Sponsorship program. As a non-profit organization, the PSF will accept donations on behalf of Pallets into a dedicated account.

Donations enable more attention from maintainers, which translates into more time devoted to fixing bugs, developing features, and making quicker releases. Click here to donate today.

The Pallets organization develops and supports Flask, Jinja, Werkzeug, Click, and other Python libraries. These libraries power applications of all sizes around the world, and are downloaded millions of times each month. Despite their popularity, the projects are primarily maintained by only a few developers. The goal of Pallets is to grow the community around these projects to create a sustainable group of contributors and users.

Your donation will help:

  • Allow maintainers to devote more of their time to the projects.
  • Recognize outstanding contributors in the community.
  • Allow maintainers and community members to attend conferences.
  • Acquire infrastructure and developer tools.
  • Sponsor local meetup events.
  • And more!

If you like the work we do, you may donate as an individual. If your employer uses Flask or any of the Pallets projects, reach out to them to donate.

Flask and the Pallets team depends on you, the community. We thank you for all the contributions you've already made, and look forward to growing the community even more.

Click here to donate today.

Flask 1.0 Released

written by David Lord on 2018-04-26 in Security , Releases

The Pallets team is pleased to release Flask 1.0.

The Flask framework has been stable for a long time. A little more than 8 years after the first commit, the version number finally reflects that. 1.0 comes with a significant number of changes representing over a year of work.

  • Dropped support for Python 2.6 and 3.3.
  • The CLI is more flexible. FLASK_APP can point to an app factory, optionally with arguments. It understands import names in more cases where filenames were previously used. It automatically detects common filenames, app names, and factory names. FLASK_ENV describes the environment the app is running in, like development, and replaces FLASK_DEBUG in most cases. See the docs to learn more.
  • If python-dotenv is installed, the flask CLI will load environment variables from .flaskenv and .env files rather than having to export them in each new terminal.
  • The development server is multi-threaded by default to handle concurrent requests during development.
  • flask.ext, which was previously deprecated, is completely removed. Import extensions by their actual package names.
  • Accessing missing keys from request.form shows a more helpful error message in debug mode, addressing a very common source of confusion for developers.
  • Error handlers are looked up by code then exception class, on the blueprint then application. This gives more predictable control over handlers, including being able to handle HTTPException.
  • The behavior of app.logger has been greatly simplified and should be much easier to customize. The logger is always named flask.app, it only adds a handler if none are registered, and it never removes existing handlers. See the docs to learn more.
  • The test_client gained a json argument for posting JSON data, and the Response object gained a get_json method to decode the data as JSON in tests.
  • A new test_cli_runner is added for testing an app's CLI commands.
  • Many documentation sections have been rewritten to improve clarity and relevance. This is an ongoing effort.
  • The tutorial and corresponding example have been rewritten. They use a structured layout and go into more detail about each aspect in order to help new users avoid common issues and become comfortable with Flask.

There are many more changes throughout the framework. Read the full changelog to understand what changes may affect your code when upgrading.

JSON Security Fix

Flask previously decoded incoming JSON bytes using the content type of the request. Although JSON should only be encoded as UTF-8, Flask was more lenient. However, Python includes non-text related encodings that could result in unexpected memory use by a request.

Flask will now detect the encoding of incoming JSON data as one of the supported UTF encodings, and will not allow arbitrary encodings from the request.

Install or Upgrade

Install from PyPI with pip:

pip install -U Flask

Get Involved

Flask and the Pallets team depends on you, the community. Whether you report issues, write documentation, create patches, or answer questions, we appreciate all the help you provide. Check out the contributing guide to get started.

The Pallets organization has joined the Python Software Foundation's Fiscal Sponsorship program. We now accept donations through the PSF in order to support our efforts to maintain the projects and grow the community. Click here to donate.

Flask 0.12.3 Released

written by David Lord on 2018-04-26 in Releases , Security

This release includes an important security fix for JSON and a minor backport for CLI support in PyCharm. It is provided for projects that cannot update to Flask 1.0 immediately. See the 1.0 announcement and update to it instead if possible.

JSON Security Fix

Flask previously decoded incoming JSON bytes using the content type of the request. Although JSON should only be encoded as UTF-8, Flask was more lenient. However, Python includes non-text related encodings that could result in unexpected memory use by a request.

Flask will now detect the encoding of incoming JSON data as one of the supported UTF encodings, and will not allow arbitrary encodings from the request.

Upgrade

Upgrade from PyPI with pip. Use a version identifier if you want to stay at 0.12:

pip install -U Flask==0.12.3

Or upgrade to 1.0:

pip install -U Flask

Werkzeug 0.14 Released

written by Armin Ronacher on 2017-12-31 in Releases

The Pallets team is pleased to release Werkzeug 0.14. Changes include:

  • Improved the usefulness of Request.application by automatically handling HTTP exceptions.
  • Added support for platforms that lack SpooledTemporaryFile. This primarily affects GAE users which were unable to use 0.13 due to this missing API.
  • Add support for etag handling through if-match
  • Added support for the SameSite cookie attribute along with better support for invalid cookies.
  • Added a HTTP proxying middleware (werkzeug.wsgi.ProxyMiddleware)
  • Various improvements for the reloader.
  • The built-in HTTP server will no longer close a connection in cases where no HTTP body is expected (204, 204, HEAD requests etc.)
  • Werkzeug will no longer send the content-length header on 1xx or 204/304 responses.
  • Added support for static weights in URL rules.
  • Better handle some more complex reloader scenarios where sys.path contained non directory paths.

Read the full changelog.

Install or upgrade

Install from PyPI with pip:

pip install -U Werkzeug

Get Involved

Werkzeug and the Pallets team depends on you, the community. Whether you report issues, write documentation, create patches, or answer questions, we appreciate all the help you provide. We updated the contributing guide to help make it easier to get started.

Werkzeug 0.13 Released

written by David Lord on 2017-12-07 in Releases

The Pallets team is pleased to release Werkzeug 0.13. Changes include:

  • Deprecated Python 2.6 and 3.3 support. The next version, 0.14, will remove support.
  • The built-in development server supports receiving requests with Transfer-Encoding: chunked.
  • Header options without an extended encoding can contain single quotes. For example, filename=t'es't.txt is now valid.
  • Removed werkzeug.script in favor of Click.

Read the full changelog.

Install or upgrade

Install from PyPI with pip:

pip install -U Werkzeug

The PGP key ID used for this release is David Lord: 43368a7aa8cc5926.

Get Involved

Werkzeug and the Pallets team depends on you, the community. Whether you report issues, write documentation, create patches, or answer questions, we appreciate all the help you provide. We updated the contributing guide to help make it easier to get started.