Opened 2 years ago

Closed 21 months ago

#5908 enhancement closed fixed (fixed)

The tests for twisted.python.filepath shouldn't use eval()

Reported by: itamar Owned by: therve
Priority: normal Milestone:
Component: core Keywords: easy
Cc: Branch:
Author: Launchpad Bug:

Description

Constructing Unix permission octets with eval() is silly; we should fix twisted.test.test_paths not to do so.

Attachments (1)

patch5908.patch (1.0 KB) - added by Petit_Dejeuner 21 months ago.
Replaces call to 'eval()' with call to 'int(var, 8)'.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 22 months ago by dinabina

  • Owner set to dinabina
  • Status changed from new to assigned

Is this a simple matter of changing the use of eval(octet_string) to int(octet_string, 8), where octet_string is built using the existing for-loop.

Changed 21 months ago by Petit_Dejeuner

Replaces call to 'eval()' with call to 'int(var, 8)'.

comment:2 Changed 21 months ago by itamar

  • Keywords review added
  • Owner dinabina deleted
  • Status changed from assigned to new

comment:3 Changed 21 months ago by therve

  • Keywords review removed
  • Owner set to therve

Looks good, applying.

comment:4 Changed 21 months ago by therve

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

(In [36408]) Replace usage of eval by int in twisted.tests.test_path

Author: Petit_Dejeuner
Reviewer: therve
Fixes: #5908

Note: See TracTickets for help on using tickets.