Ticket #6036 enhancement closed fixed

Opened 9 months ago

Last modified 9 months ago

Port remaining code in `twisted.python.deprecate` to Python 3

Reported by: itamar Owned by: itamar
Priority: normal Milestone: Python 3.3 Minimal
Component: core Keywords:
Cc: Branch: branches/deprecate-py3-6036-2
(diff, github, buildbot, log)
Author: itamarst Launchpad Bug:

Description

Parts of trial depend on the remaining code in twisted.python.deprecate that hasn't yet been ported to Python 3; all of it should be ported, or that dependency removed.

Change History

1

Changed 9 months ago by itamarst

  • branch set to branches/deprecate-py3-6036
  • branch_author set to itamarst

(In [35888]) Branching to 'deprecate-py3-6036'

2

Changed 9 months ago by itamar

  • owner set to exarkun
  • keywords review added

3

Changed 9 months ago by exarkun

  • keywords review removed
  • owner changed from exarkun to itamar

Should be split into separate tickets for twisted.python.modules changes and twisted.python.deprecate changes, as discussed on IRC.

4

Changed 9 months ago by itamarst

  • branch changed from branches/deprecate-py3-6036 to branches/deprecate-py3-6036-2

(In [35903]) Branching to 'deprecate-py3-6036-2'

5

Changed 9 months ago by itamar

  • keywords review added
  • owner changed from itamar to exarkun

6

Changed 9 months ago by exarkun

  • owner changed from exarkun to itamar
  • keywords review removed
  1. twisted/python/test/deprecatedattributes.py could use a copyright header and a module docstring
  2. Also in deprecatedattributes.py, the comment above the reflect import is obsolete - there is no longer a circular dependency between those two modules (even disregarding Python 3 porting artifacts).
  3. *Also* reflect isn't actually used once it's imported.
  4. Another unused import, traceback, in twisted/python/reflect.py - not new in this branch though.
  5. in test_deprecate.py, ImportedModuleAttributeTests.pathEntryTree first encodes a path string using UTF-8 and then potentially tries to decode it using ASCII by way of nativeString. This is fine until we encounter a non-ASCII path. Not that I really care about non-ASCII paths, but I think we might have decided to support them (even before FilePath supports them). Not supporting them would be easier, though. :) This came up in twisted.trial.test.test_warnings and apparently the solution was to just explicitly decode using UTF-8 and put the result into sys.path (ie, not try to use nativeString for this case). That's in trunk now, but I have no idea if it actually works.
  6. Oops, ditto that problem for checkOneWarning.
  7. And WarnAboutFunctionTests.setUp.
  8. For deciding whether to call invalidate_caches or not, perhaps a try/except ImportError is better than a _PY3 check. Again, this is what the code in twisted/trial/test/test_warnings.py does.

Nothing major here except perhaps the nativeString issue, the resolution to which I'm curious about, so I'd like to look at that, at least, before this is merged.

7

Changed 9 months ago by itamarst

(In [35921]) Address review comments. Refs #6036

8

Changed 9 months ago by itamarst

(In [35922]) Address review comments, in the correct branch. Refs #6036

9

Changed 9 months ago by itamar

  • owner changed from itamar to exarkun
  • keywords review added

OK, fixed, in a number of ways depending on nativeString case.

 http://buildbot.twistedmatrix.com/boxes-supported?branch=/branches/deprecate-py3-6036-2 is running.

10

Changed 9 months ago by exarkun

  • keywords review removed
  • owner changed from exarkun to itamar

Okay, great, as long as buildbot is happy (the documentation builder isn't, but I don't think that's actually a new error).

11

Changed 9 months ago by itamarst

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

(In [35927]) Merge deprecate-py3-6036-2.

Author: itamar Review: exarkun Fixes: #6036

twisted.python.deprecate now runs on Python 3.

Note: See TracTickets for help on using tickets.