Skip to content

Commit 3874316

Browse files
committed
Corrected multipart boundary size so it match firefox boundaries.
On 64bits systems, mechanize as been generating very long boundary which are blocked by certains firewall. This commit restore the behaviors of 32bits system on 64bits system
1 parent 696acee commit 3874316

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mechanize/_form_controls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def isstringlike(x):
7272
def choose_boundary():
7373
"""Return a string usable as a multipart boundary."""
7474
# follow IE and firefox
75-
nonce = "".join(str(random.randint(0, sys.maxsize - 1)) for i in (0, 1, 2))
75+
nonce = "".join(str(random.randint(0, 2**31 - 1)) for i in (0, 1, 2))
7676
return "-" * 27 + nonce
7777

7878

0 commit comments

Comments
 (0)