Skip to content
Snippets Groups Projects
  1. Aug 17, 2010
  2. Aug 16, 2010
  3. Aug 15, 2010
  4. Aug 13, 2010
  5. Aug 15, 2010
  6. Aug 13, 2010
    • Dan Villiom Podlaski Christiansen's avatar
      encoding: improve handling of buggy getpreferredencoding() on Mac OS X · 2be70ca1
      Dan Villiom Podlaski Christiansen authored
      Prior to version 2.7, calling locale.getpreferredencoding() would
      always return 'mac-roman' on Mac OS X. Previously, this was handled by
      a call to locale.setlocale(). Unfortunately, Python 2.6.5 and older
      have a bug where isspace() would incorrectly report True for 0x85 and
      0xa0 after such a call.
      
      In order to fix this, we replace the previous _encodingfixup mapping
      to an _encodingfixers mapping. Rather than mapping encodings to their
      replacement, it maps them to a function returning the
      replacement. This allows us to provide an simplified implementation of
      getpreferredencoding() which extracts the expected encoding and
      restores the locale.
      
      This fix is based on a patch originally submitted by Martijn Pieters
      as well as feedback from Brodie Rao.
      2be70ca1
  7. Aug 15, 2010
  8. Aug 10, 2010
  9. Aug 13, 2010
    • Dan Villiom Podlaski Christiansen's avatar
      test-notify: make it pass on Mac OS X (again) · 3b65c3c3
      Dan Villiom Podlaski Christiansen authored
      Changeset 25e74cd3f023 (from 2008) introduced a hack to handle the
      very long values of $TMPDIR typically seen on Mac OS X. This hack
      expected continuation lines to begin with a tab. However, as a result
      of a change in Python 2.7, changeset 594b98846ce1 made it so
      continuation lines began with a tab. Since then, `test-notify' has
      been broken on Mac OS X.
      
      Merely replacing the tab in the regular expression with a space will
      not work: not only do tab continuations still occur in the message, but
      other lines -- in the body of the message -- also start with a
      space. Luckily, all broken up lines appear to end with either a colon
      or an n, so we can match those, and reinsert them in the replacement.
      3b65c3c3
  10. Aug 15, 2010
  11. Aug 12, 2010
  12. Aug 15, 2010
  13. Aug 14, 2010
    • Renato Cunha's avatar
      url.py: removed 'file' inheritance in the httpsendfile class · e3526634
      Renato Cunha authored
      Since py3k doesn't have a "file" builtin and, consequently, doesn't support
      inheriting from it, this patch refactors the httpsendfile class to wrap the
      objects returned by the builtin "open" function while adding the necessary
      methods (__len__ for constructing the Content-Length header and read, write,
      close and seek for the file-like interface).
      e3526634
  14. Aug 15, 2010
  15. Aug 07, 2010
    • Renato Cunha's avatar
      py3kcompat: added fake ord implementation for py3k · 8bb1481c
      Renato Cunha authored
      In py3k, a bytes object __getitem__ will return an int instead of a
      one-character bytes object. This has negative consequences when we want to
      ord(), like in the following example:
      
      >>> b'foo'[0]
      102
      >>> ord(b'foo'[0])
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      TypeError: ord() expected string of length 1, but int found
      
      This patch overrides the default ord() implementation to just return an int
      that's what is passed as an argument for ord(). Making the above call succeed:
      
      >>> ord(b'foo'[0])
      102
      8bb1481c
  16. Aug 14, 2010
Loading