Opened 7 years ago

Closed 7 years ago

#5908 enhancement closed fixed (fixed)

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

Reported by: Itamar Turner-Trauring Owned by: therve
Priority: normal Milestone:
Component: core Keywords: easy
Cc: Branch:


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 Drew Dudash 7 years ago.
Replaces call to 'eval()' with call to 'int(var, 8)'.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 7 years ago by Dina

Owner: set to Dina
Status: newassigned

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 7 years ago by Drew Dudash

Attachment: patch5908.patch added

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

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

Keywords: review added
Owner: Dina deleted
Status: assignednew

comment:3 Changed 7 years ago by therve

Keywords: review removed
Owner: set to therve

Looks good, applying.

comment:4 Changed 7 years ago by therve

Resolution: fixed
Status: newclosed

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