[Python-modules-commits] [python-werkzeug] 01/09: Import python-werkzeug_0.12.1+dfsg1.orig.tar.gz

Ondřej Nový onovy at moszumanska.debian.org
Sat Apr 8 12:01:25 UTC 2017


This is an automated email from the git hooks/post-receive script.

onovy pushed a commit to branch master
in repository python-werkzeug.

commit 827d4435b27a2a55dc196b1957344ba1a15ac4f9
Author: Ondřej Nový <onovy at debian.org>
Date:   Sat Apr 8 13:23:05 2017 +0200

    Import python-werkzeug_0.12.1+dfsg1.orig.tar.gz
---
 .gitignore                        |   1 +
 .travis.yml                       |  63 +++++++++-----
 AUTHORS                           |   6 ++
 CHANGES                           |  82 +++++++++++++++++--
 CONTRIBUTING.rst                  |   8 +-
 Makefile                          |   3 -
 README.rst                        |  26 +++---
 appveyor.yml                      |  18 ++++
 docs/_templates/sidebarintro.html |   2 +-
 docs/changes.rst                  |   4 +-
 docs/conf.py                      |   2 +-
 docs/contrib/cache.rst            |   2 +
 docs/contrib/lint.rst             |   2 +
 docs/debug.rst                    |   5 +-
 docs/exceptions.rst               |  10 +--
 docs/installation.rst             |   2 +-
 docs/local.rst                    |   2 +-
 docs/serving.rst                  |  13 ++-
 docs/terms.rst                    |   4 +-
 docs/tutorial.rst                 |   4 +-
 docs/unicode.rst                  |   2 +-
 examples/cupoftee/utils.py        |   2 +-
 scripts/make-release.py           |   8 +-
 setup.cfg                         |   7 +-
 setup.py                          |   8 +-
 tests/contrib/test_atom.py        |  79 +++++++++++++++++-
 tests/contrib/test_cache.py       |  25 +++++-
 tests/hypothesis/__init__.py      |   0
 tests/hypothesis/test_urls.py     |  33 ++++++++
 tests/test_datastructures.py      |  49 +++++++++++
 tests/test_debug.py               |  55 +++++++++++--
 tests/test_exceptions.py          |  12 ++-
 tests/test_formparser.py          |  30 ++++++-
 tests/test_http.py                |  53 ++++++++++++
 tests/test_local.py               |  24 ++++++
 tests/test_routing.py             |  58 ++++++++++++-
 tests/test_security.py            |  81 ++++++++++++++----
 tests/test_serving.py             |  31 ++++++-
 tests/test_test.py                |  58 +++++++++++++
 tests/test_wrappers.py            | 158 +++++++++++++++++++++++++++++++++--
 tests/test_wsgi.py                |  55 +++++++++++++
 tox.ini                           |  37 ++++-----
 werkzeug/__init__.py              |   3 +-
 werkzeug/_internal.py             |  10 ++-
 werkzeug/contrib/atom.py          |   2 +-
 werkzeug/contrib/cache.py         | 131 +++++++++++++++++++++--------
 werkzeug/contrib/fixers.py        |   2 +-
 werkzeug/contrib/iterio.py        |   4 +-
 werkzeug/contrib/lint.py          |   6 +-
 werkzeug/contrib/securecookie.py  |   4 +-
 werkzeug/contrib/sessions.py      |   2 +-
 werkzeug/contrib/wrappers.py      |   2 +-
 werkzeug/datastructures.py        |  67 +++++++++++----
 werkzeug/debug/__init__.py        |   4 +-
 werkzeug/debug/console.py         |   2 +-
 werkzeug/debug/repr.py            |   9 +-
 werkzeug/debug/shared/debugger.js |   2 +-
 werkzeug/debug/shared/style.css   |   3 +-
 werkzeug/debug/tbtools.py         |   4 +-
 werkzeug/exceptions.py            |  71 ++++++++++++++--
 werkzeug/formparser.py            |   8 +-
 werkzeug/http.py                  |  62 ++++++++++----
 werkzeug/local.py                 |  12 ++-
 werkzeug/routing.py               |  46 +++++++----
 werkzeug/script.py                |  18 +++-
 werkzeug/security.py              |  24 +++---
 werkzeug/serving.py               |  54 +++++++++---
 werkzeug/test.py                  |  33 +++++---
 werkzeug/useragents.py            |  15 +++-
 werkzeug/wrappers.py              | 168 ++++++++++++++++++++++++++++++++------
 werkzeug/wsgi.py                  | 111 +++++++++++++++++++++++--
 71 files changed, 1675 insertions(+), 328 deletions(-)

diff --git a/.gitignore b/.gitignore
index 1ae242a..6e90061 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,4 @@ coverage_out
 .cache
 .xprocess
 htmlcov
+.hypothesis
diff --git a/.travis.yml b/.travis.yml
index d7827b5..684cdfb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,20 +1,43 @@
+sudo: false
 language: python
 python:
-    - "2.6"
-    - "2.7"
-    - "pypy"
-    - "3.3"
-    - "3.4"
-    - "3.5"
-    - "3.6-dev"
-    - "nightly"
+    - 2.6
+    - 2.7
+    - pypy
+    - 3.3
+    - 3.4
+    - 3.5
+    - 3.6
+    - nightly
+env:
+    - TOXENV_SUFFIX=normal
+    - TOXENV_SUFFIX=stylecheck
+    - TOXENV_SUFFIX=uwsgi
 
-install:
+matrix:
+    exclude:
+        - python: pypy
+          env: TOXENV_SUFFIX=uwsgi
+        - python: 2.6  # flake8 doesn't run on 2.6
+          env: TOXENV_SUFFIX=stylecheck
+    include:
+        - os: osx
+          language: generic
+          env: TOXENV_SUFFIX=normal
+
+os: linux
+
+before_install:
+    - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
+        brew update;
+        brew install python3 redis memcached;
+        virtualenv ~/py-env -p python3;
+        . ~/py-env/bin/activate;
+      fi
     # Travis uses an outdated PyPy, this installs the most recent one.
-    # We need it because apparently cryptography isn't compatible with PyPy versions < 2.6
     # This makes the tests run on Travis' legacy infrastructure, but so be it.
     # temporary pyenv installation to get pypy-2.6 before container infra upgrade
-    - if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then
+    - if [ "$TRAVIS_PYTHON_VERSION" = "pypy" ]; then
         git clone https://github.com/yyuu/pyenv.git ~/.pyenv;
         PYENV_ROOT="$HOME/.pyenv";
         PATH="$PYENV_ROOT/bin:$PATH";
@@ -23,22 +46,18 @@ install:
         pyenv global pypy-4.0.1;
       fi
     - python --version
+
+install:
     - pip install tox flake8
 
 script:
-    - tox -e py
-    - '[ "$TRAVIS_PYTHON_VERSION" = "2.6" ] || make stylecheck'
+    - tox -e py-$TOXENV_SUFFIX
 
 branches:
-  except:
-    - website
+    only:
+        - master
+        - auto
+        - /^.*-maintenance$/
 
 notifications:
   email: false
-  irc:
-    channels:
-      - "chat.freenode.net#pocoo"
-    on_success: change
-    on_failure: always
-    use_notice: true
-    skip_join: true
diff --git a/AUTHORS b/AUTHORS
index 7ff225d..b746c29 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -28,8 +28,14 @@ Project Leader / Developer:
 - Daniel Neuhäuser
 - Markus Unterwaditzer
 - Joe Esposito <joe at joeyespo.com>
+- Abhinav Upadhyay <er.abhinav.upadhyay at gmail.com>
+- immerrr <immerrr at gmail.com>
 - Cédric Krier
+- Phil Jones
+- Michael Hunsinger
 - Lars Holm Nielsen
+- Joël Charles
+- Benjamin Dopplinger
 
 Contributors of code for werkzeug/examples are:
 
diff --git a/CHANGES b/CHANGES
index 68f8814..4bad588 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,70 @@
 Werkzeug Changelog
 ==================
 
+Version 0.12.1
+--------------
+
+Released on March 15th 2017
+
+- Fix crash of reloader (used on debug mode) on Windows.
+  (`OSError: [WinError 10038]`). See pull request ``#1081``
+- Partially revert change to class hierarchy of `Headers`. See ``#1084``.
+
+Version 0.12
+------------
+
+Released on March 10th 2017
+
+- Spit out big deprecation warnings for werkzeug.script
+- Use `inspect.getfullargspec` internally when available as
+  `inspect.getargspec` is gone in 3.6
+- Added support for status code 451 and 423
+- Improved the build error suggestions.  In particular only if
+  someone stringifies the error will the suggestions be calculated.
+- Added support for uWSGI's caching backend.
+- Fix a bug where iterating over a `FileStorage` would result in an infinite
+  loop.
+- Datastructures now inherit from the relevant baseclasses from the
+  `collections` module in the stdlib. See #794.
+- Add support for recognizing NetBSD, OpenBSD, FreeBSD, DragonFlyBSD platforms
+  in the user agent string.
+- Recognize SeaMonkey browser name and version correctly
+- Recognize Baiduspider, and bingbot user agents
+- If `LocalProxy`'s wrapped object is a function, refer to it with __wrapped__
+  attribute.
+- The defaults of ``generate_password_hash`` have been changed to more secure
+  ones, see pull request ``#753``.
+- Add support for encoding in options header parsing, see pull request
+  ``#933``.
+- ``test.Client`` now properly handles Location headers with relative URLs, see
+  pull request ``#879``.
+- When `HTTPException` is raised, it now prints the description, for easier
+  debugging.
+- Werkzeug's dict-like datastructures now have ``view``-methods under Python 2,
+  see pull request ``#968``.
+- Fix a bug in ``MultiPartParser`` when no ``stream_factory`` was provided
+  during initialization, see pull request ``#973``.
+- Disable autocorrect and spellchecker in the debugger middleware's Python
+  prompt, see pull request ``#994``.
+- Don't redirect to slash route when method doesn't match, see pull request
+  ``#907``.
+- Fix a bug when using ``SharedDataMiddleware`` with frozen packages, see pull
+  request ``#959``.
+- `Range` header parsing function fixed for invalid values ``#974``.
+- Add support for byte Range Requests, see pull request ``#978``.
+- Use modern cryptographic defaults in the dev servers ``#1004``.
+- the post() method of the test client now accept file object through the data
+  parameter.
+- Color run_simple's terminal output based on HTTP codes ``#1013``.
+- Fix self-XSS in debugger console, see ``#1031``.
+- Fix IPython 5.x shell support, see ``#1033``.
+
+Version 0.11.16
+---------------
+
+- werkzeug.serving: set CONTENT_TYPE / CONTENT_LENGTH if only they're provided by the client
+- werkzeug.serving: Fix crash of reloader when using `python -m werkzeug.serving`.
+
 Version 0.11.15
 ---------------
 
