Changeset 388 for python/vendor/current/Lib/robotparser.py
- Timestamp:
- Mar 19, 2014, 11:11:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/vendor/current/Lib/robotparser.py
r2 r388 69 69 if "*" in entry.useragents: 70 70 # the default entry is considered last 71 self.default_entry = entry 71 if self.default_entry is None: 72 # the first default entry wins 73 self.default_entry = entry 72 74 else: 73 75 self.entries.append(entry) … … 121 123 state = 2 122 124 if state == 2: 123 self. entries.append(entry)125 self._add_entry(entry) 124 126 125 127 … … 132 134 # search for given user agent matches 133 135 # the first match counts 134 url = urllib.quote(urlparse.urlparse(urllib.unquote(url))[2]) or "/" 136 parsed_url = urlparse.urlparse(urllib.unquote(url)) 137 url = urlparse.urlunparse(('', '', parsed_url.path, 138 parsed_url.params, parsed_url.query, parsed_url.fragment)) 139 url = urllib.quote(url) 140 if not url: 141 url = "/" 135 142 for entry in self.entries: 136 143 if entry.applies_to(useragent): … … 154 161 # an empty value means allow all 155 162 allowance = True 163 path = urlparse.urlunparse(urlparse.urlparse(path)) 156 164 self.path = urllib.quote(path) 157 165 self.allowance = allowance
Note:
See TracChangeset
for help on using the changeset viewer.