test_web.py: fix test_GET_DIRECTORY_html_filenode_encoding for Twisted==12.3.0. fixes #1922 #31
No reviewers
Labels
No Label
Benchmarking and Performance
HTTP Storage Protocol
Nevow Removal
Python 3 Porting
not-for-merge
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: tahoe-lafs/tahoe-lafs#31
Loading…
Reference in New Issue
No description provided.
Delete Branch "1922_fix_test_web_test_GET_DIRECTORY_html_filenode_encoding"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
twisted.web.html.escape was used to produce html-encoded string (to then look it up in "value" attribute), but behavior of that function has changed between Twisted 12.2.0 (simple custom implementation) and 12.3.0 (imported from stdlib cgi module).
cgi.escape() requires quote=True parameter to escape double-quote characters.
Fixed by simply using reliable cgi.escape to produce html-escaped string for tests.
Pretty sure I used twisted.web.html.escape because Nevow also used it, but looks like currently it properly quotes attribute values, so guess different func is used for attributes there.