@@ -64,10 +128,10 @@ Released on April 24th 2016.
 
 - Corrected an issue that caused the debugger not to use the
   machine GUID on POSIX systems.
-- Corrected an Unicode error on Python 3 for the debugger's
+- Corrected a Unicode error on Python 3 for the debugger's
   PIN usage.
 - Corrected the timestamp verification in the pin debug code.
-  Without this fix the pin was remebered until too long.
+  Without this fix the pin was remembered for too long.
 
 Version 0.11.8
 --------------
@@ -94,7 +158,7 @@ Released on April 14th 2016.
   brute force via trying cookies.  Please keep in mind that the debugger
   *is not intended for running on production environments*
 - increased the pin timeout to a week to make it less annoying for people
-  which should decrease the change that users disable the pin check
+  which should decrease the chance that users disable the pin check
   entirely.
 - werkzeug.serving: Fix broken HTTP_HOST when path starts with double slash.
 
@@ -136,7 +200,7 @@ Released on November 12th 2015.
 - Fixed SSL wrapping on platforms that supported opening sockets
   by file descriptor.
 - No longer log from the watchdog reloader.
-- Unicode errors in hosts are now better catched or converted into
+- Unicode errors in hosts are now better caught or converted into
   bad request errors.
 
 Version 0.11.1
@@ -397,7 +461,7 @@ Version 0.9.2
 - Fixed a deprecation warning in the contrib atom module.
 - Fixed a regression with setting of content types through the
   headers dictionary instead with the content type parameter.
-- Use correct name for stdlib secure string comparision function.
+- Use correct name for stdlib secure string comparison function.
 - Fixed a wrong reference in the docstring of
   :func:`~werkzeug.local.release_local`.
 - Fixed an `AttributeError` that sometimes occurred when accessing the
@@ -464,8 +528,8 @@ Released on June 13nd 2013, codename Planierraupe.
 - Added support to profiling into directories in the contrib profiler.
 - The escape function now by default escapes quotes.
 - Changed repr of exceptions to be less magical.
-- Simplified exception interface to no longer require environmnts
-  to be passed to recieve the response object.
+- Simplified exception interface to no longer require environments
+  to be passed to receive the response object.
 - Added sentinel argument to IterIO objects.
 - Added pbkdf2 support for the security module.
 - Added a plain request type that disables all form parsing to only
@@ -521,7 +585,7 @@ Version 0.8.4
   problems with Flask and other frameworks that use
   context local objects on a stack with context preservation
   on errors.
-- Fixed an issue with scolling up in the debugger.
+- Fixed an issue with scrolling up in the debugger.
 - Fixed an issue with debuggers running on a different URL
   than the URL root.
 - Fixed a problem with proxies not forwarding some rarely
@@ -869,7 +933,7 @@ Version 0.5.1
   argument to return a pair for each value of each key.
 - the multipart parser works better with hand-crafted multipart
   requests now that have extra newlines added.  This fixes a bug
