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

Allow Registering and unregistering instance methods as listeners #102

Merged
merged 4 commits into from
Nov 28, 2017

Conversation

dwt
Copy link
Contributor

@dwt dwt commented Sep 14, 2017

Fixes #12 - registering instance methods as listeners doesn’t allow to easily unregister them as the registry tries to find the handler with 'is' but it should use '==' to allow the python BoundMethod wrapper (which is a new instance every time instance.$methodname is accessed).

…o easily unregister them as the registry tries to find the handler with 'is' but it should use '==' to allow the python BoundMethod wrapper (which is a new instance every time instance.$methodname is accessed).
Copy link
Member

@mgedmin mgedmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -234,6 +234,17 @@ def test_unsubscribe_with_value_not_None_miss(self):
registry.subscribe([IB1], None, orig)
registry.unsubscribe([IB1], None, nomatch) #doesn't raise
self.assertEqual(len(registry._subscribers), 2)

def _instance_method_notify_target(self):
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the line that is not being executed, which causes a test coverage regression. You could drop a # pragma: nocover comment next to it, or use @jamadden's favorite trick of replacing the pass with a docstring, e.g. """example subscriber that is a bound method""" or something.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or my other favorite trick, raising an exception if it's called. The best one here would be self.fail("Example method, not intended to be called.")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[x] done

Copy link
Member

@jamadden jamadden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would prefer to see this go the other way: replace the underlying use of == with is. The pattern to unregister an object is:

item = registry.getUtility(IWhatever, name='whatever')
registery.unregisterUtility(IWhatever, item, name='whatever')

I think it's rare to already know ahead of time an expression that computes an object that you think is already registered as a utility.

An advantage of is over ==, aside from speed is that is doesn't unghost persistent objects. In some cases, unghosting them may not even be possible (POSKeyError) so is can be very valuable.

@mgedmin
Copy link
Member

mgedmin commented Sep 15, 2017

The problem with using is is that this makes it difficult to unregister bound methods.

@jamadden
Copy link
Member

The problem with using is is that this makes it difficult to unregister bound methods.

Sure, if you rely on using that expression every time (and thus creating the new object). If you first retrieve the utility and then unregister it, you don't have a problem. That seems like the more general case to me. Being able to create a new object and unregister based on equality seems like a special case; it may not even make sense to support that special case given persistent objects, and the potential danger of false-positives.

Now, I understand that #12 was not actually about utilities but about subscription adapters or handlers. It is harder to first retrieve a registered handler than it is a utility (but not impossible), so that option still exists. Keeping a reference to the registered object is also a possibility and probably easier. But as for being able to register bound methods as a handler: isn't that a bit of a foot-gun already? They definitely don't work in persistent registries since they can't be pickled:

Python 2.7.13 (default, May  5 2017, 09:16:47)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo(object):
...     def thing(self): pass
...
>>> f = Foo()
>>> t = f.thing
>>> t
<bound method Foo.thing of <__main__.Foo object at 0x101e82dd0>>
>>> import cPickle
>>> cPickle.dumps(t)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/lib/python2.7/copy_reg.py", line 70, in _reduce_ex
    raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle instancemethod objects
