Ignore:
Timestamp:
05/10/12 10:38:55 (7 years ago)
Author:
mnagni
Message:

djencoder fix for Windows machines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/cedaMoles/MolesManager/djencoder.py

    r8610 r8611  
    1212from decimal import Decimal 
    1313from sqlalchemy.orm.collections import InstrumentedList 
     14from cedaMoles.MolesManager.djencoder_patch import encode_basestring_ascii 
    1415 
    1516class DJEncoder(JSONEncoder): 
     
    9798            return self._iterencode(o, markers) 
    9899 
     100 
    99101        #Guarantee that works in windows                  
    100102        if self.ensure_ascii: 
     103                _encoder = encode_basestring_ascii 
     104        else: 
    101105            _encoder = encode_basestring_ascii 
    102         else: 
    103             _encoder = encode_basestring 
    104106        if self.encoding != 'utf-8': 
    105107            def _encoder(o, _orig_encoder=_encoder, _encoding=self.encoding): 
Note: See TracChangeset for help on using the changeset viewer.