[Python-modules-commits] [twisted] 01/03: New upstream version 17.1.0

Free Ekanayaka freee at moszumanska.debian.org
Mon Feb 27 10:30:07 UTC 2017


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

freee pushed a commit to branch master
in repository twisted.

commit 42562276eca7256b8988f0661d57dc95f98c3a25
Author: Free Ekanayaka <freee at debian.org>
Date:   Fri Feb 17 10:31:15 2017 +0000

    New upstream version 17.1.0
---
 LICENSE                                            |   2 +-
 NEWS                                               | 202 +++++
 PKG-INFO                                           |   2 +-
 README.rst                                         |   8 +-
 docs/conch/examples/demo.tac                       |   5 +-
 docs/conch/examples/demo_draw.tac                  |  21 +-
 docs/conch/examples/demo_insults.tac               |  23 +-
 docs/conch/examples/demo_manhole.tac               |  25 +-
 docs/conch/examples/demo_recvline.tac              |  23 +-
 docs/conch/examples/demo_scroll.tac                |  25 +-
 docs/conch/examples/sshsimpleclient.py             |  14 +-
 docs/conch/examples/sshsimpleserver.py             |  20 +-
 docs/conch/examples/telnet_echo.tac                |  10 +-
 docs/conch/examples/window.tac                     |  41 +-
 docs/conch/howto/conch_client.rst                  |   4 +-
 docs/conch/man/conch.1                             |   2 +-
 docs/conf.py                                       |   2 +-
 docs/core/development/policy/release-process.rst   |  55 +-
 docs/core/examples/ftpclient.py                    |  11 +-
 docs/core/examples/stdiodemo.py                    |   3 +-
 docs/core/howto/ssl.rst                            |  50 +-
 docs/core/howto/threading.rst                      |   5 +-
 docs/fun/Twisted.Quotes                            |   1 +
 docs/historic/Quotes/Twisted-17.1                  |  25 +
 docs/web/examples/index.rst                        |   5 +-
 docs/web/howto/client.rst                          | 116 +--
 setup.cfg                                          |   1 -
 src/Twisted.egg-info/PKG-INFO                      |   2 +-
 src/Twisted.egg-info/SOURCES.txt                   |   9 +-
 src/Twisted.egg-info/requires.txt                  |   1 +
 src/twisted/_version.py                            |   2 +-
 src/twisted/application/app.py                     |  20 +-
 src/twisted/application/internet.py                | 493 +++++++++---
 src/twisted/application/runner/_exit.py            |   4 +-
 src/twisted/application/runner/_pidfile.py         | 303 ++++++++
 src/twisted/application/runner/_runner.py          |  80 +-
 src/twisted/application/runner/test/test_exit.py   |  14 +-
 .../application/runner/test/test_pidfile.py        | 476 ++++++++++++
 src/twisted/application/runner/test/test_runner.py | 216 +++---
 src/twisted/application/service.py                 |   2 +
 src/twisted/application/strports.py                |  73 +-
 src/twisted/application/test/test_internet.py      | 142 +++-
 src/twisted/application/twist/_options.py          |  29 +-
 src/twisted/application/twist/test/test_options.py |  33 +-
 src/twisted/application/twist/test/test_twist.py   |   6 +-
 src/twisted/conch/avatar.py                        |   3 +
 src/twisted/conch/checkers.py                      |   8 +-
 src/twisted/conch/client/default.py                |  25 +
 src/twisted/conch/client/knownhosts.py             |  28 +-
 src/twisted/conch/client/options.py                |  17 +-
 src/twisted/conch/endpoints.py                     |   2 +
 src/twisted/conch/insults/insults.py               |   2 +
 src/twisted/conch/insults/window.py                |  87 ++-
 src/twisted/conch/interfaces.py                    |  23 +-
 src/twisted/conch/ls.py                            |  43 +-
 src/twisted/conch/manhole.py                       |  83 +-
 src/twisted/conch/manhole_ssh.py                   |   9 +-
 src/twisted/conch/mixin.py                         |   6 +-
 src/twisted/conch/recvline.py                      |  21 +-
 src/twisted/conch/scripts/cftp.py                  |  87 ++-
 src/twisted/conch/scripts/ckeygen.py               |   4 +-
 src/twisted/conch/scripts/conch.py                 |  80 +-
 src/twisted/conch/scripts/tkconch.py               |  38 +-
 src/twisted/conch/ssh/_kex.py                      |  95 ++-
 src/twisted/conch/ssh/common.py                    |   3 +
 src/twisted/conch/ssh/factory.py                   |   8 +-
 src/twisted/conch/ssh/filetransfer.py              |   4 +-
 src/twisted/conch/ssh/forwarding.py                |  11 +
 src/twisted/conch/ssh/keys.py                      | 234 +++---
 src/twisted/conch/ssh/transport.py                 | 214 ++++-
 src/twisted/conch/stdio.py                         |   3 +
 src/twisted/conch/tap.py                           |   2 +-
 src/twisted/conch/test/test_cftp.py                | 376 +++++----
 src/twisted/conch/test/test_ckeygen.py             |   2 +-
 src/twisted/conch/test/test_conch.py               | 169 +++-
 src/twisted/conch/test/test_default.py             |  38 +
 src/twisted/conch/test/test_endpoints.py           |  28 +-
 src/twisted/conch/test/test_filetransfer.py        |  33 +-
 src/twisted/conch/test/test_forwarding.py          |  37 +-
 src/twisted/conch/test/test_keys.py                |  92 ++-
 src/twisted/conch/test/test_knownhosts.py          |  65 +-
 src/twisted/conch/test/test_manhole.py             | 272 ++++---
 src/twisted/conch/test/test_manhole_tap.py         |   6 +-
 src/twisted/conch/test/test_recvline.py            |  18 +-
 src/twisted/conch/test/test_transport.py           | 179 ++++-
 src/twisted/conch/ui/tkvt100.py                    |  11 +-
 src/twisted/conch/unix.py                          |   9 +-
 src/twisted/internet/_dumbwin32proc.py             |  33 +-
 src/twisted/internet/_idna.py                      |  54 ++
 src/twisted/internet/_producer_helpers.py          | 125 +++
 src/twisted/internet/_resolver.py                  | 264 +++++++
 src/twisted/internet/_sslverify.py                 | 374 +++++----
 src/twisted/internet/abstract.py                   |  68 +-
 src/twisted/internet/address.py                    |  15 +
 src/twisted/internet/base.py                       |  94 ++-
 src/twisted/internet/defer.py                      |   2 +
 src/twisted/internet/endpoints.py                  | 240 +++---
 src/twisted/internet/interfaces.py                 | 274 +++++--
 src/twisted/internet/process.py                    |  55 +-
 src/twisted/internet/ssl.py                        |   3 +-
 src/twisted/internet/tcp.py                        |  33 +-
 src/twisted/internet/test/test_abstract.py         |  11 +
 src/twisted/internet/test/test_endpoints.py        | 398 ++++++----
 src/twisted/internet/test/test_newtls.py           |   5 +-
 src/twisted/internet/test/test_process.py          |   5 +-
 src/twisted/internet/test/test_resolver.py         | 590 ++++++++++++++
 src/twisted/internet/test/test_tls.py              |   7 +-
 src/twisted/internet/test/test_unix.py             |  63 +-
 src/twisted/internet/tksupport.py                  |  10 +-
 src/twisted/internet/unix.py                       |  10 +-
 src/twisted/logger/_flatten.py                     |   2 +-
 src/twisted/logger/_json.py                        |  10 +-
 src/twisted/logger/test/test_flatten.py            |  17 +
 src/twisted/mail/tap.py                            |  85 +-
 src/twisted/mail/test/server.pem                   |  36 -
 src/twisted/mail/test/test_options.py              |  46 --
 src/twisted/names/authority.py                     | 299 ++++---
 src/twisted/names/client.py                        |  11 +-
 src/twisted/names/test/test_client.py              |  26 +-
 src/twisted/names/test/test_names.py               | 164 +++-
 src/twisted/plugins/twisted_reactors.py            |  93 ++-
 src/twisted/positioning/test/test_nmea.py          |   2 +-
 src/twisted/protocols/ftp.py                       |  73 +-
 src/twisted/protocols/telnet.py                    | 322 --------
 src/twisted/protocols/test/test_tls.py             |  45 +-
 src/twisted/protocols/tls.py                       | 102 +--
 src/twisted/python/_oldstyle.py                    |  34 +-
 src/twisted/python/_pydoctor.py                    |  21 +-
 src/twisted/python/_sendmsg.c                      |  10 +-
 src/twisted/python/_setup.py                       |  50 +-
 src/twisted/python/compat.py                       |  57 +-
 src/twisted/python/components.py                   |  21 +-
 src/twisted/python/context.py                      |   4 +
 src/twisted/python/failure.py                      |   8 +-
 src/twisted/python/formmethod.py                   |  24 +-
 src/twisted/python/htmlizer.py                     |  73 +-
 src/twisted/python/logfile.py                      |   3 +
 src/twisted/python/rebuild.py                      |   3 +-
 src/twisted/python/reflect.py                      |   3 +
 src/twisted/python/roots.py                        |   9 +
 src/twisted/python/runtime.py                      |   3 +
 src/twisted/python/syslog.py                       |   2 +
 src/twisted/python/test/modules_helpers.py         |   2 +-
 src/twisted/python/test/test_components.py         |  82 +-
 src/twisted/python/test/test_fakepwd.py            |   5 +-
 src/twisted/python/test/test_htmlizer.py           |  19 +-
 src/twisted/python/test/test_release.py            |  92 ++-
 src/twisted/python/test/test_sendmsg.py            |  16 +
 src/twisted/python/test/test_zipstream.py          |   2 +-
 src/twisted/python/threadpool.py                   |   5 +-
 src/twisted/python/util.py                         |  40 +-
 src/twisted/runner/procmon.py                      |  12 +-
 src/twisted/runner/test/test_procmon.py            |  72 ++
 src/twisted/scripts/htmlizer.py                    |  16 +-
 src/twisted/scripts/test/test_scripts.py           |   2 +-
 src/twisted/spread/pb.py                           | 387 ++++++++--
 src/twisted/spread/test/test_pbfailure.py          |  56 +-
 src/twisted/test/proto_helpers.py                  |  57 +-
 src/twisted/test/test_abstract.py                  |  30 +
 src/twisted/test/test_application.py               |  78 ++
 src/twisted/test/test_compat.py                    |  10 +-
 src/twisted/test/test_defer.py                     |  21 +
 src/twisted/test/test_failure.py                   |  19 +-
 src/twisted/test/test_ftp.py                       | 858 ++++++++++++++-------
 src/twisted/test/test_ftp_options.py               |   4 +-
 src/twisted/test/test_iutils.py                    |   3 -
 src/twisted/test/test_nooldstyle.py                |  10 +
 src/twisted/test/test_process.py                   | 101 +--
 src/twisted/test/test_ssl.py                       |  14 +-
 src/twisted/test/test_sslverify.py                 | 750 +++++++++++-------
 src/twisted/test/test_stringtransport.py           |  92 ++-
 src/twisted/test/test_strports.py                  |  91 +--
 src/twisted/test/test_twistd.py                    |   1 +
 src/twisted/trial/_asyncrunner.py                  |   2 +
 src/twisted/trial/_dist/disttrial.py               |   2 +-
 src/twisted/trial/_dist/managercommands.py         |  34 +-
 src/twisted/trial/_dist/test/test_distreporter.py  |   3 +-
 src/twisted/trial/_dist/test/test_disttrial.py     |   8 +-
 src/twisted/trial/_dist/test/test_worker.py        |  41 +-
 src/twisted/trial/_dist/test/test_workertrial.py   |   7 +-
 src/twisted/trial/_dist/worker.py                  |  12 +-
 src/twisted/trial/_dist/workercommands.py          |   8 +-
 src/twisted/trial/_dist/workerreporter.py          |  52 +-
 src/twisted/trial/_dist/workertrial.py             |   6 +-
 src/twisted/trial/_synctest.py                     |  30 +-
 src/twisted/trial/reporter.py                      |  22 +
 src/twisted/trial/test/suppression.py              |   8 +-
 src/twisted/trial/test/test_reporter.py            |   8 +-
 src/twisted/trial/test/test_runner.py              |   2 +-
 src/twisted/trial/test/test_script.py              |  19 +-
 src/twisted/trial/test/test_tests.py               |   2 +-
 src/twisted/trial/test/test_warning.py             |   7 +-
 src/twisted/trial/util.py                          |   2 +
 src/twisted/web/_http2.py                          |  31 +-
 src/twisted/web/_newclient.py                      |  41 +-
 src/twisted/web/client.py                          |  55 +-
 src/twisted/web/error.py                           |   4 +
 src/twisted/web/http.py                            | 190 ++++-
 src/twisted/web/http_headers.py                    |  11 +-
 src/twisted/web/test/test_agent.py                 | 321 +++++---
 src/twisted/web/test/test_cgi.py                   | 102 ++-
 src/twisted/web/test/test_distrib.py               |  21 +-
 src/twisted/web/test/test_error.py                 |  18 +
 src/twisted/web/test/test_http.py                  | 389 +++++++++-
 src/twisted/web/test/test_http2.py                 | 393 ++++------
 src/twisted/web/test/test_http_headers.py          |  34 +-
 src/twisted/web/test/test_newclient.py             |  47 +-
 src/twisted/web/test/test_tap.py                   |   3 +-
 src/twisted/web/test/test_webclient.py             | 116 ++-
 src/twisted/web/test/test_xmlrpc.py                |  20 +-
 tox.ini                                            |  12 +-
 211 files changed, 10282 insertions(+), 4220 deletions(-)