>>> cPickle.dumps(t, 2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cPickle.PicklingError: Can't pickle <type 'instancemethod'>: attribute lookup __builtin__.instancemethod failed

If the use for bound-methods-as-listeners is for test cases and zope.components global registery, then normal test tearDown should already be cleaning them up.

I'm not really strongly opposed to this and won't object to seeing it merged (the main benefit for persistent objects would require another change), I'm just struggling to understand the reasons to support it.

@mgedmin
Copy link
Member

mgedmin commented Sep 15, 2017

I stumbled upon this in 2010 and I cannot for the life of me remember why I was trying to register/unregister bound methods.

I'm okay with saying 'don't do that', as long as the underlying zope.interface and the wrapper zope.component methods are in agreement (which they currently are not).

@dwt
Copy link
Contributor Author

dwt commented Sep 15, 2017

An advantage of is over ==, aside from speed is that is doesn't unghost persistent objects. In some cases, unghosting them may not even be possible (POSKeyError) so is can be very valuable.

I think the point here is that {un}registerHandler checks if the handler is registered with == but then unregister uses is to find the actual handler - this disagreement causes unregisterHandler to return true (and trigger unghosting), while the actual handler is not unregistered. This is the bug that this pull request tries to fix.

@icemac
Copy link
Member

icemac commented Oct 27, 2017

@dwt Is there still something to be done to get this PR ready for merge?

@icemac icemac merged commit d50e3d4 into master Nov 28, 2017
@icemac icemac deleted the fix_register_instance_methods branch November 28, 2017 07:28
bors-fusion bot referenced this pull request in fusionapp/entropy May 9, 2018
185: Scheduled weekly dependency update for week 18 r=mithrandi a=pyup-bot






### Update [attrs](https://pypi.org/project/attrs) from **17.4.0** to **18.1.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 18.1.0
   ```
   -------------------

Changes
^^^^^^^

- ``x=X(); x.cycle = x; repr(x)`` will no longer raise a ``RecursionError``, and will instead show as ``X(x=...)``.

  `95 &lt;https://github.com/python-attrs/attrs/issues/95&gt;`_
- ``attr.ib(factory=f)`` is now syntactic sugar for the common case of ``attr.ib(default=attr.Factory(f))``.

  `178 &lt;https://github.com/python-attrs/attrs/issues/178&gt;`_,
  `356 &lt;https://github.com/python-attrs/attrs/issues/356&gt;`_
- Added ``attr.field_dict()`` to return an ordered dictionary of ``attrs`` attributes for a class, whose keys are the attribute names.

  `290 &lt;https://github.com/python-attrs/attrs/issues/290&gt;`_,
  `349 &lt;https://github.com/python-attrs/attrs/issues/349&gt;`_
- The order of attributes that are passed into ``attr.make_class()`` or the ``these`` argument of ``attr.s()`` is now retained if the dictionary is ordered (i.e. ``dict`` on Python 3.6 and later, ``collections.OrderedDict`` otherwise).

  Before, the order was always determined by the order in which the attributes have been defined which may not be desirable when creating classes programatically.

  `300 &lt;https://github.com/python-attrs/attrs/issues/300&gt;`_,
  `339 &lt;https://github.com/python-attrs/attrs/issues/339&gt;`_,
  `343 &lt;https://github.com/python-attrs/attrs/issues/343&gt;`_
- In slotted classes, ``__getstate__`` and ``__setstate__`` now ignore the ``__weakref__`` attribute.

  `311 &lt;https://github.com/python-attrs/attrs/issues/311&gt;`_,
  `326 &lt;https://github.com/python-attrs/attrs/issues/326&gt;`_
- Setting the cell type is now completely best effort.
  This fixes ``attrs`` on Jython.

  We cannot make any guarantees regarding Jython though, because our test suite cannot run due to dependency incompatabilities.

  `321 &lt;https://github.com/python-attrs/attrs/issues/321&gt;`_,
  `334 &lt;https://github.com/python-attrs/attrs/issues/334&gt;`_
- If ``attr.s`` is passed a *these* argument, it will not attempt to remove attributes with the same name from the class body anymore.

  `322 &lt;https://github.com/python-attrs/attrs/issues/322&gt;`_,
  `323 &lt;https://github.com/python-attrs/attrs/issues/323&gt;`_
- The hash of ``attr.NOTHING`` is now vegan and faster on 32bit Python builds.

  `331 &lt;https://github.com/python-attrs/attrs/issues/331&gt;`_,
  `332 &lt;https://github.com/python-attrs/attrs/issues/332&gt;`_
- The overhead of instantiating frozen dict classes is virtually eliminated.
  `336 &lt;https://github.com/python-attrs/attrs/issues/336&gt;`_
- Generated ``__init__`` methods now have an ``__annotations__`` attribute derived from the types of the fields.

  `363 &lt;https://github.com/python-attrs/attrs/issues/363&gt;`_
- We have restructured the documentation a bit to account for ``attrs``&#39; growth in scope.
  Instead of putting everything into the `examples &lt;http://www.attrs.org/en/stable/examples.html&gt;`_ page, we have started to extract narrative chapters.

  So far, we&#39;ve added chapters on `initialization &lt;http://www.attrs.org/en/stable/init.html&gt;`_ and `hashing &lt;http://www.attrs.org/en/stable/hashing.html&gt;`_.

  Expect more to come!

  `369 &lt;https://github.com/python-attrs/attrs/issues/369&gt;`_,
  `370 &lt;https://github.com/python-attrs/attrs/issues/370&gt;`_


----
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/attrs
  - Changelog: https://pyup.io/changelogs/attrs/
  - Homepage: http://www.attrs.org/
</details>





### Update [cffi](https://pypi.org/project/cffi) from **1.11.2** to **1.11.5**.


<details>
  <summary>Changelog</summary>
  
  
   ### 1.11.5
   ```
   =======

* `Issue 357`_: fix ``ffi.emit_python_code()`` which generated a buggy
  Python file if you are using a ``struct`` with an anonymous ``union``
  field or vice-versa.

* Windows: ``ffi.dlopen()`` should now handle unicode filenames.

* ABI mode: implemented ``ffi.dlclose()`` for the in-line case (it used
  to be present only in the out-of-line case).

* Fixed a corner case for ``setup.py install --record=xx --root=yy``
  with an out-of-line ABI module.  Also fixed `Issue 345`_.

* More hacks on Windows for running CFFI&#39;s own ``setup.py``.

* `Issue 358`_: in embedding, to protect against (the rare case of)
  Python initialization from several threads in parallel, we have to use
  a spin-lock.  On CPython 3 it is worse because it might spin-lock for
  a long time (execution of ``Py_InitializeEx()``).  Sadly, recent
  changes to CPython make that solution needed on CPython 2 too.

* CPython 3 on Windows: we no longer compile with ``Py_LIMITED_API``
  by default because such modules cannot be used with virtualenv.
  `Issue 350`_ mentions a workaround if you still want that and are not
  concerned about virtualenv: pass a ``define_macros=[(&quot;Py_LIMITED_API&quot;,
  None)]`` to the ``ffibuilder.set_source()`` call.

.. _`Issue 345`: https://bitbucket.org/cffi/cffi/issues/345/
.. _`Issue 350`: https://bitbucket.org/cffi/cffi/issues/350/
.. _`Issue 358`: https://bitbucket.org/cffi/cffi/issues/358/
.. _`Issue 357`: https://bitbucket.org/cffi/cffi/issues/357/
   ```
   
  
  
   ### 1.11.4
   ```
   =======

* Windows: reverted linking with ``python3.dll``, because
  virtualenv does not make this DLL available to virtual environments
  for now.  See `Issue 355`_.  On Windows only, the C extension
  modules created by cffi follow for now the standard naming scheme
  ``foo.cp36-win32.pyd``, to make it clear that they are regular
  CPython modules depending on ``python36.dll``.

.. _`Issue 355`: https://bitbucket.org/cffi/cffi/issues/355/
   ```
   
  
  
   ### 1.11.3
   ```
   =======

* Fix on CPython 3.x: reading the attributes ``__loader__`` or
  ``__spec__`` from the cffi-generated lib modules gave a buggy
  SystemError.  (These attributes are always None, and provided only to
  help compatibility with tools that expect them in all modules.)

* More Windows fixes: workaround for MSVC not supporting large
  literal strings in C code (from
  ``ffi.embedding_init_code(large_string)``); and an issue with
  ``Py_LIMITED_API`` linking with ``python35.dll/python36.dll`` instead
  of ``python3.dll``.

* Small documentation improvements.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/cffi
  - Changelog: https://pyup.io/changelogs/cffi/
  - Docs: http://cffi.readthedocs.org
</details>





### Update [cryptography](https://pypi.org/project/cryptography) from **2.1.4** to **2.2.2**.


<details>
  <summary>Changelog</summary>
  
  
   ### 2.2.1
   ```
   ~~~~~~~~~~~~~~~~~~

* Reverted a change to ``GeneralNames`` which prohibited having zero elements,
  due to breakages.
* Fixed a bug in
  :func:`~cryptography.hazmat.primitives.keywrap.aes_key_unwrap_with_padding`
  that caused it to raise ``InvalidUnwrap`` when key length modulo 8 was
  zero.


.. _v2-2:
   ```
   
  
  
   ### 2.2
   ```
   ~~~~~~~~~~~~~~~~

* **BACKWARDS INCOMPATIBLE:** Support for Python 2.6 has been dropped.
* Resolved a bug in ``HKDF`` that incorrectly constrained output size.
* Added :class:`~cryptography.hazmat.primitives.asymmetric.ec.BrainpoolP256R1`,
  :class:`~cryptography.hazmat.primitives.asymmetric.ec.BrainpoolP384R1`, and
  :class:`~cryptography.hazmat.primitives.asymmetric.ec.BrainpoolP512R1` to
  support inter-operating with systems like German smart meters.
* Added token rotation support to :doc:`Fernet &lt;/fernet&gt;` with
  :meth:`~cryptography.fernet.MultiFernet.rotate`.
* Fixed a memory leak in
  :func:`~cryptography.hazmat.primitives.asymmetric.ec.derive_private_key`.
* Added support for AES key wrapping with padding via
  :func:`~cryptography.hazmat.primitives.keywrap.aes_key_wrap_with_padding`
  and
  :func:`~cryptography.hazmat.primitives.keywrap.aes_key_unwrap_with_padding`
  .
* Allow loading DSA keys with 224 bit ``q``.

.. _v2-1-4:
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/cryptography
  - Changelog: https://pyup.io/changelogs/cryptography/
  - Repo: https://github.com/pyca/cryptography
</details>





### Update [hyperlink](https://pypi.org/project/hyperlink) from **17.3.1** to **18.0.0**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/hyperlink
  - Changelog: https://pyup.io/changelogs/hyperlink/
  - Repo: https://github.com/python-hyper/hyperlink
</details>





### Update [ipaddress](https://pypi.org/project/ipaddress) from **1.0.19** to **1.0.21**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/ipaddress
  - Repo: https://github.com/phihag/ipaddress
</details>





### Update [lxml](https://pypi.org/project/lxml) from **4.1.1** to **4.2.1**.


<details>
  <summary>Changelog</summary>
  
  
   ### 4.2.1
   ```
   ==================

Bugs fixed
----------

* LP1755825: ``iterwalk()`` failed to return the &#39;start&#39; event for the initial
  element if a tag selector is used.

* LP1756314: Failure to import 4.2.0 into PyPy due to a missing library symbol.

* LP1727864, GH258: Add &quot;-isysroot&quot; linker option on MacOS as needed by XCode 9.
   ```
   
  
  
   ### 4.2.0
   ```
   ==================

Features added
--------------

* GH255: ``SelectElement.value`` returns more standard-compliant and
  browser-like defaults for non-multi-selects.  If no option is selected, the
  value of the first option is returned (instead of None).  If multiple options
  are selected, the value of the last one is returned (instead of that of the
  first one).  If no options are present (not standard-compliant)
  ``SelectElement.value`` still returns ``None``.

* GH261: The ``HTMLParser()`` now supports the ``huge_tree`` option.
  Patch by stranac.

Bugs fixed
----------

* LP1551797: Some XSLT messages were not captured by the transform error log.

* LP1737825: Crash at shutdown after an interrupted iterparse run with XMLSchema
  validation.

Other changes
-------------
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/lxml
  - Changelog: https://pyup.io/changelogs/lxml/
  - Homepage: http://lxml.de/
  - Bugtracker: https://bugs.launchpad.net/lxml
</details>





### Update [olefile](https://pypi.org/project/olefile) from **0.44** to **0.45.1**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/olefile
  - Changelog: https://pyup.io/changelogs/olefile/
  - Repo: https://github.com/decalage2/olefile/tarball/master
  - Homepage: https://www.decalage.info/python/olefileio
</details>





### Update [pillow](https://pypi.org/project/pillow) from **4.3.0** to **5.1.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 5.1.0
   ```
   ------------------

- Close fp before return in ImagingSavePPM 3061
  [kathryndavies]

- Added documentation for ICNS append_images 3051
  [radarhere]

- Docs: Move intro text below its header 3021
  [hugovk]

- CI: Rename appveyor.yml as .appveyor.yml 2978
  [hugovk]

- Fix TypeError for JPEG2000 parser feed 3042
  [hugovk]

- Certain corrupted jpegs can result in no data read 3023
  [kkopachev]

- Add support for BLP file format 3007
  [jleclanche]

- Simplify version checks 2998
  [hugovk]

- Fix &quot;invalid escape sequence&quot; warning on Python 3.6+ 2996
  [timgraham]

- Allow append_images to set .icns scaled images 3005
  [radarhere]

- Support appending to existing PDFs 2965
  [vashek]

- Fix and improve efficient saving of ICNS on macOS 3004
  [radarhere]

- Build: Enable pip cache in AppVeyor build 3009
  [thijstriemstra]

- Trim trailing whitespace 2985
  [Metallicow]

- Docs: Correct reference to Image.new method 3000
  [radarhere]

- Rearrange ImageFilter classes into alphabetical order 2990
  [radarhere]

- Test: Remove duplicate line 2983
  [radarhere]

- Build: Update AppVeyor PyPy version 3003
  [radarhere]

- Tiff: Open 8 bit Tiffs with 5 or 6 channels, discarding extra channels 2938
  [homm]

- Readme: Added Twitter badge 2930
  [hugovk]

- Removed __main__ code from ImageCms 2942
  [radarhere]

- Test: Changed assert statements to unittest calls 2961
  [radarhere]

- Depends: Update libimagequant to 2.11.10, raqm to 0.5.0, freetype to 2.9 3036, 3017, 2957
  [radarhere]

- Remove _imaging.crc32 in favor of builtin Python crc32 implementation 2935
  [wiredfool]

- Move Tk directory to src directory 2928
  [hugovk]

- Enable pip cache in Travis CI 2933
  [jdufresne]

- Remove unused and duplicate imports 2927
  [radarhere]

- Docs: Changed documentation references to 2.x to 2.7 2921
  [radarhere]

- Fix memory leak when opening webp files 2974
  [wiredfool]

- Setup: Fix &quot;TypeError: &#39;NoneType&#39; object is not iterable&quot; for PPC and CRUX 2951
  [hugovk]

- Setup: Add libdirs for ppc64le and armv7l 2968
  [nehaljwani]
   ```
   
  
  
   ### 5.0.0
   ```
   ------------------

- Docs: Added docstrings from documentation 2914
  [radarhere]

- Test: Switch from nose to pytest 2815
  [hugovk]

- Rework Source directory layout, preventing accidental import of PIL. 2911
  [wiredfool]

- Dynamically link libraqm 2753
  [wiredfool]

- Removed scripts directory 2901
  [wiredfool]

- TIFF: Run all compressed tiffs through libtiff decoder 2899
  [wiredfool]

- GIF: Add disposal option when saving GIFs 2902
  [linnil1, wiredfool]

- EPS: Allow for an empty line in EPS header data 2903
  [radarhere]

- PNG: Add support for sRGB and cHRM chunks, permit sRGB when no iCCP chunk present 2898
  [wiredfool]

- Dependencies: Update Tk Tcl to 8.6.8 2905
  [radarhere]

- Decompression bomb error now raised for images 2x larger than a decompression bomb warning 2583
  [wiredfool]

- Test: avoid random failure in test_effect_noise 2894
  [hugovk]

- Increased epsilon for test_file_eps.py:test_showpage due to Arch update. 2896
  [wiredfool]

- Removed check parameter from _save in BmpImagePlugin, PngImagePlugin, ImImagePlugin, PalmImagePlugin, and PcxImagePlugin. 2873
  [radarhere]

- Make PngImagePlugin.add_text() zip argument type bool 2890
  [jdufresne]

- Depends: Updated libwebp to 0.6.1 2880
  [radarhere]

- Remove unnecessary bool() calls in Image.registered_extensions and skipKnownBadTests 2891
  [jdufresne]

- Fix count of BITSPERSAMPLE items in broken TIFF files 2883
  [homm]

- Fillcolor parameter for Image.Transform 2852
  [wiredfool]

- Test: Display differences for test failures 2862
  [wiredfool]

- Added executable flag to file with shebang line 2884
  [radarhere]

- Setup: Specify compatible Python versions for pip 2877
  [hugovk]

- Dependencies: Updated libimagequant to 2.11.4 2878
  [radarhere]

- Setup: Warn if trying to install for Py3.7 on Windows 2855
  [hugovk]

- Doc: Fonts can be loaded from a file-like object, not just filename 2861
  [robin-norwood]

- Add eog support for Ubuntu Image Viewer 2864
  [NafisFaysal]

- Test: Test on 3.7-dev on Travis.ci 2870
  [hugovk]

- Dependencies: Update libtiff to 4.0.9 2871
  [radarhere]

- Setup: Replace deprecated platform.dist with file existence check 2869
  [wiredfool]

- Build: Fix setup.py on Debian 2853
  [wiredfool]

- Docs: Correct error in ImageDraw documentation 2858
  [meribold]

- Test: Drop Ubuntu Precise, Fedora 24, Fedora 25, add Fedora 27, Centos 7, Amazon v2 CI Support 2854, 2843, 2895, 2897
  [wiredfool]

- Dependencies: Updated libimagequant to 2.11.3 2849
  [radarhere]

- Test: Fix test_image.py to use tempfile 2841
  [radarhere]

- Replace PIL.OleFileIO deprecation warning with descriptive ImportError 2833
  [hugovk]

- WebP: Add support for animated WebP files 2761
  [jd20]

- PDF: Set encoderinfo for images when saving multi-page PDF. Fixes 2804. 2805
  [ixio]

- Allow the olefile dependency to be optional 2789
  [jdufresne]

- GIF: Permit LZW code lengths up to 12 bits in GIF decode 2813
  [wiredfool]

- Fix unterminated string and unchecked exception in _font_text_asBytes. 2825
  [wiredfool]

- PPM: Use fixed list of whitespace, rather relying on locale, fixes 272. 2831
  [markmiscavage]

- Added support for generators when using append_images 2829, 2835
  [radarhere]

- Doc: Correct PixelAccess.rst 2824
  [hasahmed]

- Depends: Update raqm to 0.3.0 2822
  [radarhere]

- Docs: Link to maintained version of aggdraw 2809
  [hugovk]

- Include license file in the generated wheel packages 2801
  [jdufresne]

- Depends: Update openjpeg to 2.3.0 2791
  [radarhere]

- Add option to Makefile to build and install with C coverage 2781
  [hugovk]

- Add context manager support to ImageFile.Parser and PngImagePlugin.ChunkStream 2793
  [radarhere]

- ImageDraw.textsize: fix zero length error 2788
  [wiredfool, hugovk]
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pillow
  - Changelog: https://pyup.io/changelogs/pillow/
  - Homepage: https://python-pillow.org
</details>





### Update [python-dateutil](https://pypi.org/project/python-dateutil) from **2.6.1** to **2.7.2**.


<details>
  <summary>Changelog</summary>
  
  
   ### 2.7.2
   ```
   ==========================

Bugfixes
--------

- Fixed an issue with the setup script running in non-UTF-8 environment.
  Reported and fixed by gergondet (gh pr 651)


Misc
----

- GH 655
   ```
   
  
  
   ### 2.7.1
   ```
   ===========================

Data updates
------------

- Updated tzdata version to 2018d.


Bugfixes
--------

- Fixed issue where parser.parse would occasionally raise
  decimal.Decimal-specific error types rather than ValueError. Reported by
  amureki (gh issue 632). Fixed by pganssle (gh pr 636).
- Improve error message when rrule&#39;s dtstart and until are not both naive or
  both aware. Reported and fixed by ryanpetrello (gh issue 633, gh pr 634)


Misc
----

- GH 644, GH 648
   ```
   
  
  
   ### 2.7.0
   ```
   =============
- Dropped support for Python 2.6 (gh pr 362 by jdufresne)
- Dropped support for Python 3.2 (gh pr 626)
- Updated zoneinfo file to 2018c (gh pr 616)
- Changed licensing scheme so all new contributions are dual licensed under
  Apache 2.0 and BSD. (gh pr 542, issue 496)
- Added __all__ variable to the root package. Reported by tebriel
  (gh issue 406), fixed by mariocj89 (gh pr 494)
- Added python_requires to setup.py so that pip will distribute the right
  version of dateutil. Fixed by jakec-github (gh issue 537, pr 552)
- Added the utils submodule, for miscellaneous utilities.
- Added within_delta function to utils - added by justanr (gh issue 432,
  gh pr 437)
- Added today function to utils (gh pr 474)
- Added default_tzinfo function to utils (gh pr 475), solving an issue
  reported by nealmcb (gh issue 94)
- Added dedicated ISO 8601 parsing function isoparse (gh issue 424).
  Initial implementation by pganssle in gh pr 489 and 622, with a
  pre-release fix by kirit93 (gh issue 546, gh pr 573). 
- Moved parser module into parser/_parser.py and officially deprecated the use
  of several private functions and classes from that module. (gh pr 501, 515)
- Tweaked parser error message to include rejected string format, added by
  pbiering (gh pr 300)
- Add support for parsing bytesarray, reported by uckelman (gh issue 417) and
  fixed by uckelman and pganssle (gh pr 514)
- Started raising a warning when the parser finds a timezone string that it
  cannot construct a tzinfo instance for (rather than succeeding with no
  indication of an error). Reported and fixed by jbrockmendel (gh pr 540)
- Dropped the use of assert in the parser. Fixed by jbrockmendel (gh pr 502)
- Fixed to assertion logic in parser to support dates like &#39;2015-15-May&#39;,
  reported and fixed by jbrockmendel (gh pr 409)
- Fixed IndexError in parser on dates with trailing colons, reported and fixed
  by jbrockmendel (gh pr 420)
- Fixed bug where hours were not validated, leading to improper parse. Reported
  by heappro (gh pr 353), fixed by jbrockmendel (gh pr 482)
- Fixed problem parsing strings in %b-%Y-%d format. Reported and fixed by
  jbrockmendel (gh pr 481)
- Fixed problem parsing strings in the %d%B%y format. Reported by asishm
  (gh issue 360), fixed by jbrockmendel (gh pr 483)
- Fixed problem parsing certain unambiguous strings when year &lt;99 (gh pr 510).
  Reported by alexwlchan (gh issue 293).
- Fixed issue with parsing an unambiguous string representation of an ambiguous
  datetime such that if possible the correct value for fold is set. Fixes
  issue reported by JordonPhillips and pganssle (gh issue 318, 320,
  gh pr 517)
- Fixed issue with improper rounding of fractional components. Reported by
  dddmello (gh issue 427), fixed by m-dz (gh pr 570)
- Performance improvement to parser from removing certain min() calls. Reported
  and fixed by jbrockmendel (gh pr 589)
- Significantly refactored parser code by jbrockmendel (gh prs 419, 436,
  490, 498, 539) and pganssle (gh prs 435, 468)
- Implementated of __hash__ for relativedelta and weekday, reported and fixed
  by mrigor (gh pr 389) 
- Implemented __abs__ for relativedelta. Reported by binnisb and pferreir
  (gh issue 350, pr 472)
- Fixed relativedelta.weeks property getter and setter to work for both
  negative and positive values. Reported and fixed by souliane (gh issue 459,
  pr 460)
- Fixed issue where passing whole number floats to the months or years
  arguments of the relativedelta constructor would lead to errors during
  addition. Reported by arouanet (gh pr 411), fixed by lkollar (gh pr 553)
- Added a pre-built tz.UTC object representing UTC (gh pr 497)
- Added a cache to tz.gettz so that by default it will return the same object
  for identical inputs. This will change the semantics of certain operations
  between datetimes constructed with tzinfo=tz.gettz(...). (gh pr 628)
- Changed the behavior of tz.tzutc to return a singleton (gh pr 497, 504)
- Changed the behavior of tz.tzoffset to return the same object when passed the
  same inputs, with a corresponding performance improvement (gh pr 504)
- Changed the behavior of tz.tzstr to return the same object when passed the
  same inputs. (gh pr 628)
- Added .instance alternate constructors for tz.tzoffset and tz.tzstr, to
  allow the construction of a new instance if desired. (gh pr 628)
- Added the tz.gettz.nocache function to allow explicit retrieval of a new
  instance of the relevant tzinfo. (gh pr 628)
- Expand definition of tz.tzlocal equality so that the local zone is allow
  equality with tzoffset and tzutc. (gh pr 598)
- Deprecated the idiosyncratic tzstr format mentioned in several examples but
  evidently designed exclusively for dateutil, and very likely not used by
  any current users. (gh issue 595, gh pr 606)
- Added the tz.resolve_imaginary function, which generates a real date from
  an imaginary one, if necessary. Implemented by Cheukting (gh issue 339,
  gh pr 607)
- Fixed issue where the tz.tzstr constructor would erroneously succeed if
  passed an invalid value for tzstr. Fixed by pablogsal (gh issue 259,
  gh pr 581)
- Fixed issue with tz.gettz for TZ variables that start with a colon. Reported
  and fixed by lapointexavier (gh pr 601)
- Added a lock to tz.tzical&#39;s cache. Reported and fixed by Unrud (gh pr 430) 
- Fixed an issue with fold support on certain Python 3 implementations that
  used the pre-3.6 pure Python implementation of datetime.replace, most
  notably pypy3 (gh pr 446).
- Added support for VALUE=DATE-TIME for DTSTART in rrulestr. Reported by potuz
  (gh issue 401) and fixed by Unrud (gh pr 429)
- Started enforcing that within VTIMEZONE, the VALUE parameter can only be
  omitted or DATE-TIME, per RFC 5545. Reported by Unrud (gh pr 439)
- Added support for TZID parameter for DTSTART in rrulestr. Reported and
  fixed by ryanpetrello (gh issue 614, gh pr 624)
- Added &#39;RRULE:&#39; prefix to rrule strings generated by rrule.__str__, in
  compliance with the RFC. Reported by AndrewPashkin (gh issue 86), fixed by
  jarondl and mlorant (gh pr 450)
- Switched to setuptools_scm for version management, automatically calculating
  a version number from the git metadata. Reported by jreback (gh issue 511),
  implemented by Sulley38 (gh pr 564)
- Switched setup.py to use find_packages, and started testing against pip
  installed versions of dateutil in CI. Fixed issue with parser import
  discovered by jreback in pandas-dev/pandas18141. (gh issue 507, pr 509)
- Switched test suite to using pytest (gh pr 495)
- Switched CI over to use tox. Fixed by gaborbernat (gh pr 549)
- Added a test-only dependency on freezegun. (gh pr 474)
- Reduced number of CI builds on Appveyor. Fixed by kirit93 (gh issue 529,
  gh pr 579)
- Made xfails strict by default, so that an xpass is a failure. (gh pr 567)
- Added a documentation generation stage to tox and CI. (gh pr 568)
- Added an explicit warning when running python setup.py explaining how to run
  the test suites with pytest. Fixed by lkollar. (gh issue 544, gh pr 548)
- Added requirements-dev.txt for test dependency management (gh pr 499, 516)
- Fixed code coverage metrics to account for Windows builds (gh pr 526)
- Fixed code coverage metrics to NOT count xfails. Fixed by gaborbernat
  (gh issue 519, gh pr 563)
- Style improvement to zoneinfo.tzfile that was confusing to static type
  checkers. Reported and fixed by quodlibetor (gh pr 485)
- Several unused imports were removed by jdufresne. (gh pr 486)
- Switched isinstance(*, collections.Callable) to callable, which is available
  on all supported Python versions. Implemented by jdufresne (gh pr 612)
- Added CONTRIBUTING.md (gh pr 533)
- Added AUTHORS.md (gh pr 542)
- Corrected setup.py metadata to reflect author vs. maintainer, (gh issue 477,
  gh pr 538)
- Corrected README to reflect that tests are now run in pytest. Reported and
  fixed by m-dz (gh issue 556, gh pr 557)
- Updated all references to RFC 2445 (iCalendar) to point to RFC 5545. Fixed
  by mariocj89 (gh issue 543, gh pr 555)
- Corrected parse documentation to reflect proper integer offset units,
  reported and fixed by abrugh (gh pr 458)
- Fixed dangling parenthesis in tzoffset documentation (gh pr 461)
- Started including the license file in wheels. Reported and fixed by
  jdufresne (gh pr 476)
- Indendation fixes to parser docstring by jbrockmendel (gh pr 492)
- Moved many examples from the &quot;examples&quot; documentation into their appropriate
  module documentation pages. Fixed by Tomasz-Kluczkowski and jakec-github
  (gh pr 558, 561)
- Fixed documentation so that the parser.isoparse documentation displays.
  Fixed by alexchamberlain (gh issue 545, gh pr 560)
- Refactored build and release sections and added setup instructions to
  CONTRIBUTING. Reported and fixed by kynan (gh pr 562)
- Cleaned up various dead links in the documentation. (gh pr 602, 608, 618)
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/python-dateutil
  - Changelog: https://pyup.io/changelogs/python-dateutil/
  - Docs: https://dateutil.readthedocs.io
</details>





### Update [pytz](https://pypi.org/project/pytz) from **2017.3** to **2018.4**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pytz
  - Homepage: http://pythonhosted.org/pytz
  - Docs: https://pythonhosted.org/pytz/
</details>





### Update [twisted[tls,conch]](https://pypi.org/project/twisted) from **17.9.0** to **18.4.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 18.4.0
   ```
   ===========================

Features
--------

- The --port/--https arguments to web plugin are now deprecated, in favor of
  --listen. The --listen argument can be given multiple times to listen on
  multiple ports. (6670)
- Twisted now requires zope.interface 4.4.2 or higher across all platforms and
  Python versions. (8149)
- The osx_platform setuptools extra has been renamed to macos_platform, with
  the former name being a compatibility alias. (8848)
- Zsh completions are now provided for the twist command. (9338)
- twisted.internet.endpoints.HostnameEndpoint now has a __repr__ method which
  includes the host and port to which the endpoint connects. (9341)


Bugfixes
--------

- twistd now uses the UID&#39;s default GID to initialize groups when --uid is
  given but --gid is not. This prevents an unhandled TypeError from being
  raised when os.initgroups() is called. (4442)
- twisted.protocols.basic.LineReceiver checks received lines&#39; lengths against
  its MAX_LENGTH only after receiving a complete delimiter. A line ending in a
  multi-byte delimiter like &#39;\r\n&#39; might be split by the network, with the
  first part arriving before the rest; previously, LineReceiver erroneously
  disconnected if the first part, e.g. &#39;zzzz....\r&#39; exceeded MAX_LENGTH.
  LineReceiver now checks received data against MAX_LENGTH plus the delimiter&#39;s
  length, allowing short reads to complete a line. (6556)
- twisted.protocols.basic.LineOnlyReceiver disconnects the transport after
  receiving a line that exceeds MAX_LENGTH, like LineReceiver. (6557)
- twisted.web.http.Request.getClientIP now returns the host part of the
  client&#39;s address when connected over IPv6. (7704)
- twisted.application.service.IService is now documented as requiring the
  &#39;running&#39;, &#39;name&#39; and &#39;parent&#39; attributes (the documentation previously
  implied they were required, but was unclear). (7922)
