mirror of
				https://github.com/Mikaela/Limnoria.git
				synced 2025-10-31 15:47:25 +01:00 
			
		
		
		
	Web: Use @title's utf8 decoding in the snarfer.
This commit is contained in:
		
							parent
							
								
									0514a64209
								
							
						
					
					
						commit
						5f1535447c
					
				| @ -93,13 +93,15 @@ class Web(callbacks.PluginRegexp): | ||||
|             try: | ||||
|                 size = conf.supybot.protocols.http.peekSize() | ||||
|                 text = utils.web.getUrl(url, size=size) | ||||
|                 if sys.version_info[0] >= 3: | ||||
|                     text = text.decode('utf8', 'replace') | ||||
|             except utils.web.Error, e: | ||||
|                 self.log.info('Couldn\'t snarf title of %u: %s.', url, e) | ||||
|                 if self.registryValue('snarferReportIOExceptions', channel): | ||||
|                      irc.reply(url+" : "+utils.web.strError(e), prefixNick=False) | ||||
|                 return | ||||
|             try: | ||||
|                 text = text.decode('utf8', 'replace') | ||||
|             except: | ||||
|                 pass | ||||
|             parser = Title() | ||||
|             try: | ||||
|                 parser.feed(text) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Valentin Lorentz
						Valentin Lorentz