mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 23:03:26 +02:00
Fix regression in 0.8.41 that caused file:/// URLs to stop working in the news download system on windows. Fixes #955581 (Calibre now requires improper file url for local files)
This commit is contained in:
parent
a8d46f2f40
commit
c25e4c9fd6
1 changed files with 3 additions and 1 deletions
|
|
@ -14,7 +14,7 @@
|
|||
from cStringIO import StringIO
|
||||
|
||||
from calibre import browser, relpath, unicode_path
|
||||
from calibre.constants import filesystem_encoding
|
||||
from calibre.constants import filesystem_encoding, iswindows
|
||||
from calibre.utils.filenames import ascii_filename
|
||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
|
||||
from calibre.ebooks.chardet import xml_to_unicode
|
||||
|
|
@ -213,6 +213,8 @@ def fetch_url(self, url):
|
|||
is_local = 5
|
||||
if is_local > 0:
|
||||
url = url[is_local:]
|
||||
if iswindows and url.startswith('/'):
|
||||
url = url[1:]
|
||||
with open(url, 'rb') as f:
|
||||
data = response(f.read())
|
||||
data.newurl = 'file:'+url # This is what mechanize does for
|
||||
|
|
|
|||
Loading…
Reference in a new issue