- twisted.web.wsgi.WSGIResource no longer raises an exception when a client
  connects over IPv6. (8241)
- When using TLS enable automatic ECDH curve selection on OpenSSL 1.0.2+
  instead of only supporting P-256 (9210)
- twisted.trial._dist.worker and twisted.trial._dist.workertrial consistently
  pass bytes, not unicode to AMP. This fixes &quot;trial -j&quot; on Python 3. (9264)
- twisted.trial.runner now uses the &#39;importlib&#39; module instead of the &#39;imp&#39;
  module on Python 3+. This eliminates DeprecationWarnings caused by importing
  &#39;imp&#39; on Python 3. (9275)
- twisted.web.client.HTTP11ClientProtocol now closes the connection when the
  server is sending a header line which is longer than he line limit of
  twisted.protocols.basic.LineReceiver.MAX_LENGTH. (9295)
- twisted.python.failure now handles long stacktraces better; in particular it
  will log tracebacks for stack overflow errors. (9301)
- The &quot;--_shell-completion&quot; argument to twistd now works on Python 3. (9303)
- twisted.python.failure.Failure now raises the wrapped exception in Python3,
  and self (Failure) n Python2 when trap() is called without a matching
  exception (9307)
- Writing large amounts of data no longer implies repeated, expensive copying
  under Python 3. Python 3&#39;s write speeds are now as fast as Python 2&#39;s.
  (9324)
- twisted.protocols.postfix now properly encodes errors which are unicode
  strings to bytes. (9335)
- twisted.protocols.policies.ProtocolWrapper and
  twisted.protocols.tls.TLSMemoryBIOProtocol no longer create circular
  references that keep protocol instances in memory after connection is closed.
  (9374)
- twisted.conch.ssh.transport.SSHTransportBase no longer strips trailing spaces
  from the SSH version string of the connected peer. (9377)
- `trial -j` no longer crashes on Python 2 on test failure messages containing
  non-ASCII bytes. (9378)
- RSA keys replaced with 2048bit ones in twisted.conch.test.keydata in order to
  be compatible with OpenSSH 7.6. (9388)
- AsyncioSelectorReactor uses the global policy&#39;s event loop. asyncio libraries
  that retrieve the running event loop with get_event_loop() will now receive
  the one used by AsyncioSelectorReactor. (9390)


Improved Documentation
----------------------

- public attributes of `twisted.logger.Logger` are now documented as
  attributes. (8157)
- List indentation formatting errors have been corrected throughout the
  documentation. (9256)


Deprecations and Removals
-------------------------

- twisted.protocols.basic.LineOnlyReceiver.lineLengthExceeded no longer returns
  twisted.internet.error.ConnectionLost. It instead directly disconnects the
  transport and returns None. (6557)
