File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 25
25
100
26
26
27
27
# no length specified, read full amount requested
28
- >>> len(BlockLoader().load('file:' + pathname2url (test_cdx_dir + 'example.cdx'), 0, -1).read(400))
28
+ >>> len(BlockLoader().load(to_local_url (test_cdx_dir + 'example.cdx'), 0, -1).read(400))
29
29
400
30
30
31
31
# HMAC Cookie Maker
61
61
62
62
#=================================================================
63
63
import re
64
+ import os
64
65
from io import BytesIO
65
66
from pywb .utils .loaders import BlockLoader , HMACCookieMaker
66
67
from pywb .utils .loaders import LimitReader , extract_client_cookie
@@ -83,7 +84,9 @@ def seek_read_full(seekable_reader, offset):
83
84
seekable_reader .readline () #skip
84
85
return seekable_reader .readline ()
85
86
86
-
87
+ def to_local_url (filename ):
88
+ filename = os .path .abspath (filename )
89
+ return 'file://' + pathname2url (filename )
87
90
88
91
if __name__ == "__main__" :
89
92
import doctest
You can’t perform that action at this time.
0 commit comments