Opened 5 years ago

Closed 5 years ago

#5904 defect closed invalid (invalid)

[error in example (docs)] /doc/web/howto/listings/client/ -- negative index of received data

Reported by: Andrej A Antonov Owned by:
Priority: normal Milestone:
Component: web Keywords:
Cc: jknight Branch:


good day! :)

/doc/web/howto/listings/client/ -- has error

negative index of received data in this block:

    def dataReceived(self, bytes):
        if self.remaining:
            display = bytes[:self.remaining]
            print 'Some data received:'
            print display
            self.remaining -= len(display) # ERROR IN LINE!
            # need to rewrite this line.. approximately like:
            # self.remaining = max(self.remaining - len(display), 0)

thanks very much!

Change History (2)

comment:1 Changed 5 years ago by DefaultCC Plugin

Cc: jknight added

comment:2 Changed 5 years ago by Jean-Paul Calderone

Resolution: invalid
Status: newclosed

Thanks for this report. However, I don't think it is valid. The maximum possible length of display is self.remaining, due to the slicing above.

Please re-open with details on how to reproduce the problem if I am wrong.

Note: See TracTickets for help on using tickets.