- twisted.python.win32.getProgramsMenuPath and
  twisted.python.win32.getProgramFilesPath were deprecated in Twisted 15.3.0
  and have now been removed. (9312)
- Python 3.3 is no longer supported. (9352)


Misc
----

- 7033, 8887, 9204, 9289, 9291, 9292, 9293, 9302, 9336, 9355, 9356,
  9364, 9375, 9381, 9382, 9389, 9391, 9393, 9394, 9396


Conch
-----

Bugfixes
~~~~~~~~

- twisted.plugins.cred_unix now properly converts a username and password from
  bytes to str on Python 3. In addition, passwords which are encrypted with
  SHA512 and SH256 are properly verified. This fixes running a conch server
  with: &quot;twistd -n conch -d /etc/ssh/ --auth=unix&quot;. (9130)
- In twisted.conch.scripts.conch, on Python 3 do not write bytes directly to
  sys.stderr. On Python 3, this fixes remote SSH execution of a command which
  fails. (9344)


Deprecations and Removals
~~~~~~~~~~~~~~~~~~~~~~~~~

- twisted.conch.ssh.filetransfer.FileTransferClient.wasAFile attribute has been
  removed as it serves no purpose. (9362)
- Removed deprecated support for PyCrypto key objects in conch (9368)


Web
---

Features
~~~~~~~~

- The new twisted.iweb.IRequest.getClientAddress returns the IAddress provider
  representing the client&#39;s address. Callers should check the type of the
  returned value before using it. (7707)
- Eliminate use of twisted.python.log in twisted.web modules. (9280)


Bugfixes
~~~~~~~~

- Scripts ending with .rpy, .epy, and .cgi now execute properly in Twisted Web
  on Python 3. (9271)
- twisted.web.http.Request and twisted.web.server.Request are once again
  hashable on Python 2, fixing a regression introduced in Twisted 17.5.0.
  (9314)


Improved Documentation
~~~~~~~~~~~~~~~~~~~~~~

- Correct reactor docstrings for twisted.web.client.Agent and
  twisted.web.client._StandardEndpointFactory to communicate interface
  requirements since 17.1. (9274)
- The examples for the &quot;Twisted Web in 60 Seconds&quot; tutorial have been fixed to
  work on Python 3. (9285)


Deprecations and Removals
~~~~~~~~~~~~~~~~~~~~~~~~~

- twisted.iweb.IRequest.getClientIP is deprecated. Use
  twisted.iweb.IRequest.getClientAddress instead (see 7707). (7705)
- twisted.web.iweb.IRequest.getClient and its implementations (deprecated in
  2552) have been removed. (9395)


Mail
----

Bugfixes
~~~~~~~~

- twistd.mail.scripts.mailmail has been ported to Python 3. (8487)
- twisted.mail.bounce now works on Python 3. (9260)
- twisted.mail.pop3 and twisted.mail.pop3client now work on Python 3. (9269)
- SMTP authentication in twisted.mail.smtp now works better on Python 3, due to
  improved improved bytes vs unicode handling. (9299)


Misc
~~~~

- 9310


Words
-----

No significant changes.


Names
-----

No significant changes.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/twisted
  - Changelog: https://pyup.io/changelogs/twisted/
  - Homepage: http://twistedmatrix.com/
  - Bugtracker: https://twistedmatrix.com/trac/
</details>





### Update [zope.interface](https://pypi.org/project/zope.interface) from **4.4.3** to **4.5.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 4.5.0
   ```
   ------------------

- Drop support for 3.3, avoid accidental dependence breakage via setup.py.
  See `PR 110 &lt;https://github.com/zopefoundation/zope.interface/pull/110&gt;`_.
- Allow registering and unregistering instance methods as listeners.
  See `issue 12 &lt;https://github.com/zopefoundation/zope.interface/issues/12&gt;`_
  and `PR 102 &lt;https://github.com/zopefoundation/zope.interface/pull/102&gt;`_.
- Synchronize and simplify zope/__init__.py. See `issue 114
  &lt;https://github.com/zopefoundation/zope.interface/issues/114&gt;`_
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/zope.interface
  - Changelog: https://pyup.io/changelogs/zope.interface/
  - Repo: https://github.com/zopefoundation/zope.interface
</details>
bors-fusion bot referenced this pull request in fusionapp/documint May 9, 2018
133: Scheduled weekly dependency update for week 18 r=mithrandi a=pyup-bot






### Update [attrs](https://pypi.org/project/attrs) from **17.4.0** to **18.1.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 18.1.0
   ```
   -------------------

Changes
^^^^^^^

- ``x=X(); x.cycle = x; repr(x)`` will no longer raise a ``RecursionError``, and will instead show as ``X(x=...)``.

  `95 &lt;https://github.com/python-attrs/attrs/issues/95&gt;`_
