Changeset 2102:a356098c9b8b

Show
Ignore:
Timestamp:
07/13/10 19:46:53 (8 weeks ago)
Author:
Pablo Hoffman <pablo@…>
Children:
2103:aa1225394076, 2105:925d03ebbefe
Branch:
default
Message:

Applied patch to ClientForm? to fix bug with wrong entities. Also added tests and left patch in repo in case we upgrade ClientForm? in the future and need to re-apply it

Location:
scrapy
Files:
2 added
1 modified

Legend:

Unmodified
Added
Removed
  • scrapy/xlib/ClientForm.py

    r1257 r2102  
    242242    if name.startswith("x"): 
    243243        name, base= name[1:], 16 
    244     uc = unichr(int(name, base)) 
     244    try: 
     245        uc = unichr(int(name, base)) 
     246    except ValueError: 
     247        # invalid literal for int() 
     248        # or integer not in unichr()'s range 
     249        uc = name 
    245250    if encoding is None: 
    246251        return uc