Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1376

Show
Ignore:
Timestamp:
09/26/06 00:56:53
Author:
fumanchu
Message:

Fix for #569 (Encoding problems when accessing cherrypy instances from links).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/encoding.py

    r1372 r1376  
    7979            body.append(chunk.encode(encoding, errors)) 
    8080        cherrypy.response.body = body 
    81     except UnicodeError
     81    except (LookupError, UnicodeError)
    8282        return False 
    8383    else: 
  • trunk/cherrypy/test/test_decodingencoding.py

    r1275 r1376  
    6262                          "iso-8859-1, *;q=0. We tried these charsets: " 
    6363                          "iso-8859-1.") 
    64  
     64         
     65        # Ask for x-mac-ce, which should be unknown. See ticket #569. 
     66        self.getPage('/mao_zedong', [('Accept-Charset', 
     67                                      'us-ascii, ISO-8859-1, x-mac-ce')]) 
     68        self.assertStatus("406 Not Acceptable") 
     69        self.assertInBody("Your client sent this Accept-Charset header: " 
     70                          "us-ascii, ISO-8859-1, x-mac-ce. We tried these " 
     71                          "charsets: x-mac-ce, us-ascii, ISO-8859-1.") 
     72         
    6573 
    6674if __name__ == "__main__": 

Hosted by WebFaction

Log in as guest/cpguest to create tickets