- ``attr.ib(factory=f)`` is now syntactic sugar for the common case of ``attr.ib(default=attr.Factory(f))``.

  `178 &lt;https://github.com/python-attrs/attrs/issues/178&gt;`_,
  `356 &lt;https://github.com/python-attrs/attrs/issues/356&gt;`_
- Added ``attr.field_dict()`` to return an ordered dictionary of ``attrs`` attributes for a class, whose keys are the attribute names.

  `290 &lt;https://github.com/python-attrs/attrs/issues/290&gt;`_,
  `349 &lt;https://github.com/python-attrs/attrs/issues/349&gt;`_
- The order of attributes that are passed into ``attr.make_class()`` or the ``these`` argument of ``attr.s()`` is now retained if the dictionary is ordered (i.e. ``dict`` on Python 3.6 and later, ``collections.OrderedDict`` otherwise).

  Before, the order was always determined by the order in which the attributes have been defined which may not be desirable when creating classes programatically.

  `300 &lt;https://github.com/python-attrs/attrs/issues/300&gt;`_,
  `339 &lt;https://github.com/python-attrs/attrs/issues/339&gt;`_,
  `343 &lt;https://github.com/python-attrs/attrs/issues/343&gt;`_
- In slotted classes, ``__getstate__`` and ``__setstate__`` now ignore the ``__weakref__`` attribute.

  `311 &lt;https://github.com/python-attrs/attrs/issues/311&gt;`_,
  `326 &lt;https://github.com/python-attrs/attrs/issues/326&gt;`_
- Setting the cell type is now completely best effort.
  This fixes ``attrs`` on Jython.

  We cannot make any guarantees regarding Jython though, because our test suite cannot run due to dependency incompatabilities.

  `321 &lt;https://github.com/python-attrs/attrs/issues/321&gt;`_,
  `334 &lt;https://github.com/python-attrs/attrs/issues/334&gt;`_
- If ``attr.s`` is passed a *these* argument, it will not attempt to remove attributes with the same name from the class body anymore.

  `322 &lt;https://github.com/python-attrs/attrs/issues/322&gt;`_,
  `323 &lt;https://github.com/python-attrs/attrs/issues/323&gt;`_
- The hash of ``attr.NOTHING`` is now vegan and faster on 32bit Python builds.

  `331 &lt;https://github.com/python-attrs/attrs/issues/331&gt;`_,
  `332 &lt;https://github.com/python-attrs/attrs/issues/332&gt;`_
- The overhead of instantiating frozen dict classes is virtually eliminated.
  `336 &lt;https://github.com/python-attrs/attrs/issues/336&gt;`_
- Generated ``__init__`` methods now have an ``__annotations__`` attribute derived from the types of the fields.

  `363 &lt;https://github.com/python-attrs/attrs/issues/363&gt;`_
- We have restructured the documentation a bit to account for ``attrs``&#39; growth in scope.
  Instead of putting everything into the `examples &lt;http://www.attrs.org/en/stable/examples.html&gt;`_ page, we have started to extract narrative chapters.

  So far, we&#39;ve added chapters on `initialization &lt;http://www.attrs.org/en/stable/init.html&gt;`_ and `hashing &lt;http://www.attrs.org/en/stable/hashing.html&gt;`_.

  Expect more to come!

  `369 &lt;https://github.com/python-attrs/attrs/issues/369&gt;`_,
  `370 &lt;https://github.com/python-attrs/attrs/issues/370&gt;`_


----
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/attrs
  - Changelog: https://pyup.io/changelogs/attrs/
  - Homepage: http://www.attrs.org/
</details>





### Update [twisted[tls]](https://pypi.org/project/twisted) from **17.9.0** to **18.4.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 18.4.0
   ```
   ===========================

Features
--------

- The --port/--https arguments to web plugin are now deprecated, in favor of
  --listen. The --listen argument can be given multiple times to listen on
  multiple ports. (6670)
- Twisted now requires zope.interface 4.4.2 or higher across all platforms and
  Python versions. (8149)
- The osx_platform setuptools extra has been renamed to macos_platform, with
  the former name being a compatibility alias. (8848)
- Zsh completions are now provided for the twist command. (9338)
- twisted.internet.endpoints.HostnameEndpoint now has a __repr__ method which
  includes the host and port to which the endpoint connects. (9341)


Bugfixes
--------

- twistd now uses the UID&#39;s default GID to initialize groups when --uid is
  given but --gid is not. This prevents an unhandled TypeError from being
  raised when os.initgroups() is called. (4442)
- twisted.protocols.basic.LineReceiver checks received lines&#39; lengths against
  its MAX_LENGTH only after receiving a complete delimiter. A line ending in a
  multi-byte delimiter like &#39;\r\n&#39; might be split by the network, with the
  first part arriving before the rest; previously, LineReceiver erroneously
  disconnected if the first part, e.g. &#39;zzzz....\r&#39; exceeded MAX_LENGTH.
  LineReceiver now checks received data against MAX_LENGTH plus the delimiter&#39;s
  length, allowing short reads to complete a line. (6556)
- twisted.protocols.basic.LineOnlyReceiver disconnects the transport after
  receiving a line that exceeds MAX_LENGTH, like LineReceiver. (6557)
- twisted.web.http.Request.getClientIP now returns the host part of the
  client&#39;s address when connected over IPv6. (7704)
- twisted.application.service.IService is now documented as requiring the
  &#39;running&#39;, &#39;name&#39; and &#39;parent&#39; attributes (the documentation previously
  implied they were required, but was unclear). (7922)
- twisted.web.wsgi.WSGIResource no longer raises an exception when a client
  connects over IPv6. (8241)
- When using TLS enable automatic ECDH curve selection on OpenSSL 1.0.2+
  instead of only supporting P-256 (9210)
- twisted.trial._dist.worker and twisted.trial._dist.workertrial consistently
  pass bytes, not unicode to AMP. This fixes &quot;trial -j&quot; on Python 3. (9264)
- twisted.trial.runner now uses the &#39;importlib&#39; module instead of the &#39;imp&#39;
  module on Python 3+. This eliminates DeprecationWarnings caused by importing
  &#39;imp&#39; on Python 3. (9275)
- twisted.web.client.HTTP11ClientProtocol now closes the connection when the
  server is sending a header line which is longer than he line limit of
  twisted.protocols.basic.LineReceiver.MAX_LENGTH. (9295)
- twisted.python.failure now handles long stacktraces better; in particular it
  will log tracebacks for stack overflow errors. (9301)
- The &quot;--_shell-completion&quot; argument to twistd now works on Python 3. (9303)
- twisted.python.failure.Failure now raises the wrapped exception in Python3,
  and self (Failure) n Python2 when trap() is called without a matching
  exception (9307)
- Writing large amounts of data no longer implies repeated, expensive copying
  under Python 3. Python 3&#39;s write speeds are now as fast as Python 2&#39;s.
  (9324)
- twisted.protocols.postfix now properly encodes errors which are unicode
  strings to bytes. (9335)
- twisted.protocols.policies.ProtocolWrapper and
  twisted.protocols.tls.TLSMemoryBIOProtocol no longer create circular
  references that keep protocol instances in memory after connection is closed.
  (9374)
- twisted.conch.ssh.transport.SSHTransportBase no longer strips trailing spaces
  from the SSH version string of the connected peer. (9377)
- `trial -j` no longer crashes on Python 2 on test failure messages containing
  non-ASCII bytes. (9378)
- RSA keys replaced with 2048bit ones in twisted.conch.test.keydata in order to
  be compatible with OpenSSH 7.6. (9388)
- AsyncioSelectorReactor uses the global policy&#39;s event loop. asyncio libraries
  that retrieve the running event loop with get_event_loop() will now receive
  the one used by AsyncioSelectorReactor. (9390)


Improved Documentation
----------------------

- public attributes of `twisted.logger.Logger` are now documented as
  attributes. (8157)
- List indentation formatting errors have been corrected throughout the
  documentation. (9256)


Deprecations and Removals
-------------------------

- twisted.protocols.basic.LineOnlyReceiver.lineLengthExceeded no longer returns
  twisted.internet.error.ConnectionLost. It instead directly disconnects the
  transport and returns None. (6557)
- twisted.python.win32.getProgramsMenuPath and
  twisted.python.win32.getProgramFilesPath were deprecated in Twisted 15.3.0
  and have now been removed. (9312)
- Python 3.3 is no longer supported. (9352)


Misc
----

- 7033, 8887, 9204, 9289, 9291, 9292, 9293, 9302, 9336, 9355, 9356,
  9364, 9375, 9381, 9382, 9389, 9391, 9393, 9394, 9396


Conch
-----

Bugfixes
~~~~~~~~

- twisted.plugins.cred_unix now properly converts a username and password from
  bytes to str on Python 3. In addition, passwords which are encrypted with
  SHA512 and SH256 are properly verified. This fixes running a conch server
  with: &quot;twistd -n conch -d /etc/ssh/ --auth=unix&quot;. (9130)
- In twisted.conch.scripts.conch, on Python 3 do not write bytes directly to
  sys.stderr. On Python 3, this fixes remote SSH execution of a command which
  fails. (9344)


Deprecations and Removals
~~~~~~~~~~~~~~~~~~~~~~~~~

- twisted.conch.ssh.filetransfer.FileTransferClient.wasAFile attribute has been
  removed as it serves no purpose. (9362)
- Removed deprecated support for PyCrypto key objects in conch (9368)


Web
---

Features
~~~~~~~~

- The new twisted.iweb.IRequest.getClientAddress returns the IAddress provider
  representing the client&#39;s address. Callers should check the type of the
  returned value before using it. (7707)
- Eliminate use of twisted.python.log in twisted.web modules. (9280)


Bugfixes
~~~~~~~~

- Scripts ending with .rpy, .epy, and .cgi now execute properly in Twisted Web
  on Python 3. (9271)
- twisted.web.http.Request and twisted.web.server.Request are once again
  hashable on Python 2, fixing a regression introduced in Twisted 17.5.0.
  (9314)


Improved Documentation
~~~~~~~~~~~~~~~~~~~~~~

- Correct reactor docstrings for twisted.web.client.Agent and
  twisted.web.client._StandardEndpointFactory to communicate interface
  requirements since 17.1. (9274)
- The examples for the &quot;Twisted Web in 60 Seconds&quot; tutorial have been fixed to
  work on Python 3. (9285)


Deprecations and Removals
~~~~~~~~~~~~~~~~~~~~~~~~~

- twisted.iweb.IRequest.getClientIP is deprecated. Use
  twisted.iweb.IRequest.getClientAddress instead (see 7707). (7705)
- twisted.web.iweb.IRequest.getClient and its implementations (deprecated in
  2552) have been removed. (9395)


Mail
----

Bugfixes
~~~~~~~~

- twistd.mail.scripts.mailmail has been ported to Python 3. (8487)
- twisted.mail.bounce now works on Python 3. (9260)
- twisted.mail.pop3 and twisted.mail.pop3client now work on Python 3. (9269)
- SMTP authentication in twisted.mail.smtp now works better on Python 3, due to
  improved improved bytes vs unicode handling. (9299)


Misc
~~~~

- 9310


Words
-----

No significant changes.


Names
-----

No significant changes.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/twisted
  - Changelog: https://pyup.io/changelogs/twisted/
  - Homepage: http://twistedmatrix.com/
  - Bugtracker: https://twistedmatrix.com/trac/
</details>





### Update [zope.interface](https://pypi.org/project/zope.interface) from **4.4.3** to **4.5.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 4.5.0
   ```
   ------------------

