Changeset 391 for python/trunk/Lib/robotparser.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/robotparser.py
r2 r391 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.