Apple's modifications to Python 2.5.1 (locale.py, ...)


/ Published in: Diff
Save to your folder(s)



Copy this code and paste it in your HTML
  1. diff -ur ./Python-2.5.1.orig/Lib/locale.py ./Python-2.5.1/Lib/locale.py
  2. --- ./Python-2.5.1.orig/Lib/locale.py 2006-05-18 11:06:40.000000000 +0900
  3. +++ ./Python-2.5.1/Lib/locale.py 2007-09-09 12:50:14.000000000 +0900
  4. @@ -485,7 +485,7 @@
  5. """
  6. _setlocale(category, _build_localename(getdefaultlocale()))
  7.  
  8. -if sys.platform in ('win32', 'darwin', 'mac'):
  9. +if sys.platform in ('win32', 'mac'):
  10. # On Win32, this will return the ANSI code page
  11. # On the Mac, it should return the system encoding;
  12. # it might return "ascii" instead
  13. diff -ur ./Python-2.5.1.orig/Modules/_localemodule.c ./Python-2.5.1/Modules/_localemodule.c
  14. --- ./Python-2.5.1.orig/Modules/_localemodule.c 2007-04-03 13:39:34.000000000 +0900
  15. +++ ./Python-2.5.1/Modules/_localemodule.c 2007-09-09 12:50:14.000000000 +0900
  16. @@ -32,7 +32,7 @@
  17. #include <wchar.h>
  18. #endif
  19.  
  20. -#if defined(__APPLE__)
  21. +#if 0
  22. #include <CoreFoundation/CoreFoundation.h>
  23. #endif
  24.  
  25. @@ -410,7 +410,7 @@
  26. }
  27. #endif
  28.  
  29. -#if defined(__APPLE__)
  30. +#if 0
  31. /*
  32. ** Find out what the current script is.
  33. ** Donated by Fredrik Lundh.
  34. @@ -683,7 +683,7 @@
  35. METH_VARARGS, strcoll__doc__},
  36. {"strxfrm", (PyCFunction) PyLocale_strxfrm,
  37. METH_VARARGS, strxfrm__doc__},
  38. -#if defined(MS_WINDOWS) || defined(__APPLE__)
  39. +#if defined(MS_WINDOWS) || 0
  40. {"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, METH_NOARGS},
  41. #endif
  42. #ifdef HAVE_LANGINFO_H

URL: http://weblog.metareal.org/2007/09/09/fixup-python-locale-problems-by-apple-darwin-patch/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.