- Drop support for 3.3, avoid accidental dependence breakage via setup.py.
  See `PR 110 &lt;https://github.com/zopefoundation/zope.interface/pull/110&gt;`_.
- Allow registering and unregistering instance methods as listeners.
  See `issue 12 &lt;https://github.com/zopefoundation/zope.interface/issues/12&gt;`_
  and `PR 102 &lt;https://github.com/zopefoundation/zope.interface/pull/102&gt;`_.
- Synchronize and simplify zope/__init__.py. See `issue 114
  &lt;https://github.com/zopefoundation/zope.interface/issues/114&gt;`_
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/zope.interface
  - Changelog: https://pyup.io/changelogs/zope.interface/
  - Repo: https://github.com/zopefoundation/zope.interface
</details>
bors-fusion bot referenced this pull request in fusionapp/fusion-index May 9, 2018
193: Scheduled weekly dependency update for week 18 r=mithrandi a=pyup-bot






### Update [attrs](https://pypi.org/project/attrs) from **17.4.0** to **18.1.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 18.1.0
   ```
   -------------------

Changes
^^^^^^^

- ``x=X(); x.cycle = x; repr(x)`` will no longer raise a ``RecursionError``, and will instead show as ``X(x=...)``.

  `95 &lt;https://github.com/python-attrs/attrs/issues/95&gt;`_
- ``attr.ib(factory=f)`` is now syntactic sugar for the common case of ``attr.ib(default=attr.Factory(f))``.

  `178 &lt;https://github.com/python-attrs/attrs/issues/178&gt;`_,
  `356 &lt;https://github.com/python-attrs/attrs/issues/356&gt;`_
- Added ``attr.field_dict()`` to return an ordered dictionary of ``attrs`` attributes for a class, whose keys are the attribute names.

  `290 &lt;https://github.com/python-attrs/attrs/issues/290&gt;`_,
  `349 &lt;https://github.com/python-attrs/attrs/issues/349&gt;`_
- The order of attributes that are passed into ``attr.make_class()`` or the ``these`` argument of ``attr.s()`` is now retained if the dictionary is ordered (i.e. ``dict`` on Python 3.6 and later, ``collections.OrderedDict`` otherwise).

  Before, the order was always determined by the order in which the attributes have been defined which may not be desirable when creating classes programatically.

  `300 &lt;https://github.com/python-attrs/attrs/issues/300&gt;`_,
  `339 &lt;https://github.com/python-attrs/attrs/issues/339&gt;`_,
  `343 &lt;https://github.com/python-attrs/attrs/issues/343&gt;`_
- In slotted classes, ``__getstate__`` and ``__setstate__`` now ignore the ``__weakref__`` attribute.

  `311 &lt;https://github.com/python-attrs/attrs/issues/311&gt;`_,
  `326 &lt;https://github.com/python-attrs/attrs/issues/326&gt;`_
- Setting the cell type is now completely best effort.
  This fixes ``attrs`` on Jython.

  We cannot make any guarantees regarding Jython though, because our test suite cannot run due to dependency incompatabilities.

  `321 &lt;https://github.com/python-attrs/attrs/issues/321&gt;`_,
  `334 &lt;https://github.com/python-attrs/attrs/issues/334&gt;`_
- If ``attr.s`` is passed a *these* argument, it will not attempt to remove attributes with the same name from the class body anymore.

  `322 &lt;https://github.com/python-attrs/attrs/issues/322&gt;`_,
  `323 &lt;https://github.com/python-attrs/attrs/issues/323&gt;`_
- The hash of ``attr.NOTHING`` is now vegan and faster on 32bit Python builds.

  `331 &lt;https://github.com/python-attrs/attrs/issues/331&gt;`_,
  `332 &lt;https://github.com/python-attrs/attrs/issues/332&gt;`_
- The overhead of instantiating frozen dict classes is virtually eliminated.
  `336 &lt;https://github.com/python-attrs/attrs/issues/336&gt;`_
- Generated ``__init__`` methods now have an ``__annotations__`` attribute derived from the types of the fields.

  `363 &lt;https://github.com/python-attrs/attrs/issues/363&gt;`_
- We have restructured the documentation a bit to account for ``attrs``&#39; growth in scope.
  Instead of putting everything into the `examples &lt;http://www.attrs.org/en/stable/examples.html&gt;`_ page, we have started to extract narrative chapters.

  So far, we&#39;ve added chapters on `initialization &lt;http://www.attrs.org/en/stable/init.html&gt;`_ and `hashing &lt;http://www.attrs.org/en/stable/hashing.html&gt;`_.

  Expect more to come!

  `369 &lt;https://github.com/python-attrs/attrs/issues/369&gt;`_,
  `370 &lt;https://github.com/python-attrs/attrs/issues/370&gt;`_


----
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/attrs
  - Changelog: https://pyup.io/changelogs/attrs/
  - Homepage: http://www.attrs.org/
</details>





### Update [hypothesis](https://pypi.org/project/hypothesis) from **3.53.0** to **3.56.5**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/hypothesis
  - Repo: https://github.com/HypothesisWorks/hypothesis/issues
</details>





### Update [ipaddress](https://pypi.org/project/ipaddress) from **1.0.19** to **1.0.21**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/ipaddress
  - Repo: https://github.com/phihag/ipaddress
</details>





### Update [pbr](https://pypi.org/project/pbr) from **4.0.0** to **4.0.2**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pbr
  - Homepage: https://docs.openstack.org/pbr/latest/
</details>





