/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/ftp_server/pyftpdlib_based.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import threading
27
27
 
28
28
 
29
 
from bzrlib import (
 
29
from breezy import (
30
30
    osutils,
31
31
    tests,
32
32
    trace,
33
33
    )
34
 
from bzrlib.tests import test_server
 
34
from breezy.tests import test_server
35
35
 
36
36
 
37
37
# Convert the pyftplib string version into a tuple to avoid traps in string
148
148
            raise AssertionError(
149
149
                "FTPServer currently assumes local transport, got %s"
150
150
                % vfs_server)
151
 
        self._root = os.getcwdu()
 
151
        self._root = osutils.getcwd()
152
152
 
153
153
        address = ('localhost', 0) # bind to a random port
154
154
        authorizer = AnonymousWithWriteAccessAuthorizer()
176
176
        self._ftpd_starting.release()
177
177
 
178
178
    def stop_server(self):
179
 
        """See bzrlib.transport.Server.stop_server."""
 
179
        """See breezy.transport.Server.stop_server."""
180
180
        # Tell the server to stop, but also close the server socket for tests
181
181
        # that start the server but never initiate a connection. Closing the
182
182
        # socket should be done first though, to avoid further connections.
197
197
        while self._ftpd_running:
198
198
            try:
199
199
                self._ftp_server.serve_forever(timeout=0.1, count=1)
200
 
            except select.error, e:
 
200
            except select.error as e:
201
201
                if e.args[0] != errno.EBADF:
202
202
                    raise
203
203
        self._ftp_server.close_all(ignore_all=True)