Ticket #2735 defect closed fixed

Opened 7 years ago

Last modified 6 years ago

twisted.vfs.adapters.ftp._FileToConsumerAdapter doesn't fully implement IConsumer

Reported by: therve Owned by:
Priority: normal Milestone:
Component: vfs Keywords:
Cc: Branch:
Author: Launchpad Bug:


_FileToConsumerAdapter pretends to implement IConsumer, but doesn't define registerProducer and unregisterProducer.

I don't see how this could ever work. Maybe it didn't?

Change History


Changed 7 years ago by KyleJ

This worked for me:

class _FileToConsumerAdapter:

    producer = None
    producerIsStreaming = None

    def __init__(self, original):
        self.original = original
        self.offset = 0

    def write(self, bytes):
        self.original.writeChunk(self.offset, bytes)
        self.offset += len(bytes)

    def registerProducer(self, producer, streaming):
        self.producer = producer
        self.producerIsStreaming = streaming

    def unregisterProducer(self):
        if self.producer is not None:
            del self.producer
            del self.producerIsStreaming


Changed 7 years ago by therve

  • owner changed from cablehead to therve


Changed 7 years ago by therve

  • status changed from new to closed
  • resolution set to fixed

(In [21220]) Merge vfs-ftp-1264+2735

Author: therve Reviewers: cablehead, exarkun Fixes #1264 Fixes #2735

Add tests for FTP interfaces IFTPShell, IReadFile and IWriteFile. This led to some cleanups in ftp.FTPShell, and removed several bugs in vfs ftp adapter and inmem backend.


Changed 7 years ago by therve

  • status changed from closed to reopened
  • resolution fixed deleted


Changed 6 years ago by therve

  • status changed from reopened to closed
  • resolution set to fixed

(In [21793]) Merge vfs-ftp-1264+2735-2

Author: therve Reviewers: jml, exarkun, cablehead Fixes #1264 Fixes #2735

Refactor tests for the vfs ftp adapter, using the new IFTPShellTestsMixin, and fixe behavior both in the ftp adapter and in the inmem backend.


Changed 3 years ago by <automation>

  • owner therve deleted
Note: See TracTickets for help on using tickets.