Opened 7 years ago

Closed 7 years ago

#5913 enhancement closed fixed (fixed)

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

Reported by: Itamar Turner-Trauring Owned by: Itamar Turner-Trauring
Priority: normal Milestone: Python 3.3 Minimal
Component: core Keywords:
Cc: Branch: branches/reflect-python3-5913-2
branch-diff, diff-cov, branch-cov, buildbot
Author: itamarst


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 7 years ago by itamarst

Author: itamarst
Branch: branches/reflect-python3-5913

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

comment:2 Changed 7 years ago by Itamar Turner-Trauring

Keywords: review added
Owner: set to Jean-Paul Calderone

comment:3 Changed 7 years ago by Jean-Paul Calderone

Keywords: review removed
Owner: changed from Jean-Paul Calderone to Itamar Turner-Trauring
  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 7 years ago by Itamar Turner-Trauring

  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 7 years ago by itamarst

Branch: branches/reflect-python3-5913branches/reflect-python3-5913-2

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

comment:6 Changed 7 years ago by itamarst

Resolution: fixed
Status: newclosed

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