-  with setuptools uploades not handled properly (#390)
+  with setuptools uploads not handled properly (#390)
 - fixed some minor bugs in the atom feed generator.
 - fixed a bug with client cookie header parsing being case sensitive.
 - fixed a not-working deprecation warning.
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 8ed4de7..ad5082d 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -25,6 +25,10 @@ Reporting issues
 Submitting patches
 ==================
 
+- Please do not use pull requests as a way to suggest behavior changes. Open an
+  issue for discussion first. This helps keeping the discussions of concept and
+  implementation separate.
+
 - Include tests if your patch is supposed to solve a bug, and explain
   clearly under which circumstances the bug happens. Make sure the test fails
   without your patch.
@@ -32,12 +36,14 @@ Submitting patches
 - Try to follow `PEP8 <http://legacy.python.org/dev/peps/pep-0008/>`_, but you
   may ignore the line-length-limit if following it would make the code uglier.
 
+- Add an entry to ``CHANGES`` and your name to ``AUTHORS``.
+
 
 Running the testsuite
 ---------------------
 
 You probably want to set up a `virtualenv
-<http://virtualenv.readthedocs.org/en/latest/index.html>`_.
+<https://virtualenv.readthedocs.io/en/latest/index.html>`_.
 
 Werkzeug must be installed for all tests to pass::
 
diff --git a/Makefile b/Makefile
index 9c933d0..b5e3c98 100644
--- a/Makefile
+++ b/Makefile
@@ -17,9 +17,6 @@ release:
 test:
 	py.test --tb=native
 
-stylecheck:
-	flake8
-
 tox-test:
 	tox
 
diff --git a/README.rst b/README.rst
index 1764419..5d55b26 100644
--- a/README.rst
+++ b/README.rst
@@ -22,13 +22,19 @@ Details and example applications are available on the
 Branches
 --------
 
-+----------------------+---------------------------------------------------------------------------------+
-| ``master``           | .. image:: https://travis-ci.org/mitsuhiko/werkzeug.svg?branch=master           |
-|                      |     :target: https://travis-ci.org/mitsuhiko/werkzeug                           |
-+----------------------+---------------------------------------------------------------------------------+
-| ``0.9-maintenance``  | .. image:: https://travis-ci.org/mitsuhiko/werkzeug.svg?branch=0.9-maintenance  |
-|                      |     :target: https://travis-ci.org/mitsuhiko/werkzeug                           |
-+----------------------+---------------------------------------------------------------------------------+
-| ``0.10-maintenance`` | .. image:: https://travis-ci.org/mitsuhiko/werkzeug.svg?branch=0.10-maintenance |
-|                      |     :target: https://travis-ci.org/mitsuhiko/werkzeug                           |
-+----------------------+---------------------------------------------------------------------------------+
++----------------------+-------------------------------------------------------------------------------+
+| ``master``           | .. image:: https://travis-ci.org/pallets/werkzeug.svg?branch=master           |
+|                      |     :target: https://travis-ci.org/pallets/werkzeug                           |
++----------------------+-------------------------------------------------------------------------------+
+| ``0.12-maintenance`` | .. image:: https://travis-ci.org/pallets/werkzeug.svg?branch=0.12-maintenance |
+|                      |     :target: https://travis-ci.org/pallets/werkzeug                           |
++----------------------+-------------------------------------------------------------------------------+
+| ``0.11-maintenance`` | .. image:: https://travis-ci.org/pallets/werkzeug.svg?branch=0.11-maintenance |
+|                      |     :target: https://travis-ci.org/pallets/werkzeug                           |
++----------------------+-------------------------------------------------------------------------------+
+| ``0.10-maintenance`` | .. image:: https://travis-ci.org/pallets/werkzeug.svg?branch=0.10-maintenance |
+|                      |     :target: https://travis-ci.org/pallets/werkzeug                           |
++----------------------+-------------------------------------------------------------------------------+
+| ``0.9-maintenance``  | .. image:: https://travis-ci.org/pallets/werkzeug.svg?branch=0.9-maintenance  |
+|                      |     :target: https://travis-ci.org/pallets/werkzeug                           |
++----------------------+-------------------------------------------------------------------------------+
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..463d2b1
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,18 @@
+build: false  # Not a C# project, build stuff at the test step instead.
+environment:
+  matrix:
+    - PYTHON: "C:/Python27"
+    - PYTHON: "C:/Python33"
+    - PYTHON: "C:/Python34"
+
+init:
+  - "ECHO %PYTHON%"
+  - ps: "ls C:/Python*"
+
+install:
+  - ps: (new-object net.webclient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'C:/get-pip.py')
+  - "%PYTHON%/python.exe C:/get-pip.py"
+  - "%PYTHON%/Scripts/pip.exe install tox"
+
+test_script:
+  - "%PYTHON%/Scripts/tox.exe -e py-normal"
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index 791d439..80eabe6 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -15,5 +15,5 @@
 <ul>
   <li><a href="http://werkzeug.pocoo.org/">The Werkzeug Website</a></li>
   <li><a href="http://pypi.python.org/pypi/Werkzeug">Werkzeug @ PyPI</a></li>
-  <li><a href="http://github.com/mitsuhiko/werkzeug">Werkzeug @ github</a></li>
+  <li><a href="http://github.com/pallets/werkzeug">Werkzeug @ github</a></li>
 </ul>
diff --git a/docs/changes.rst b/docs/changes.rst
index e4afc0d..4e4a409 100644
--- a/docs/changes.rst
+++ b/docs/changes.rst
@@ -24,7 +24,7 @@ API Changes
         strongly encouraged to update.
     -   The :class:`Headers` and :class:`EnvironHeaders` datastructures
         are now designed to operate on unicode data.  This is a backwards
-        incomaptible change and was necessary for the Python 3 support.
+        incompatible change and was necessary for the Python 3 support.
     -   The :class:`Headers` object no longer supports in-place operations
         through the old ``linked`` method.  This has been removed without
         replacement due to changes on the encoding model.
@@ -72,7 +72,7 @@ API Changes
     -   Some data structures that were only used on request objects are
         now immutable as well.  (:class:`Authorization` / :class:`Accept`
         and subclasses)
-    -   `CacheControl` was splitted up into :class:`RequestCacheControl`
+    -   `CacheControl` was split up into :class:`RequestCacheControl`
         and :class:`ResponseCacheControl`, the former being immutable.
         The old class will go away in 0.6
     -   undocumented `werkzeug.test.File` was replaced by
diff --git a/docs/conf.py b/docs/conf.py
index e2d4e0d..540ae20 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -210,5 +210,5 @@ latex_use_modindex = False
 # Example configuration for intersphinx: refer to the Python standard library.
 intersphinx_mapping = {
     'http://docs.python.org/dev': None,
-    'http://www.sqlalchemy.org/docs/05': None
+    'http://docs.sqlalchemy.org/en/latest/': None
 }
diff --git a/docs/contrib/cache.rst b/docs/contrib/cache.rst
index 4406923..7437ea6 100644
--- a/docs/contrib/cache.rst
+++ b/docs/contrib/cache.rst
@@ -32,3 +32,5 @@ Cache Systems
 .. autoclass:: RedisCache
 
 .. autoclass:: FileSystemCache
+
+.. autoclass:: UWSGICache
diff --git a/docs/contrib/lint.rst b/docs/contrib/lint.rst
index 23905dd..fe3e015 100644
--- a/docs/contrib/lint.rst
+++ b/docs/contrib/lint.rst
@@ -2,6 +2,8 @@
 Lint Validation Middleware
 ==========================
 
+.. currentmodule:: werkzeug.contrib.lint
+
 .. automodule:: werkzeug.contrib.lint
 
 .. autoclass:: LintMiddleware
diff --git a/docs/debug.rst b/docs/debug.rst
index 0ccc186..78563e4 100644
--- a/docs/debug.rst
+++ b/docs/debug.rst
@@ -81,8 +81,9 @@ Pasting Errors
 ==============
 
 If you click on the `Traceback` title, the traceback switches over to a text
-based one.  The text based one can be pasted to `paste.pocoo.org`_ with one
+based one.  The text based one can be pasted to `gist.github.com <https://gist.github.com>`_ with one
 click.
 
 
-.. _paste.pocoo.org: http://paste.pocoo.org/
+.. _paste.pocoo.org: https://gist.github.com
+
diff --git a/docs/exceptions.rst b/docs/exceptions.rst
index 63c4f1c..6f978c4 100644
--- a/docs/exceptions.rst
+++ b/docs/exceptions.rst
@@ -108,15 +108,7 @@ Sometimes it's convenient to just raise an exception by the error code,
 without importing the exception and looking up the name etc.  For this
 purpose there is the :func:`abort` function.
 
-.. function:: abort(status)
-
-   It can be passed a WSGI application or a status code.  If a status code
-   is given it's looked up in the list of exceptions from above and will
-   raise that exception, if passed a WSGI application it will wrap it in
-   a proxy WSGI exception and raise that::
-
-       abort(404)
-       abort(Response('Hello World'))
+.. autofunction:: abort
 
 If you want to use this functionality with custom exceptions you can
 create an instance of the aborter class:
diff --git a/docs/installation.rst b/docs/installation.rst
index ecc6cc6..c07d452 100644
--- a/docs/installation.rst
+++ b/docs/installation.rst
@@ -48,7 +48,7 @@ Installing the development version
 ==================================
 
 1.  Install `Git`_
-2.  ``git clone git://github.com/mitsuhiko/werkzeug.git``
+2.  ``git clone git://github.com/pallets/werkzeug.git``
 3.  ``cd werkzeug``
 4.  ``pip install --editable .``
 
diff --git a/docs/local.rst b/docs/local.rst
index 4bfae23..4d776e9 100644
--- a/docs/local.rst
+++ b/docs/local.rst
@@ -61,7 +61,7 @@ This will try to get the request or return `None` if the request is not
 
 Note that local objects cannot manage themselves, for that you need a local
 manager.  You can pass a local manager multiple locals or add additionals
-later by appending them to `manager.locals` and everytime the manager
+later by appending them to `manager.locals` and every time the manager
 cleans up it will clean up all the data left in the locals for this
 context.
 
diff --git a/docs/serving.rst b/docs/serving.rst
index 963ff48..39f618f 100644
--- a/docs/serving.rst
+++ b/docs/serving.rst
@@ -56,7 +56,8 @@ Since version 0.10, there are two backends the reloader supports: ``stat`` and
 
 - The ``watchdog`` backend uses filesystem events, and is much faster than
   ``stat``. It requires the `watchdog <https://pypi.python.org/pypi/watchdog>`_
-  module to be installed.
+  module to be installed. The recommended way to achieve this is to add
+  ``Werkzeug[watchdog]`` to your requirements file.
 
 If ``watchdog`` is installed and available it will automatically be used
 instead of the builtin ``stat`` reloader.
@@ -71,6 +72,12 @@ polling and ``'watchdog'`` forces it to the watchdog backend.
     handled by the stat reloader for performance reasons. The watchdog reloader
     monitors such files too.
 
+Colored Logging
+---------------
+Werkzeug is able to color the output of request logs when ran from a terminal, just install the `termcolor
+<https://pypi.python.org/pypi/termcolor>`_ package. Windows users need to install `colorama
+<https://pypi.python.org/pypi/colorama>`_ in addition to termcolor for this to work. 
+
 Virtual Hosts
 -------------
 
@@ -120,8 +127,8 @@ Troubleshooting
 On operating systems that support ipv6 and have it configured such as modern
 Linux systems, OS X 10.4 or higher as well as Windows Vista some browsers can
 be painfully slow if accessing your local server.  The reason for this is that
-sometimes "localhost" is configured to be available on both ipv4 and ipv6 socktes
-and some browsers will try to access ipv6 first and then ivp4.
+sometimes "localhost" is configured to be available on both ipv4 and ipv6 sockets
+and some browsers will try to access ipv6 first and then ipv4.
 
 At the current time the integrated webserver does not support ipv6 and ipv4 at
 the same time and for better portability ipv4 is the default.
diff --git a/docs/terms.rst b/docs/terms.rst
index fa5fc3d..f2b8582 100644
--- a/docs/terms.rst
+++ b/docs/terms.rst
@@ -13,14 +13,14 @@ WSGI
 
 WSGI a specification for Python web applications Werkzeug follows.  It was
 specified in the :pep:`333` and is widely supported.  Unlike previous solutions
-it guarantees that web applications, servers and utilties can work together.
+it guarantees that web applications, servers and utilities can work together.
 
 Response Object
 ---------------
 
 For Werkzeug, a response object is an object that works like a WSGI
 application but does not do any request processing.  Usually you have a view
-function or controller method that processes the request and assambles a
+function or controller method that processes the request and assembles a
 response object.
 
 A response object is *not* necessarily the :class:`BaseResponse` object or a
diff --git a/docs/tutorial.rst b/docs/tutorial.rst
index 69a8781..99f84e0 100644
--- a/docs/tutorial.rst
+++ b/docs/tutorial.rst
@@ -11,7 +11,7 @@ layer and, of course, Werkzeug for the WSGI layer.
 
 You can use `pip` to install the required libraries::
 
-    pip install Jinja2 redis
+    pip install Jinja2 redis Werkzeug
 
 Also make sure to have a redis server running on your local machine.  If
 you are on OS X, you can use `brew` to install it::
@@ -472,4 +472,4 @@ Look at the implementation in the example dictionary in the Werkzeug
 repository to see a version of this tutorial with some small refinements
 such as a custom 404 page.
 
--   `shortly in the example folder <https://github.com/mitsuhiko/werkzeug/blob/master/examples/shortly>`_
+-   `shortly in the example folder <https://github.com/pallets/werkzeug/blob/master/examples/shortly>`_
diff --git a/docs/unicode.rst b/docs/unicode.rst
index 3140441..0dc977a 100644
--- a/docs/unicode.rst
+++ b/docs/unicode.rst
@@ -144,7 +144,7 @@ The Filesystem
 
 Up until version 0.11, Werkzeug used Python's stdlib functionality to detect
 the filesystem encoding. However, several bug reports against Werkzeug have
-shown that the value of :py:func:`sys.getfilesystemencoding` can not the
+shown that the value of :py:func:`sys.getfilesystemencoding` cannot be
 trusted under traditional UNIX systems. The usual problems come from
 misconfigured systems, where ``LANG`` and similar environment variables are not
 set. In such cases, Python would default to ASCII as filesystem encoding, a
diff --git a/examples/cupoftee/utils.py b/examples/cupoftee/utils.py
index 4d71696..92d4587 100644
--- a/examples/cupoftee/utils.py
+++ b/examples/cupoftee/utils.py
@@ -11,7 +11,7 @@
 import re
 
 
-_sort_re = re.compile(r'\w+(?u)')
+_sort_re = re.compile(r'\w+', re.UNICODE)
 
 
 def unicodecmp(a, b):
diff --git a/scripts/make-release.py b/scripts/make-release.py
index aca09fa..3c2734a 100644
--- a/scripts/make-release.py
+++ b/scripts/make-release.py
@@ -36,7 +36,8 @@ def parse_changelog():
                     break
 
             match = re.search(r'released on (\w+\s+\d+\w+\s+\d+)'
-                              r'(?:, codename (.*))?(?i)', change_info)
+                              r'(?:, codename (.*))?', change_info,
+                              flags=re.IGNORECASE)
             if match is None:
                 continue
 
@@ -66,8 +67,9 @@ def set_filename_version(filename, version_number, pattern):
         changed.append(True)
         return before + version_number + after
     with open(filename) as f:
-        contents = re.sub(r"^(\s*%s\s*=\s*')(.+?)(')(?sm)" % pattern,
-                          inject_version, f.read())
+        contents = re.sub(r"^(\s*%s\s*=\s*')(.+?)(')" % pattern,
+                          inject_version, f.read(),
+                          flags=re.DOTALL | re.MULTILINE)
 
     if not changed:
         fail('Could not find %s in %s', pattern, filename)
diff --git a/setup.cfg b/setup.cfg
index 646eb2d..e33028f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,12 +1,15 @@
 [aliases]
 release = egg_info -RDb ''
 
-[pytest]
-norecursedirs = .* env* _build *.egg
+[tool:pytest]
+norecursedirs = .* env* docs *.egg tests/hypothesis
 
 [bdist_wheel]
 universal = 1
 
+[metadata]
+license_file = LICENSE
+
 [flake8]
 ignore = E126,E241,E272,E305,E402,E731,W503
 exclude=.tox,examples,docs
diff --git a/setup.py b/setup.py
index 356442a..76f770d 100644
--- a/setup.py
+++ b/setup.py
@@ -49,9 +49,9 @@ Development Version
 The Werkzeug development version can be installed by cloning the git
 repository from `github`_::
 
-    git clone git at github.com:mitsuhiko/werkzeug.git
+    git clone git at github.com:pallets/werkzeug.git
 
-.. _github: http://github.com/mitsuhiko/werkzeug
+.. _github: http://github.com/pallets/werkzeug
 """
 import ast
 import re
@@ -109,6 +109,10 @@ setup(
         'Topic :: Software Development :: Libraries :: Python Modules'
     ],
     packages=['werkzeug', 'werkzeug.debug', 'werkzeug.contrib'],
+    extras_require={
+        'watchdog': ['watchdog'],
+        'termcolor': ['termcolor'],
+    },
     cmdclass=dict(test=TestCommand),
     include_package_data=True,
     zip_safe=False,
diff --git a/tests/contrib/test_atom.py b/tests/contrib/test_atom.py
index ed870ed..e79e6c6 100644
--- a/tests/contrib/test_atom.py
+++ b/tests/contrib/test_atom.py
@@ -9,8 +9,85 @@
     :license: BSD, see LICENSE for more details.
 """
 import datetime
+import pytest
 
-from werkzeug.contrib.atom import format_iso8601
+from werkzeug.contrib.atom import format_iso8601, AtomFeed, FeedEntry
+
+
+class TestAtomFeed(object):
+    """
+    Testcase for the `AtomFeed` class
+    """
+
+    def test_atom_no_args(self):
+        with pytest.raises(ValueError):
+            AtomFeed()
+
+    def test_atom_title_no_id(self):
+        with pytest.raises(ValueError):
+            AtomFeed(title='test_title')
+
+    def test_atom_add_one(self):
+        a = AtomFeed(title='test_title', id=1)
+        f = FeedEntry(
+            title='test_title', id=1, updated=datetime.datetime.now())
+        assert len(a.entries) == 0
+        a.add(f)
+        assert len(a.entries) == 1
+
+    def test_atom_add_one_kwargs(self):
+        a = AtomFeed(title='test_title', id=1)
+        assert len(a.entries) == 0
+        a.add(title='test_title', id=1, updated=datetime.datetime.now())
+        assert len(a.entries) == 1
+        assert isinstance(a.entries[0], FeedEntry)
+
+    def test_atom_to_str(self):
+        updated_time = datetime.datetime.now()
+        expected_repr = '''
+        <?xml version="1.0" encoding="utf-8"?>
+        <feed xmlns="http://www.w3.org/2005/Atom">
+            <title type="text">test_title</title>
+            <id>1</id>
+            <updated>%s</updated>
+            <generator>Werkzeug</generator>
+        </feed>
+        ''' % format_iso8601(updated_time)
+        a = AtomFeed(title='test_title', id=1, updated=updated_time)
+        assert str(a).strip().replace(' ', '') == \
+            expected_repr.strip().replace(' ', '')
+
+
+class TestFeedEntry(object):
+    """
+    Test case for the `FeedEntry` object
+    """
+
+    def test_feed_entry_no_args(self):
+        with pytest.raises(ValueError):
+            FeedEntry()
+
+    def test_feed_entry_no_id(self):
+        with pytest.raises(ValueError):
+            FeedEntry(title='test_title')
+
+    def test_feed_entry_no_updated(self):
+        with pytest.raises(ValueError):
+            FeedEntry(title='test_title', id=1)
+
+    def test_feed_entry_to_str(self):
+        updated_time = datetime.datetime.now()
+        expected_feed_entry_str = '''
+        <entry>
+            <title type="text">test_title</title>
+            <id>1</id>
+            <updated>%s</updated>
+        </entry>
+        ''' % format_iso8601(updated_time)
+
+        f = FeedEntry(title='test_title', id=1, updated=updated_time)
+        assert str(f).strip().replace(' ', '') == \
+            expected_feed_entry_str.strip().replace(' ', '')
 
 
 def test_format_iso8601():
diff --git a/tests/contrib/test_cache.py b/tests/contrib/test_cache.py
index c73d907..5585ef4 100644
--- a/tests/contrib/test_cache.py
+++ b/tests/contrib/test_cache.py
@@ -88,7 +88,7 @@ class CacheTests(object):
 
     def test_generic_expire(self, c, fast_sleep):
         assert c.set('foo', 'bar', 1)
-        fast_sleep(2)
+        fast_sleep(5)
         assert c.get('foo') is None
 
     def test_generic_add(self, c):
@@ -136,7 +136,7 @@ class CacheTests(object):
         assert c.get('foo') == 'bar'
         # sleep a bit longer than timeout to ensure there are no
         # race conditions
-        fast_sleep(timeout + 1)
+        fast_sleep(timeout + 5)
         assert c.get('foo') is None
 
     def test_generic_has(self, c):
@@ -246,3 +246,24 @@ if memcache is not None:
             timeout = epoch + random.random() * 100
             c.set('foo', 'bar', timeout)
             assert c.get('foo') == 'bar'
+
+
+def _running_in_uwsgi():
+    try:
+        import uwsgi  # NOQA
+    except ImportError:
+        return False
+    else:
+        return True
+
+
+ at pytest.mark.skipif(not _running_in_uwsgi(),
+                    reason="uWSGI module can't be imported outside of uWSGI")
+class TestUWSGICache(CacheTests):
+    _can_use_fast_sleep = False
+
+    @pytest.fixture
+    def make_cache(self, xprocess, request):
+        c = cache.UWSGICache(cache='werkzeugtest')
+        request.addfinalizer(c.clear)
+        return lambda: c
diff --git a/tests/hypothesis/__init__.py b/tests/hypothesis/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/hypothesis/test_urls.py b/tests/hypothesis/test_urls.py
new file mode 100644
index 0000000..c610714
--- /dev/null
+++ b/tests/hypothesis/test_urls.py
@@ -0,0 +1,33 @@
+import hypothesis
+from hypothesis.strategies import text, dictionaries, lists, integers
+
+from werkzeug import urls
+from werkzeug.datastructures import OrderedMultiDict
+
+
+ at hypothesis.given(text())
+def test_quote_unquote_text(t):
+    assert t == urls.url_unquote(urls.url_quote(t))
+
+
+ at hypothesis.given(dictionaries(text(), text()))
+def test_url_encoding_dict_str_str(d):
+    assert OrderedMultiDict(d) == urls.url_decode(urls.url_encode(d))
+
+
+ at hypothesis.given(dictionaries(text(), lists(elements=text())))
+def test_url_encoding_dict_str_list(d):
+    assert OrderedMultiDict(d) == urls.url_decode(urls.url_encode(d))
+
+
+ at hypothesis.given(dictionaries(text(), integers()))
+def test_url_encoding_dict_str_int(d):
+    assert OrderedMultiDict({k: str(v) for k, v in d.items()}) == \
+        urls.url_decode(urls.url_encode(d))
+
+
+ at hypothesis.given(text(), text())
+def test_multidict_encode_decode_text(t1, t2):
+    d = OrderedMultiDict()
+    d.add(t1, t2)
+    assert d == urls.url_decode(urls.url_encode(d))
diff --git a/tests/test_datastructures.py b/tests/test_datastructures.py
index 47672b4..28bfa8b 100644
--- a/tests/test_datastructures.py
+++ b/tests/test_datastructures.py
@@ -395,6 +395,38 @@ class TestMultiDict(_MutableMultiDictTests):
         assert list(zip(iterkeys(md), iterlistvalues(md))) == \
             list(iterlists(md))
 
+    @pytest.mark.skipif(not PY2, reason='viewmethods work only for the 2-nd version.')
+    def test_view_methods(self):
+        mapping = [('a', 'b'), ('a', 'c')]
+        md = self.storage_class(mapping)
+
+        vi = md.viewitems()
+        vk = md.viewkeys()
+        vv = md.viewvalues()
+
+        assert list(vi) == list(md.items())
+        assert list(vk) == list(md.keys())
+        assert list(vv) == list(md.values())
+
+        md['k'] = 'n'
+
+        assert list(vi) == list(md.items())
+        assert list(vk) == list(md.keys())
+        assert list(vv) == list(md.values())
+
+    @pytest.mark.skipif(not PY2, reason='viewmethods work only for the 2-nd version.')
+    def test_viewitems_with_multi(self):
+        mapping = [('a', 'b'), ('a', 'c')]
+        md = self.storage_class(mapping)
+
+        vi = md.viewitems(multi=True)
+
+        assert list(vi) == list(md.items(multi=True))
+
+        md['k'] = 'n'
+
+        assert list(vi) == list(md.items(multi=True))
+
     def test_getitem_raise_badrequestkeyerror_for_empty_list_value(self):
         mapping = [('a', 'b'), ('a', 'c')]
         md = self.storage_class(mapping)
@@ -494,6 +526,11 @@ class TestOrderedMultiDict(_MutableMultiDictTests):
         with pytest.raises(BadRequestKeyError):
             d.popitemlist()
 
+        # Unhashable
+        d = self.storage_class()
+        d.add('foo', 23)
+        pytest.raises(TypeError, hash, d)
+
     def test_iterables(self):
         a = datastructures.MultiDict((("key_a", "value_a"),))
         b = datastructures.MultiDict((("key_b", "value_b"),))
@@ -927,3 +964,15 @@ class TestFileStorage(object):
     def test_mimetype_always_lowercase(self):
         file_storage = self.storage_class(content_type='APPLICATION/JSON')
         assert file_storage.mimetype == 'application/json'
+
+    def test_bytes_proper_sentinel(self):
+        # ensure we iterate over new lines and don't enter into an infinite loop
+        import io
+        unicode_storage = self.storage_class(io.StringIO(u"one\ntwo"))
+        for idx, line in enumerate(unicode_storage):
+            assert idx < 2
+        assert idx == 1
+        binary_storage = self.storage_class(io.BytesIO(b"one\ntwo"))
... 3078 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-werkzeug.git



More information about the Python-modules-commits mailing list