Opened 2 years ago

Closed 23 months ago

#5913 enhancement closed fixed (fixed)

Port qual, safe_repr and safe_str (from twisted.python.reflect) to Python 3

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

Description

qual, safe_repr and safe_str are used by twisted.python.failure and twisted.python.log, so it would be useful to port them to Python 3.

Change History (6)

comment:1 Changed 2 years ago by itamarst

  • Author set to itamarst
  • Branch set to branches/reflect-python3-5913

(In [35452]) Branching to 'reflect-python3-5913'

comment:2 Changed 2 years ago by itamar

  • Keywords review added
  • Owner set to exarkun

comment:3 Changed 23 months ago by exarkun

  • Keywords review removed
  • Owner changed from exarkun to itamar
  1. Argh StringIO/BytesIO. If you think it's a good idea, perhaps twisted.python.compat.NativeStringIO? Or we could wait until we need this check again, I guess, and refactor then.
  2. Explicit documentation about the return type of safe_str and safe_repr would probably be good at this point.
  3. The docstring for unsignedID says it is mostly only necessary before Python 2.5. I guess keeping the existing implementation doesn't hurt, though.

Otherwise good. Fix at least point 2 and then merge, thanks.

comment:4 Changed 23 months ago by itamar

  1. Opened #5930.
  2. Done.
  3. Yeah, I noticed that too late. Plus probably Python 3.5 will make negative ids again, so can't hurt.

comment:5 Changed 23 months ago by itamarst

  • Branch changed from branches/reflect-python3-5913 to branches/reflect-python3-5913-2

(In [35463]) Branching to 'reflect-python3-5913-2'

comment:6 Changed 23 months ago by itamarst

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

(In [35466]) Merge reflect-python3-5913-2

Author: itamar
Review: exarkun
Fixes: #5913

More functions from twisted.python.reflect ported to Python 3.

Note: See TracTickets for help on using tickets.