Opened 2 years ago

Closed 2 years ago

#5904 defect closed invalid (invalid)

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

Reported by: polymorphm Owned by:
Priority: normal Milestone:
Component: web Keywords:
Cc: jknight Branch:
Author: Launchpad Bug:

Description

good day! :)

/doc/web/howto/listings/client/response.py -- 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 2 years ago by DefaultCC Plugin

  • Cc jknight added

comment:2 Changed 2 years ago by exarkun

  • Resolution set to invalid
  • Status changed from new to closed

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.