Clean up test state in the `FilePath` tests on Windows so that `_trial_temp` can be deleted

Author: mhaarhaus
Reviewer: tom.prince, itamar, exarkun
Fixes: #5228

Previously a `FilePath` test left some files in `_trial_temp` without permissions
necessary to delete them.  This made clean up _trial_temp a pain.  The test now
makes sure to restore permissions on the dummy files after the test is over.


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38294 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge ssl-chain-cert-2061

Author: hynek
Reviewer: exarkun, tom.prince
Fixes: #2061

Add support for certificate chains to `twisted.internet.ssl.CertificateOptions`.


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38305 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge ssl-largewrite-throughput-6477

Author: exarkun
Reviewer: therve
Fixes: #6477

In `twisted.protocols.tls`, replace some O(N**2) complexity buffer handling
code with some code of somewhat lower complexity.  This primarily helps
improve performance when a single call to `write` is passed a very large
string (the further above 2 ** 16, the bigger impact this will likely
have).


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38313 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Apply 6444v3.patch: Improvments to the test_usage docstrings

Author: stephsolis
Reviewer: rwall
Fixes: #6444

Improvments to the test_usage docstrings.



git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38347 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge assert-986

Remove an `assert` both "abstract" (therefore: TCP) implementations of
`resumeProducing`.

Author: glyph

Reviewer: exarkun

Fixes: #986

self.transport.resumeProducing() will no longer raise an AssertionError if called after self.transport.loseConnection()



git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38384 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge service-docs-5586: The Application howto now provides an example of writing a custom Service.

Author: itamarst
Reviewer: wsanchez
Fixes: #5586


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38397 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Apply 6503.patch: Correct the NoResource import.

Author: introom
Reviewer: thijs
Fixes: #6503

The deprecated alias in t.web.error was removed a while ago.


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38401 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge version-header-6480: Add copyright header and docstring in the auto-generated _version module for subprojects.

Author: Upasana
Reviewer: thijs
Fixes: #6480


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38408 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge deprecate-hashlib-6342: Replace usage of twisted.python.hashlib and deprecate it in favor of the hashlib module in the standard library.

Author: rodney757
Reviewer: tom.prince, thijs, rwall
Fixes: #6342


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38410 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge contants-doc-typo-6525: Fix typo in constants documentation.

Author: Alex
Reviewers: tom.prince
Fixes: #6525

The `hasBody` example was backwards, it should be `not in`.

git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38460 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Static static static


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38483 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge dist-trial-path-6390

Author: therve
Reviewers: glyph, tom.prince
Fixes: #6390

Remove the preamble setting the sys.path for trial dist children, and pass an
environment variable instead.


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38491 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge knownhostsfile-savepath-6255

Author: racheesingh
Reviewer: Julian, exarkun
Fixes: #6255

Give `twisted.conch.client.knownhosts.KnownHostsFile` a public `savePath` attribute
which identifies the filesystem path to which information is saved and from which
it is loaded.


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38494 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge circular-deferred-6164

Author: radix
Reviewer: therve
Fixes: #6164

If a callback that is attached to a Deferred returns that same Deferred,
a warning will now be emitted. Deferred howto documentation has been updated.



git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38513 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge string-transport-disconnection-failure-6521

Author: adiroiban
Reviewer: therve
Fixes: #6521

Pass a Failure instead of a plain exception in
StringTransportWithDisconnection.loseConnection.


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38517 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge sslverify-no-pickle-6166: Deprecate pickling support in twisted.internet._sslverfiy.

Authore: canibanoglu
Reviewers: tom.prince
Fixes: #6166

Pickleability is no longer a goal for Twisted. As such, the
various __getstate__ and __setstate__ methods of
twisted.internet._sslverify classes can be deprecated, so we
can remove the extra code involved.

git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38519 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Revert r38517 - test suite regression

Reopens: #6166

A number of test modules now fail to import on some builders:

{{{
[ERROR]
Traceback (most recent call last):
  File "/data/home/buildbot/work/freebsd-8.2-i386/Twisted/twisted/trial/runner.py", line 500, in loadPackage
    module = modinfo.load()
  File "/data/home/buildbot/work/freebsd-8.2-i386/Twisted/twisted/python/modules.py", line 383, in load
    return self.pathEntry.pythonPath.moduleLoader(self.name)
  File "/data/home/buildbot/work/freebsd-8.2-i386/Twisted/twisted/python/_reflectpy3.py", line 266, in namedAny
    topLevelPackage = _importAndCheckStack(trialname)
  File "/data/home/buildbot/work/freebsd-8.2-i386/Twisted/twisted/python/_reflectpy3.py", line 205, in _importAndCheckStack
    return __import__(importName)
  File "/data/home/buildbot/work/freebsd-8.2-i386/Twisted/twisted/test/test_sslverify.py", line 805, in <module>
    class KeyPair(unittest.TestCase):
  File "/data/home/buildbot/work/freebsd-8.2-i386/Twisted/twisted/test/test_sslverify.py", line 808, in KeyPair
    CN=b"server")[0]
  File "/data/home/buildbot/work/freebsd-8.2-i386/Twisted/twisted/test/test_sslverify.py", line 84, in makeCertificate
    keypair = PKey()
exceptions.NameError: global name 'PKey' is not defined

twisted.test.test_sslverify
}}}



git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38527 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Raiders of the twisted ark


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38543 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Merge only-child-setuid-6443

Author: exarkun
Reviewer: tom.prince
Fixes: #6443

Avoid changing the process UID or GID when launching a child process which is to
run with a different UID or GID.


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38550 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Revert r38550 - test suite regression

New tests fail on Windows, which lacks UIDs and GIDs.

Reopens: #6443


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@38552 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb