#6061 enhancement closed fixed (fixed)

Port twisted.python.randbytes to Python 3

Reported by: exarkun Owned by: exarkun
Priority: normal Milestone: Python 3.3 Minimal
Component: core Keywords:
Cc: Branch: branches/randbytes-py3-6061
(diff, github, buildbot, log)
Author: exarkun Launchpad Bug:

Description

This is needed by twisted.names.dns.

Change History (8)

comment:1 Changed 22 months ago by exarkun

  • Author set to exarkun
  • Branch set to branches/randbytes-py3-6061

(In [35956]) Branching to 'randbytes-py3-6061'

comment:2 Changed 22 months ago by exarkun

  • Keywords review added
  • Owner changed from exarkun to itamar

Okay, worse than I thought, and the module is somewhat useless now that its alternative-selection features have been deleted. Oh well, I did it anyway, and I wish it had been easier and more useful. Build started: http://buildbot.twistedmatrix.com/boxes-supported?branch=/branches/randbytes-py3-6061

comment:3 Changed 22 months ago by itamar

I was actually going to suggest (in a new ticket) the use of randrange elsewhere in twisted.names.dns be switched to something secure based on inputs from os.urandom. Probably randbytes would be a reasonable place to add that sort of thing, so might be worth keeping around.

comment:4 Changed 22 months ago by exarkun

What do you mean "switched to something secure"? That's the point of twisted.python.randbytes.secureRandom, which is what twisted.names.dns currently uses.

comment:5 Changed 22 months ago by itamar

DNSMixin.__init__ uses randrange; not sure if that id has any meaning or use though.

comment:6 Changed 22 months ago by exarkun

Ah. Good catch! That id looks unused to me. Perhaps I'll delete it.

comment:7 Changed 22 months ago by itamar

  • Keywords review removed
  • Owner changed from itamar to exarkun

Looks good, please merge.

(We should keep our eye out and see if we want to make a twisted.python.compat.bytechr if this comes up again.)

comment:8 Changed 22 months ago by exarkun

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

(In [35963]) Merge randbytes-py3-6061

Author: exarkun
Reviewer: itamarst
Fixes: #6061

Port twisted.python.randbytes to Python 3.

Note: See TracTickets for help on using tickets.