Opened 2 years ago

Closed 23 months ago

#6036 enhancement closed fixed (fixed)

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 (11)

comment:1 Changed 2 years ago by itamarst

  • Author set to itamarst
  • Branch set to branches/deprecate-py3-6036

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

comment:3 Changed 23 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.

comment:4 Changed 23 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'

comment:5 Changed 23 months ago by itamar

  • Keywords review added
  • Owner changed from itamar to exarkun

comment:6 Changed 23 months ago by exarkun

  • Keywords review removed
  • Owner changed from exarkun to itamar
  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.

comment:7 Changed 23 months ago by itamarst

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

comment:8 Changed 23 months ago by itamarst

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

comment:9 Changed 23 months ago by itamar

  • Keywords review added
  • Owner changed from itamar to exarkun

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.

comment:10 Changed 23 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).

comment:11 Changed 23 months ago by itamarst

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

(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.