SHARE
TWEET

bugfix in calibre's "input.py"

PypeBros Jan 5th, 2013 226 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def resource_adder(self, link_, base=None):
  2.         link = self.urlnormalize(link_)
  3.         link, frag = self.urldefrag(link)
  4.         link = unquote(link).replace('/', os.sep)
  5.         self.oeb.log.debug('Adding', link)
  6.         if not link.strip():
  7.             return link_
  8.         try:
  9.             if base and not os.path.isabs(link):
  10.                 link = os.path.join(base, link)
  11.             link = os.path.abspath(link)
  12.             # PypeBros: how about URLs that have non-ASCII characters ?
  13.         except:
  14.             return link_
  15.         if not os.access(link, os.R_OK):
  16.             return link_
  17.         if os.path.isdir(link):
  18.             self.log.warn(link_, 'is a link to a directory. Ignoring.')
  19.             return link_
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top