### Update [twisted[tls]](https://pypi.org/project/twisted) from **17.9.0** to **18.4.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 18.4.0
   ```
   ===========================

Features
--------

- The --port/--https arguments to web plugin are now deprecated, in favor of
  --listen. The --listen argument can be given multiple times to listen on
  multiple ports. (6670)
- Twisted now requires zope.interface 4.4.2 or higher across all platforms and
  Python versions. (8149)
- The osx_platform setuptools extra has been renamed to macos_platform, with
  the former name being a compatibility alias. (8848)
- Zsh completions are now provided for the twist command. (9338)
- twisted.internet.endpoints.HostnameEndpoint now has a __repr__ method which
  includes the host and port to which the endpoint connects. (9341)


Bugfixes
--------

- twistd now uses the UID&#39;s default GID to initialize groups when --uid is
  given but --gid is not. This prevents an unhandled TypeError from being
  raised when os.initgroups() is called. (4442)
- twisted.protocols.basic.LineReceiver checks received lines&#39; lengths against
  its MAX_LENGTH only after receiving a complete delimiter. A line ending in a
  multi-byte delimiter like &#39;\r\n&#39; might be split by the network, with the
  first part arriving before the rest; previously, LineReceiver erroneously
  disconnected if the first part, e.g. &#39;zzzz....\r&#39; exceeded MAX_LENGTH.
  LineReceiver now checks received data against MAX_LENGTH plus the delimiter&#39;s
  length, allowing short reads to complete a line. (6556)
- twisted.protocols.basic.LineOnlyReceiver disconnects the transport after
  receiving a line that exceeds MAX_LENGTH, like LineReceiver. (6557)
- twisted.web.http.Request.getClientIP now returns the host part of the
  client&#39;s address when connected over IPv6. (7704)
- twisted.application.service.IService is now documented as requiring the
  &#39;running&#39;, &#39;name&#39; and &#39;parent&#39; attributes (the documentation previously
  implied they were required, but was unclear). (7922)
- twisted.web.wsgi.WSGIResource no longer raises an exception when a client
  connects over IPv6. (8241)
- When using TLS enable automatic ECDH curve selection on OpenSSL 1.0.2+
  instead of only supporting P-256 (9210)
- twisted.trial._dist.worker and twisted.trial._dist.workertrial consistently
  pass bytes, not unicode to AMP. This fixes &quot;trial -j&quot; on Python 3. (9264)
- twisted.trial.runner now uses the &#39;importlib&#39; module instead of the &#39;imp&#39;
  module on Python 3+. This eliminates DeprecationWarnings caused by importing
  &#39;imp&#39; on Python 3. (9275)
- twisted.web.client.HTTP11ClientProtocol now closes the connection when the
  server is sending a header line which is longer than he line limit of
  twisted.protocols.basic.LineReceiver.MAX_LENGTH. (9295)
- twisted.python.failure now handles long stacktraces better; in particular it
  will log tracebacks for stack overflow errors. (9301)
- The &quot;--_shell-completion&quot; argument to twistd now works on Python 3. (9303)
- twisted.python.failure.Failure now raises the wrapped exception in Python3,
  and self (Failure) n Python2 when trap() is called without a matching
  exception (9307)
- Writing large amounts of data no longer implies repeated, expensive copying
  under Python 3. Python 3&#39;s write speeds are now as fast as Python 2&#39;s.
  (9324)
- twisted.protocols.postfix now properly encodes errors which are unicode
  strings to bytes. (9335)
- twisted.protocols.policies.ProtocolWrapper and
  twisted.protocols.tls.TLSMemoryBIOProtocol no longer create circular
  references that keep protocol instances in memory after connection is closed.
  (9374)
- twisted.conch.ssh.transport.SSHTransportBase no longer strips trailing spaces
  from the SSH version string of the connected peer. (9377)
- `trial -j` no longer crashes on Python 2 on test failure messages containing
  non-ASCII bytes. (9378)
- RSA keys replaced with 2048bit ones in twisted.conch.test.keydata in order to
  be compatible with OpenSSH 7.6. (9388)
- AsyncioSelectorReactor uses the global policy&#39;s event loop. asyncio libraries
  that retrieve the running event loop with get_event_loop() will now receive
  the one used by AsyncioSelectorReactor. (9390)


Improved Documentation
----------------------

- public attributes of `twisted.logger.Logger` are now documented as
  attributes. (8157)
- List indentation formatting errors have been corrected throughout the
  documentation. (9256)


Deprecations and Removals
-------------------------

- twisted.protocols.basic.LineOnlyReceiver.lineLengthExceeded no longer returns
  twisted.internet.error.ConnectionLost. It instead directly disconnects the
  transport and returns None. (6557)
- twisted.python.win32.getProgramsMenuPath and
  twisted.python.win32.getProgramFilesPath were deprecated in Twisted 15.3.0
  and have now been removed. (9312)
- Python 3.3 is no longer supported. (9352)


Misc
----

- 7033, 8887, 9204, 9289, 9291, 9292, 9293, 9302, 9336, 9355, 9356,
  9364, 9375, 9381, 9382, 9389, 9391, 9393, 9394, 9396


Conch
-----

Bugfixes
~~~~~~~~

- twisted.plugins.cred_unix now properly converts a username and password from
  bytes to str on Python 3. In addition, passwords which are encrypted with
  SHA512 and SH256 are properly verified. This fixes running a conch server
  with: &quot;twistd -n conch -d /etc/ssh/ --auth=unix&quot;. (9130)
- In twisted.conch.scripts.conch, on Python 3 do not write bytes directly to
  sys.stderr. On Python 3, this fixes remote SSH execution of a command which
  fails. (9344)


Deprecations and Removals
~~~~~~~~~~~~~~~~~~~~~~~~~

- twisted.conch.ssh.filetransfer.FileTransferClient.wasAFile attribute has been
  removed as it serves no purpose. (9362)
- Removed deprecated support for PyCrypto key objects in conch (9368)


Web
---

Features
~~~~~~~~

- The new twisted.iweb.IRequest.getClientAddress returns the IAddress provider
  representing the client&#39;s address. Callers should check the type of the
  returned value before using it. (7707)
- Eliminate use of twisted.python.log in twisted.web modules. (9280)


Bugfixes
~~~~~~~~

- Scripts ending with .rpy, .epy, and .cgi now execute properly in Twisted Web
  on Python 3. (9271)
- twisted.web.http.Request and twisted.web.server.Request are once again
  hashable on Python 2, fixing a regression introduced in Twisted 17.5.0.
  (9314)


Improved Documentation
~~~~~~~~~~~~~~~~~~~~~~

- Correct reactor docstrings for twisted.web.client.Agent and
  twisted.web.client._StandardEndpointFactory to communicate interface
  requirements since 17.1. (9274)
- The examples for the &quot;Twisted Web in 60 Seconds&quot; tutorial have been fixed to
  work on Python 3. (9285)


Deprecations and Removals
~~~~~~~~~~~~~~~~~~~~~~~~~

- twisted.iweb.IRequest.getClientIP is deprecated. Use
  twisted.iweb.IRequest.getClientAddress instead (see 7707). (7705)
- twisted.web.iweb.IRequest.getClient and its implementations (deprecated in
  2552) have been removed. (9395)


Mail
----

Bugfixes
~~~~~~~~

- twistd.mail.scripts.mailmail has been ported to Python 3. (8487)
- twisted.mail.bounce now works on Python 3. (9260)
- twisted.mail.pop3 and twisted.mail.pop3client now work on Python 3. (9269)
- SMTP authentication in twisted.mail.smtp now works better on Python 3, due to
  improved improved bytes vs unicode handling. (9299)


Misc
~~~~

- 9310


Words
-----

No significant changes.


Names
-----

No significant changes.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/twisted
  - Changelog: https://pyup.io/changelogs/twisted/
  - Homepage: http://twistedmatrix.com/
  - Bugtracker: https://twistedmatrix.com/trac/
</details>





### Update [zope.interface](https://pypi.org/project/zope.interface) from **4.4.3** to **4.5.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 4.5.0
   ```
   ------------------

- Drop support for 3.3, avoid accidental dependence breakage via setup.py.
  See `PR 110 &lt;https://github.com/zopefoundation/zope.interface/pull/110&gt;`_.
- Allow registering and unregistering instance methods as listeners.
  See `issue 12 &lt;https://github.com/zopefoundation/zope.interface/issues/12&gt;`_
  and `PR 102 &lt;https://github.com/zopefoundation/zope.interface/pull/102&gt;`_.
- Synchronize and simplify zope/__init__.py. See `issue 114
  &lt;https://github.com/zopefoundation/zope.interface/issues/114&gt;`_
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/zope.interface
  - Changelog: https://pyup.io/changelogs/zope.interface/
  - Repo: https://github.com/zopefoundation/zope.interface
</details>
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.

5 participants