Ticket #3035 (closed enhancement: fixed )

Opened 2 years ago

Last modified 1 year ago

deprecated Resource subclasses in twisted.web.error, add equivalents in twisted.web.resource

Reported by: exarkun Assigned to: exarkun
Type: enhancement Priority: normal
Milestone: Component: web
Keywords: Cc:
Branch: branches/deprecate-error-pages-3035 Author: exarkun
Launchpad Bug:

Description

This circularity is dumb and it breaks tools (eg pydoctor).

Generally, error modules are for exceptions, anyway.

Attachments

Change History

  2009-01-14 20:01:31+00:00 changed by exarkun

  • owner changed from jknight to exarkun
  • status changed from new to assigned
  • launchpad_bug deleted

  2009-01-14 20:07:21+00:00 changed by exarkun

  • branch set to branches/deprecate-error-pages-3035
  • branch_author set to exarkun

(In [26020]) Branching to 'deprecate-error-pages-3035'

  2009-01-14 21:29:08+00:00 changed by exarkun

  • keywords set to review
  • owner deleted
  • status changed from assigned to new

Done, please review.

follow-up: ↓ 5   2009-01-15 14:15:18+00:00 changed by glyph

  • keywords deleted
  • owner set to exarkun
  1. A number of tests emit the new warnings, such as:
    /home/glyph/Projects/Twisted/trunk/twisted/web/_auth/wrapper.py:120: DeprecationWarning: twisted.web.error.ErrorPage is deprecated since Twisted 9.0.  See twisted.web.resource.ErrorPage.
    
  2. The moved resources should get docstrings.

in reply to: ↑ 4   2009-01-15 19:31:08+00:00 changed by exarkun

  • keywords set to review

Replying to glyph:

1. A number of tests emit the new warnings, such as: {{{ /home/glyph/Projects/Twisted/trunk/twisted/web/_auth/wrapper.py:120: DeprecationWarning?: twisted.web.error.ErrorPage? is deprecated since Twisted 9.0. See twisted.web.resource.ErrorPage?. }}}

Okay, I think I replaced all uses of the deprecated API with the non-deprecated API. Running the test suite like this:

PYTHONPATH= python -W 'error:twisted.web.error.ErrorPage is deprecated since Twisted 9.0.  See twisted.web.resource.ErrorPage.' -W 'error:twisted.web.error.NoResource is deprecated since Twisted 9.0.  See twisted.web.resource.NoResource.' -W 'error:twisted.web.error.ForbiddenResource is deprecated since Twisted 9.0.  See twisted.web.resource.ForbiddenResource.' ~/Projects/Twisted/branches/deprecate-error-pages-3035/bin/trial twisted

now produces no errors for me. I had to change a bunch of code with no unit tests, so I added some. I did not add tests for the Quixote stuff. Changes in r26031.

1. The moved resources should get docstrings.

Fixed in r26029.

  2009-01-15 19:31:25+00:00 changed by exarkun

  • owner deleted

  2009-01-25 15:48:33+00:00 changed by therve

  • keywords deleted
  • owner set to exarkun
  • Some flakes:
    twisted/web/test/test_cgi.py:7: 'static' imported but unused
    twisted/web/test/test_vhost.py:11: 'Resource' imported but unused
    twisted/web/twcgi.py:24: 'html' imported but unused
    
  • The new deprecation warnings are missing tests.

  2009-01-25 15:57:33+00:00 changed by therve

  • keywords set to review
  • owner changed from exarkun to therve

  2009-01-25 16:02:15+00:00 changed by therve

  • keywords deleted
  • owner changed from therve to exarkun

OK I missed some files :). +1.

  2009-01-25 16:17:54+00:00 changed by exarkun

(In [26112]) remove unused imports; replace relative imports with absolute imports; update copyrights; add/reformat module docstrings

refs #3035

  2009-01-25 17:50:07+00:00 changed by exarkun

(In [26114]) work around pydoctor bug; markup cannot span multiple lines :/

refs #3035

  2009-01-25 19:25:40+00:00 changed by exarkun

(In [26115]) Skip 403 test on Windows

refs #3035

  2009-01-25 21:38:01+00:00 changed by exarkun

Buildbot revealed some minor issues. I responded to review feedback and fixed the build issues in the revisions above. Merging now.

  2009-01-25 21:40:22+00:00 changed by exarkun

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

(In [26116]) Merge deprecate-error-pages-3035

Author: exarkun Reviewer: glyph, therve Fixes: #3035

Move the error response resource classes from twisted.web.error to twisted.web.resource. This is the first step in eliminating the circular dependency between those two modules. Deprecated versions of the resources remain in twisted.web.error for backwards compatibility and numerous tests for these classes have been added.

Note: See TracTickets for help on using tickets.