Opened 11 years ago

Closed 11 years ago

#4852 defect closed wontfix (wontfix)

twisted.web2.http_headers.MimeType.__ne__ returned value is incorrect

Reported by: Guillaume Bour Owned by:
Priority: normal Milestone:
Component: web2 Keywords:
Cc: jknight, David Reid Branch:
Author:

Description

When compared with non MimeType object, not-equal comparison returned value is incorrect.

$> from twisted.web2.http_headers import MimeType
$> m = MimeType.fromString('text/html')
$> print m == 42
false
$> print m != 42
false

Explanation:

__eq__ comparison return NotImplemented when compared with non-MimeType object.
__ne__ returns not __eq__(), e.g not NotImplemented, resolved to false value (should return NotImplemented too)

Attachments (1)

web2-mimetype.patch (706 bytes) - added by Guillaume Bour 11 years ago.
Proposed patch

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by DefaultCC Plugin

Cc: jknight David Reid added

Changed 11 years ago by Guillaume Bour

Attachment: web2-mimetype.patch added

Proposed patch

comment:2 Changed 11 years ago by Guillaume Bour

Type: enhancementdefect

comment:3 Changed 11 years ago by <automation>

comment:4 Changed 11 years ago by Jean-Paul Calderone

Milestone: Twisted 10.2

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

Resolution: wontfix
Status: newclosed

Thanks for filing this, gbour. However, since web2 has now been removed, we're not going to fix this in Twisted.

Note: See TracTickets for help on using tickets.