diff --git a/LICENSE b/LICENSE
index 255b2da..cd41c4f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2001-2016
+Copyright (c) 2001-2017
 Allen Short
 Amber Hawkie Brown
 Andrew Bennetts
diff --git a/NEWS b/NEWS
index 4768aac..37bc851 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,208 @@
 Ticket numbers in this file can be looked up by visiting
 http://twistedmatrix.com/trac/ticket/<number>
 
+Twisted Core 17.1.0 (2017-02-04)
+================================
+
+Features
+--------
+ - Added a new interface,
+   twisted.internet.interfaces.IHostnameResolver, which is an
+   improvement to twisted.internet.interfaces.IResolverSimple that
+   supports resolving multiple addresses as well as resolving IPv6
+   addresses.  This is a native, asynchronous, Twisted analogue to
+   getaddrinfo. (#4362)
+ - twisted.web.client.Agent now uses HostnameEndpoint internally; as a
+   consequence, it now supports IPv6, as well as making connections
+   faster and more reliably to hosts that have more than one DNS name.
+   (#6712)
+ - twisted.internet.ssl.CertificateOptions now has the new constructor
+   argument 'raiseMinimumTo', allowing you to increase the minimum TLS
+   version to this version or Twisted's default, whichever is higher.
+   The additional new constructor arguments 'lowerMaximumSecurityTo'
+   and 'insecurelyLowerMinimumTo' allow finer grained control over
+   negotiated versions that don't honour Twisted's defaults, for
+   working around broken peers, at the cost of reducing the security
+   of the TLS it will negotiate. (#6800)
+ - twisted.internet.ssl.CertificateOptions now sets the OpenSSL
+   context's mode to MODE_RELEASE_BUFFERS, which will free the
+   read/write buffers on idle TLS connections to save memory. (#8247)
+ - trial --help-reactors will only list reactors which can be
+   imported.  (#8745)
+ - twisted.internet.endpoints.HostnameEndpoint now uses the passed
+   reactor's implementation of
+   twisted.internet.interfaces.IReactorPluggableResolver to resolve
+   hostnames rather than its own deferToThread/getaddrinfo wrapper;
+   this makes its hostname resolution pluggable via a public API.
+   (#8922)
+ - twisted.internet.reactor.spawnProcess now does not emit a
+   deprecation warning on Unicode arguments. It will encode Unicode
+   arguments down to bytes using the filesystem encoding on UNIX and
+   Python 2 on Windows, and pass Unicode through unchanged on Python 3
+   on Windows. (#8941)
+ - twisted.trial._dist.test.test_distreporter now works on Python 3.
+   (#8943)
+
+Bugfixes
+--------
+ - trial --help-reactors will now display iocp and win32er reactors
+   with Python 3. (#8745)
+ - twisted.logger._flatten.flattenEvent now handles log_format being
+   None instead of assuming the value is always a string. (#8860)
+ - twisted.protocol.ftp is now Python 3 compatible (#8865)
+ - twisted.names.client.Resolver can now resolve names with IPv6 DNS
+   servers. (#8877)
+ - twisted.application.internet.ClientService now waits for existing
+   connections to disconnect before trying to connect again when
+   restarting. (#8899)
+ - twisted.internet.unix.Server.doRead and
+   twisted.internet.unix.Client.doRead no longer fail if recvmsg's
+   ancilliary data contains more than one file descriptor. (#8911)
+ - twist on Python 3 now correctly prints the help text when given no
+   plugin to run. (#8918)
+ - twisted.python.sendmsg.sendmsg no longer segfaults on Linux +
+   Python 2. (#8969)
+ - IHandshakeListener providers connected via SSL4ClientEndpoint will
+   now have their handshakeCompleted methods called. (#8973)
+ - The twist script now respects the --reactor option. (#8983)
+ - Fix crash when using SynchronousTestCase with Warning object which
+   does not store a string as its first argument (like
+   libmysqlclient). (#9005)
+ - twisted.python.compat.execfile() does not open files with the
+   deprecated 'U' flag on Python 3. (#9012)
+
+Deprecations and Removals
+-------------------------
+ - twisted.internet.ssl.CertificateOption's 'method' constructor
+   argument is now deprecated, in favour of the new 'raiseMinimumTo',
+   'lowerMaximumSecurityTo', and 'insecurelyLowerMinimumTo' arguments.
+   (#6800)
+ - twisted.protocols.telnet (not to be confused with the supported
+   twisted.conch.telnet), deprecated since Twisted 2.5, has been
+   removed. (#8925)
+ - twisted.application.strports.parse, as well as the deprecated
+   default arguments in strports.service/listen, deprecated since
+   Twisted 10.2, has been removed. (#8926)
+ - twisted.web.client.getPage and twisted.web.client.downloadPage have
+   been deprecated in favour of https://pypi.org/project/treq and
+   twisted.web.client.Agent. (#8960)
+ - twisted.internet.defer.timeout is deprecated in favor of
+   twisted.internet.defer.Deferred.addTimeout (#8971)
+
+Other
+-----
+ - #7879, #8583, #8764, #8809, #8859, #8906, #8910, #8913, #8916,
+   #8934, #8945, #8949, #8950, #8952, #8953, #8959, #8962, #8963,
+   #8967, #8975, #8976, #8993, #9013
+
+
+Twisted Conch 17.1.0 (2017-02-04)
+=================================
+
+Features
+--------
+ - twisted.conch.manhole now works on Python 3. (#8327)
+ - Twisted Conch now supports ECDH key exchanges. (#8730)
+ - Add support in twisted.conch.ssh for hmac-sha2-384 (#8784)
+ - conch and cftp scripts now work on Python 3. (#8791)
+ - twisted.conch.ssh supports ECDH key exchange. (#8811)
+
+Bugfixes
+--------
+ - twisted.conch.ssh.keys.Key.fromString now supports OpenSSL private
+   keys with Windows line endings (\r\n) again (broken since 16.6.0).
+   (#8928)
+
+Improved Documentation
+----------------------
+ - The documentation for
+   twisted.conch.endpoints.SSHCommandClientEndpoint.existingConnection
+   now describes where the value for the connection parameter might
+   come from. (#8892)
+
+Other
+-----
+ - #8890, #8894, #8957, #8958, #8968
+
+
+Twisted Mail 17.1.0 (2017-02-04)
+================================
+
+Deprecations and Removals
+-------------------------
+ - twisted.mail.tap (the twist plugin for mail) no longer accepts the
+   --pop3s option or implicit port numbers to --pop3 and --smtp. This
+   functionality has been deprecated since 11.0. (#8920)
+
+
+Twisted Names 17.1.0 (2017-02-04)
+=================================
+
+Bugfixes
+--------
+ - twisted.names.authority.BindAuthority has been ported to Python 3.
+   (#8880)
+
+
+Twisted News 17.1.0 (2017-02-04)
+================================
+
+No significant changes have been made for this release.
+
+
+Twisted Pair 17.1.0 (2017-02-04)
+================================
+
+No significant changes have been made for this release.
+
+
+Twisted Runner 17.1.0 (2017-02-04)
+==================================
+
+Bugfixes
+--------
+ - On Python 3, procmon now handles process output without exceptions
+   (#8919)
+
+
+Twisted Web 17.1.0 (2017-02-04)
+===============================
+
+Features
+--------
+ - twisted.web.client.Agent now sets ``Content-Length: 0`` for PUT and
+   POST requests made without a body producer. (#8984)
+
+Bugfixes
+--------
+ - twisted.web.http.HTTPFactory now times connections out after one
+   minute of no data from the client being received, before the
+   request is complete, rather than twelve hours. (#3746)
+ - twisted.web.http.HTTPChannel, the server class for Twisted's
+   HTTP/1.1 server, now exerts backpressure against clients that do
+   not read responses. This means that if a client stops reading from
+   a socket for long enough, Twisted will stop reading further
+   requests from that client until it consumes some responses. (#8868)
+ - twisted.web.http_headers.Headers.getRawHeaders no longer attempts
+   to decode the default value when called with a unicode header name.
+   (#8974)
+ - twisted.web.http.HTTPChannel is less likely to leak file
+   descriptors when timing out clients using HTTPS connections. In
+   some cases it is still possible to leak a file descriptor when
+   timing out HTTP clients: further patches will address this issue.
+   (#8992)
+
+Other
+-----
+ - #7744, #8909, #8935
+
+
+Twisted Words 17.1.0 (2017-02-04)
+=================================
+
+No significant changes have been made for this release.
+
+
 Twisted Core 16.6.0 (2016-11-17)
 ================================
 
diff --git a/PKG-INFO b/PKG-INFO
index 63044e3..53a86c1 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: Twisted
-Version: 16.6.0
+Version: 17.1.0
 Summary: An asynchronous networking framework written in Python
 Home-page: http://twistedmatrix.com/
 Author: Glyph Lefkowitz
diff --git a/README.rst b/README.rst
index e957b93..074ec67 100644
--- a/README.rst
+++ b/README.rst
@@ -1,4 +1,4 @@
-Twisted 16.6.0
+Twisted 17.1.0
 ==============
 
 |pypi|
@@ -8,9 +8,9 @@ Twisted 16.6.0
 
 .. code::
 
-    <derwolfe> Twisted - thank you for continuing to be fun to use and relatively easy to test 😃
+    <hawkowl> we have always been at war with 16.7
 
-For information on what's new in Twisted 16.6.0, see the `NEWS <NEWS>`_ file that comes with the distribution.
+For information on what's new in Twisted 17.1.0, see the `NEWS <NEWS>`_ file that comes with the distribution.
 
 
 What is this?
@@ -77,7 +77,7 @@ Some of these tests may fail if you:
 Copyright
 ---------
 
-All of the code in this distribution is Copyright (c) 2001-2016 Twisted Matrix Laboratories.
+All of the code in this distribution is Copyright (c) 2001-2017 Twisted Matrix Laboratories.
 
 Twisted is made available under the MIT license.
 The included `LICENSE <LICENSE>`_ file describes this in detail.
diff --git a/docs/conch/examples/demo.tac b/docs/conch/examples/demo.tac
index 8eb492c..a650a63 100644
--- a/docs/conch/examples/demo.tac
+++ b/docs/conch/examples/demo.tac
@@ -22,4 +22,7 @@ from twisted.conch import manhole_tap
 manhole_tap.makeService({"telnetPort": "tcp:6023",
                          "sshPort": "tcp:6022",
                          "namespace": {"foo": "bar"},
-                         "passwd": "passwd"}).setServiceParent(application)
+                         "passwd": "passwd",
+                         "sshKeyDir": "<USER DATA DIR>",
+                         "sshKeyName": "server.key",
+                         "sshKeySize": 4096}).setServiceParent(application)
diff --git a/docs/conch/examples/demo_draw.tac b/docs/conch/examples/demo_draw.tac
index d80b064..61e8f71 100644
--- a/docs/conch/examples/demo_draw.tac
+++ b/docs/conch/examples/demo_draw.tac
@@ -3,21 +3,30 @@
 
 # You can run this .tac file directly with:
 #    twistd -ny demo_draw.tac
+#
+# Re-using a private key is dangerous, generate one.
+#
+# For this example you can use:
+#
+# $ ckeygen -t rsa -f ssh-keys/ssh_host_rsa_key
 
-"""A trivial drawing application.
+"""
+A trivial drawing application.
 
 Clients are allowed to connect and spew various characters out over
 the terminal.  Spacebar changes the drawing character, while the arrow
 keys move the cursor.
 """
 
+from twisted.application import internet, service
 from twisted.conch.insults import insults
 from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
 from twisted.conch.manhole_ssh import ConchFactory, TerminalRealm
-
-from twisted.internet import protocol
-from twisted.application import internet, service
+from twisted.conch.ssh import keys
 from twisted.cred import checkers, portal
+from twisted.internet import protocol
+
+
 
 class Draw(insults.TerminalProtocol):
     """Protocol which accepts arrow key and spacebar input and places
@@ -47,7 +56,7 @@ class Draw(insults.TerminalProtocol):
         self.terminal.cursorBackward()
 
 def makeService(args):
-    checker = checkers.InMemoryUsernamePasswordDatabaseDontUse(username="password")
+    checker = checkers.InMemoryUsernamePasswordDatabaseDontUse(username=b"password")
 
     f = protocol.ServerFactory()
     f.protocol = lambda: TelnetTransport(TelnetBootstrapProtocol,
@@ -67,6 +76,8 @@ def makeService(args):
     rlm.chainedProtocolFactory = chainProtocolFactory
     ptl = portal.Portal(rlm, [checker])
     f = ConchFactory(ptl)
+    f.publicKeys[b"ssh-rsa"] = keys.Key.fromFile("ssh-keys/ssh_host_rsa_key.pub")
+    f.privateKeys[b"ssh-rsa"] = keys.Key.fromFile("ssh-keys/ssh_host_rsa_key")
     csvc = internet.TCPServer(args['ssh'], f)
 
     m = service.MultiService()
diff --git a/docs/conch/examples/demo_insults.tac b/docs/conch/examples/demo_insults.tac
index ebb01c5..0626653 100644
--- a/docs/conch/examples/demo_insults.tac
+++ b/docs/conch/examples/demo_insults.tac
@@ -3,8 +3,15 @@
 
 # You can run this .tac file directly with:
 #    twistd -ny demo_insults.tac
+#
+# Re-using a private key is dangerous, generate one.
+#
+# For this example you can use:
+#
+# $ ckeygen -t rsa -f ssh-keys/ssh_host_rsa_key
 
-"""Various simple terminal manipulations using the insults module.
+"""
+Various simple terminal manipulations using the insults module.
 
 This demo sets up two listening ports: one on 6022 which accepts ssh
 connections; one on 6023 which accepts telnet connections.  No login
@@ -21,14 +28,16 @@ animation process.
 
 import random, string
 
-from twisted.python import log
-from twisted.internet import protocol, task
 from twisted.application import internet, service
-from twisted.cred import checkers, portal
-
 from twisted.conch.insults import insults
 from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
 from twisted.conch.manhole_ssh import ConchFactory, TerminalRealm
+from twisted.conch.ssh import keys
+from twisted.cred import checkers, portal
+from twisted.internet import protocol, task
+from twisted.python import log
+
+
 
 class DrawingFinished(Exception):
     """Sentinel exception, raised when no \"frames\" for a particular
@@ -218,7 +227,7 @@ class DemoProtocol(insults.TerminalProtocol):
 
 
 def makeService(args):
-    checker = checkers.InMemoryUsernamePasswordDatabaseDontUse(username="password")
+    checker = checkers.InMemoryUsernamePasswordDatabaseDontUse(username=b"password")
 
     f = protocol.ServerFactory()
     f.protocol = lambda: TelnetTransport(TelnetBootstrapProtocol,
@@ -238,6 +247,8 @@ def makeService(args):
     rlm.chainedProtocolFactory = chainProtocolFactory
     ptl = portal.Portal(rlm, [checker])
     f = ConchFactory(ptl)
+    f.publicKeys[b"ssh-rsa"] = keys.Key.fromFile("ssh-keys/ssh_host_rsa_key.pub")
+    f.privateKeys[b"ssh-rsa"] = keys.Key.fromFile("ssh-keys/ssh_host_rsa_key")
     csvc = internet.TCPServer(args['ssh'], f)
 
     m = service.MultiService()
diff --git a/docs/conch/examples/demo_manhole.tac b/docs/conch/examples/demo_manhole.tac
index 11808c6..6edf1c9 100644
--- a/docs/conch/examples/demo_manhole.tac
+++ b/docs/conch/examples/demo_manhole.tac
@@ -3,25 +3,34 @@
 
 # You can run this .tac file directly with:
 #    twistd -ny demo_manhole.tac
+#
+# Re-using a private key is dangerous, generate one.
+#
+# For this example you can use:
+#
+# $ ckeygen -t rsa -f ssh-keys/ssh_host_rsa_key
 
-"""An interactive Python interpreter with syntax coloring.
+"""
+An interactive Python interpreter with syntax coloring.
 
 Nothing interesting is actually defined here.  Two listening ports are
 set up and attached to protocols which know how to properly set up a
 ColoredManhole instance.
 """
 
-from twisted.conch.manhole import ColoredManhole
+from twisted.application import internet, service
 from twisted.conch.insults import insults
-from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
+from twisted.conch.manhole import ColoredManhole
 from twisted.conch.manhole_ssh import ConchFactory, TerminalRealm
-
-from twisted.internet import protocol
-from twisted.application import internet, service
+from twisted.conch.ssh import keys
+from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
 from twisted.cred import checkers, portal
+from twisted.internet import protocol
+
+
 
 def makeService(args):
-    checker = checkers.InMemoryUsernamePasswordDatabaseDontUse(username="password")
+    checker = checkers.InMemoryUsernamePasswordDatabaseDontUse(username=b"password")
 
     f = protocol.ServerFactory()
     f.protocol = lambda: TelnetTransport(TelnetBootstrapProtocol,
@@ -41,6 +50,8 @@ def makeService(args):
     rlm.chainedProtocolFactory = chainProtocolFactory
     ptl = portal.Portal(rlm, [checker])
     f = ConchFactory(ptl)
+    f.publicKeys[b"ssh-rsa"] = keys.Key.fromFile("ssh-keys/ssh_host_rsa_key.pub")
+    f.privateKeys[b"ssh-rsa"] = keys.Key.fromFile("ssh-keys/ssh_host_rsa_key")
     csvc = internet.TCPServer(args['ssh'], f)
 
     m = service.MultiService()
diff --git a/docs/conch/examples/demo_recvline.tac b/docs/conch/examples/demo_recvline.tac
index 17ec78b..aa44f4a 100644
--- a/docs/conch/examples/demo_recvline.tac
+++ b/docs/conch/examples/demo_recvline.tac
@@ -3,8 +3,15 @@
 
 # You can run this .tac file directly with:
 #    twistd -ny demo_recvline.tac
+#
+# Re-using a private key is dangerous, generate one.
+#
+# For this example you can use:
+#
+# $ ckeygen -t rsa -f ssh-keys/ssh_host_rsa_key
 
-"""Demonstrates line-at-a-time handling with basic line-editing support.
+"""
+Demonstrates line-at-a-time handling with basic line-editing support.
 
 This is a variation on the echo server.  It sets up two listening
 ports: one on 6022 which accepts ssh connections; one on 6023 which
@@ -18,14 +25,16 @@ HistoricRecvline, which the demo protocol subclasses, provides basic
 line editing and input history features.
 """
 
+from twisted.application import internet, service
 from twisted.conch import recvline
 from twisted.conch.insults import insults
-from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
 from twisted.conch.manhole_ssh import ConchFactory, TerminalRealm
-
-from twisted.internet import protocol
-from twisted.application import internet, service
+from twisted.conch.ssh import keys
+from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
 from twisted.cred import checkers, portal
+from twisted.internet import protocol
+
+
 
 class DemoRecvLine(recvline.HistoricRecvLine):
     """Simple echo protocol.
@@ -43,7 +52,7 @@ class DemoRecvLine(recvline.HistoricRecvLine):
         self.terminal.write(self.ps[self.pn])
 
 def makeService(args):
-    checker = checkers.InMemoryUsernamePasswordDatabaseDontUse(username="password")
+    checker = checkers.InMemoryUsernamePasswordDatabaseDontUse(username=b"password")
 
     f = protocol.ServerFactory()
     f.protocol = lambda: TelnetTransport(TelnetBootstrapProtocol,
@@ -63,6 +72,8 @@ def makeService(args):
     rlm.chainedProtocolFactory = chainProtocolFactory
     ptl = portal.Portal(rlm, [checker])
     f = ConchFactory(ptl)
+    f.publicKeys[b"ssh-rsa"] = keys.Key.fromFile("ssh-keys/ssh_host_rsa_key.pub")
+    f.privateKeys[b"ssh-rsa"] = keys.Key.fromFile("ssh-keys/ssh_host_rsa_key")
     csvc = internet.TCPServer(args['ssh'], f)
 
     m = service.MultiService()
diff --git a/docs/conch/examples/demo_scroll.tac b/docs/conch/examples/demo_scroll.tac
index 3e63c09..9ac917d 100644
--- a/docs/conch/examples/demo_scroll.tac
+++ b/docs/conch/examples/demo_scroll.tac
@@ -3,8 +3,15 @@
 
 # You can run this .tac file directly with:
 #    twistd -ny demo_scroll.tac
+#
+# Re-using a private key is dangerous, generate one.
+#
+# For this example you can use:
+#
+# $ ckeygen -t rsa -f ssh-keys/ssh_host_rsa_key
 
-"""Simple echo-ish server that uses the scroll-region.
+"""
+Simple echo-ish server that uses the scroll-region.
 
 This demo sets up two listening ports: one on 6022 which accepts ssh
 connections; one on 6023 which accepts telnet connections.  No login
@@ -20,14 +27,16 @@ clears the input line.
 
 import string
 
-from twisted.python import log
-from twisted.internet import protocol
 from twisted.application import internet, service
-from twisted.cred import checkers, portal
-
 from twisted.conch.insults import insults
-from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
 from twisted.conch.manhole_ssh import ConchFactory, TerminalRealm
+from twisted.conch.ssh import keys
+from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
+from twisted.cred import checkers, portal
+from twisted.internet import protocol
+from twisted.python import log
+
+
 
 class DemoProtocol(insults.TerminalProtocol):
     """Copies input to an upwards scrolling region.
@@ -66,7 +75,7 @@ class DemoProtocol(insults.TerminalProtocol):
 
 
 def makeService(args):
-    checker = checkers.InMemoryUsernamePasswordDatabaseDontUse(username="password")
+    checker = checkers.InMemoryUsernamePasswordDatabaseDontUse(username=b"password")
 
     f = protocol.ServerFactory()
     f.protocol = lambda: TelnetTransport(TelnetBootstrapProtocol,
@@ -86,6 +95,8 @@ def makeService(args):
     rlm.chainedProtocolFactory = chainProtocolFactory
     ptl = portal.Portal(rlm, [checker])
     f = ConchFactory(ptl)
+    f.publicKeys[b"ssh-rsa"] = keys.Key.fromFile("ssh-keys/ssh_host_rsa_key.pub")
+    f.privateKeys[b"ssh-rsa"] = keys.Key.fromFile("ssh-keys/ssh_host_rsa_key")
     csvc = internet.TCPServer(args['ssh'], f)
 
     m = service.MultiService()
diff --git a/docs/conch/examples/sshsimpleclient.py b/docs/conch/examples/sshsimpleclient.py
index aa31340..c62a69a 100644
--- a/docs/conch/examples/sshsimpleclient.py
+++ b/docs/conch/examples/sshsimpleclient.py
@@ -22,10 +22,10 @@ $ ckeygen -t rsa -f ssh-keys/client_rsa
 
 # Replace this with your username.
 # Default username and password will match the sshsimpleserver.py
-USER = 'user'
+USER = b'user'
 HOST = 'localhost'
 PORT = 5022
-SERVER_FINGERPRINT = 'pu:t:se:rv:er:fi:ng:er:pr:in:t:he:re'
+SERVER_FINGERPRINT = b'55:55:66:24:6b:03:0e:f1:ec:f8:66:c3:51:df:27:4b'
 
 # Path to RSA SSH keys accepted by the server.
 CLIENT_RSA_PUBLIC = 'ssh-keys/client_rsa.pub'
@@ -94,7 +94,7 @@ class SimpleConnection(connection.SSHConnection):
 
 
 class TrueChannel(channel.SSHChannel):
-    name = 'session' # needed for commands
+    name = b'session' # needed for commands
 
     def openFailed(self, reason):
         print('true failed', reason)
@@ -108,7 +108,7 @@ class TrueChannel(channel.SSHChannel):
         self.loseConnection()
 
 class FalseChannel(channel.SSHChannel):
-    name = 'session'
+    name = b'session'
 
     def openFailed(self, reason):
         print('false failed', reason)
@@ -122,18 +122,18 @@ class FalseChannel(channel.SSHChannel):
         self.loseConnection()
 
 class CatChannel(channel.SSHChannel):
-    name = 'session'
+    name = b'session'
 
     def openFailed(self, reason):
         print('echo failed', reason)
 
     def channelOpen(self, ignoredData):
-        self.data = ''
+        self.data = b''
         d = self.conn.sendRequest(self, 'exec', common.NS('cat'), wantReply = 1)
         d.addCallback(self._cbRequest)
 
     def _cbRequest(self, ignored):
-        self.write('hello conch\n')
+        self.write(b'hello conch\n')
         self.conn.sendEOF(self)
 
     def dataReceived(self, data):
diff --git a/docs/conch/examples/sshsimpleserver.py b/docs/conch/examples/sshsimpleserver.py
index 31f6109..1212db1 100755
--- a/docs/conch/examples/sshsimpleserver.py
+++ b/docs/conch/examples/sshsimpleserver.py
@@ -99,7 +99,7 @@ class ExampleAvatar(avatar.ConchUser):
     def __init__(self, username):
         avatar.ConchUser.__init__(self)
         self.username = username
-        self.channelLookup.update({'session':session.SSHSession})
+        self.channelLookup.update({b'session':session.SSHSession})
 
 
 
@@ -130,9 +130,9 @@ class EchoProtocol(protocol.Protocol):
         Just echo the received data and and if Ctrl+C is received, close the
         session.
         """
-        if data == '\r':
-            data = '\r\n'
-        elif data == '\x03': #^C
+        if data == b'\r':
+            data = b'\r\n'
+        elif data == b'\x03': #^C
             self.transport.loseConnection()
             return
         self.transport.write(data)
@@ -206,15 +206,15 @@ class ExampleFactory(factory.SSHFactory):
     # To simplify the example this server is defined only with a host key of
     # type RSA.
     publicKeys = {
-        'ssh-rsa': keys.Key.fromFile(SERVER_RSA_PUBLIC)
+        b'ssh-rsa': keys.Key.fromFile(SERVER_RSA_PUBLIC)
     }
     privateKeys = {
-        'ssh-rsa': keys.Key.fromFile(SERVER_RSA_PRIVATE)
+        b'ssh-rsa': keys.Key.fromFile(SERVER_RSA_PRIVATE)
     }
     # Service handlers.
     services = {
-        'ssh-userauth': userauth.SSHUserAuthServer,
-        'ssh-connection': connection.SSHConnection
+        b'ssh-userauth': userauth.SSHUserAuthServer,
+        b'ssh-connection': connection.SSHConnection
     }
 
     def getPrimes(self):
@@ -226,9 +226,9 @@ class ExampleFactory(factory.SSHFactory):
 
 portal = portal.Portal(ExampleRealm())
 passwdDB = InMemoryUsernamePasswordDatabaseDontUse()
-passwdDB.addUser('user', 'password')
+passwdDB.addUser(b'user', b'password')
 sshDB = SSHPublicKeyChecker(InMemorySSHKeyDB(
-    {'user': [keys.Key.fromFile(CLIENT_RSA_PUBLIC)]}))
+    {b'user': [keys.Key.fromFile(CLIENT_RSA_PUBLIC)]}))
 portal.registerChecker(passwdDB)
 portal.registerChecker(sshDB)
 ExampleFactory.portal = portal
diff --git a/docs/conch/examples/telnet_echo.tac b/docs/conch/examples/telnet_echo.tac
index daa5b38..f765663 100644
--- a/docs/conch/examples/telnet_echo.tac
+++ b/docs/conch/examples/telnet_echo.tac
@@ -18,25 +18,25 @@ from twisted.application.service import Application
 
 class TelnetEcho(TelnetProtocol):
     def enableRemote(self, option):
-        self.transport.write("You tried to enable %r (I rejected it)\r\n" % (option,))
+        self.transport.write(b"You tried to enable " + option + b" (I rejected it)\r\n")
         return False
 
 
     def disableRemote(self, option):
-        self.transport.write("You disabled %r\r\n" % (option,))
+        self.transport.write(b"You disabled " + option + b"\r\n")
 
 
     def enableLocal(self, option):
-        self.transport.write("You tried to make me enable %r (I rejected it)\r\n" % (option,))
+        self.transport.write(b"You tried to make me enable " + option + b" (I rejected it)\r\n" % (option,))
         return False
 
 
     def disableLocal(self, option):
-        self.transport.write("You asked me to disable %r\r\n" % (option,))
+        self.transport.write(b"You asked me to disable " + option + "\r\n")
 
 
     def dataReceived(self, data):
-        self.transport.write("I received %r from you\r\n" % (data,))
+        self.transport.write(b"I received "+ data + b" from you\r\n")
 
 
 factory = ServerFactory()
diff --git a/docs/conch/examples/window.tac b/docs/conch/examples/window.tac
index 5946a48..78a2955 100644
--- a/docs/conch/examples/window.tac
+++ b/docs/conch/examples/window.tac
@@ -1,6 +1,15 @@
 # Copyright (c) Twisted Matrix Laboratories.
 # See LICENSE for details.
 
+# You can run this .tac file directly with:
+#    twistd -ny window.tac
+#
+# Re-using a private key is dangerous, generate one.
+#
+# For this example you can use:
+#
+# $ ckeygen -t rsa -f ssh-keys/ssh_host_rsa_key
+
 """
 Widgets demo.
 
@@ -20,16 +29,17 @@ from __future__ import division
 
 import string, random
 
-from twisted.python import log
-from twisted.internet import protocol, task
 from twisted.application import internet, service
-from twisted.cred import checkers, portal
 
 from twisted.conch.insults import insults, window
-from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
 from twisted.conch.manhole_ssh import ConchFactory, TerminalRealm
+from twisted.conch.ssh import keys
+from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
+from twisted.cred import checkers, portal
+from twisted.internet import protocol, reactor, task
+from twisted.python import log
+
 
-from twisted.internet import reactor
 
 class DrawableCanvas(window.Canvas):
     x = 0
@@ -57,7 +67,7 @@ class DrawableCanvas(window.Canvas):
         self.repaint()
 
     def keystrokeReceived(self, keyID, modifier):
-        if keyID == '\r' or keyID == '\v':
+        if keyID == b'\r' or keyID == b'\v':
             return
         window.Canvas.keystrokeReceived(self, keyID, modifier)
         if self.x >= self.width:
@@ -75,7 +85,8 @@ class DrawableCanvas(window.Canvas):
         window.Canvas.render(self, width, height, terminal)
         if self.focused:
             terminal.cursorPosition(self.x, self.y)
-            window.cursor(terminal, self[self.x, self.y])
+            ch = chr(self[self.x, self.y])
+            window.cursor(terminal, ch)
... 25733 lines suppressed ...

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



More information about the Python-modules-commits mailing list