eric ide

Issue216

Classification
Title: web browser crash in matchThirdParty
Type: crash Product: eric6
Process
Priority: critical    
Status: closed Resolution: fixed
Superseder: Nosy List: detlev, shao.lo
Assigned to: detlev Keywords:

Created on 2016-12-18.17:30:13 by shao.lo, last changed by detlev.

Files
File Name Uploaded Description Remove
AdBlockRule.py shao.lo, 2016-12-18.17:30:13 Fix empty string decode error.
Messages (3.0)
msg801 (view) Author: shao.lo Date: 2016-12-18.18:07:46
Submitted changes fix problem.  Thanks!
msg800 (view) Author: detlev Date: 2016-12-18.17:50:45
Please check, if the fix just done in the repository fixes it.
msg799 (view) Author: shao.lo Date: 2016-12-18.17:30:13
Traceback (most recent call last):                                             
                                        
  File "/eric6-16.12/eric/Helpviewer/Network/NetworkAccessManagerProxy.py", line
82, in createRequest                                                           
                                                    
    op, pageRequest, outgoingData)                                             
                                        
  File "/eric6-16.12/eric/Helpviewer/Network/NetworkAccessManager.py", line 162,
in createRequest                                                               
                                                    
    reply = self.__adblockNetwork.block(req)                                   
                                        
  File "/eric6-16.12/eric/Helpviewer/AdBlock/AdBlockNetwork.py", line 45, in
block           
    blockedRule = subscription.match(request, urlDomain, urlString)            
                                        
  File "/eric6-16.12/eric/Helpviewer/AdBlock/AdBlockSubscription.py", line 539,
in match     
    if rule.networkMatch(req, urlDomain, urlString):                           
                                        
  File "/eric6-16.12/eric/Helpviewer/AdBlock/AdBlockRule.py", line 298, in
networkMatch      
    if self.__thirdParty and not self.matchThirdParty(request):                
                                        
  File "/eric6-16.12/eric/Helpviewer/AdBlock/AdBlockRule.py", line 368, in
matchThirdParty   
    referer = bytes(req.attribute(QNetworkRequest.User + 200, "")).decode()    
                                        
TypeError: string argument without an encoding                                 
                                        
Aborted (core dumped)                                                          
                                        
...basically
bytes('').decode()
Traceback (most recent call last):
  File "/usr/lib/python3.5/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
TypeError: string argument without an encoding
History
Date User Action Args
2016-12-18 18:41:23detlevsetstatus: open -> closed
resolution: fixed
2016-12-18 18:07:46shao.losetmessage_count: 2.0 -> 3.0
messages: + msg801
2016-12-18 17:50:45detlevsetstatus: new -> open
assignedto: detlev
messages: + msg800
message_count: 1.0 -> 2.0
nosy: + detlev
2016-12-18 17:30:13shao.locreate