[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - external/python3

Christian Lohmaier lohmaier+LibreOffice at googlemail.com
Sat May 24 14:55:05 PDT 2014


 external/python3/python-3.3.3-py17797.patch.1 |   34 +++++++++++++++++++-------
 1 file changed, 26 insertions(+), 8 deletions(-)

New commits:
commit 53ebf689076ab2283124c8b1cbd891e77d6c928f
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Sat May 24 23:50:36 2014 +0200

    fdo#77891 unconditionally disable console streams for WinXP
    
    as the functions to check for a valid filehandle don't work according to
    the documentation. Python in LO-Context is run from GUI anyway, and thus
    won't have those hooked up.
    
    Change-Id: I8bc048463b0dc1a25c1b6ba7422623dda110eddc
    (cherry picked from commit 788228e4aec06501a0e73193ba85fcdeef7efb69)

diff --git a/external/python3/python-3.3.3-py17797.patch.1 b/external/python3/python-3.3.3-py17797.patch.1
index 3c43fb1..d4f7ab8 100644
--- a/external/python3/python-3.3.3-py17797.patch.1
+++ b/external/python3/python-3.3.3-py17797.patch.1
@@ -3,39 +3,57 @@ http://connect.microsoft.com/VisualStudio/feedback/details/785119/
 
 Visual Studio 2012 changed return value for fileno function that breaks
 when python tries to check/setup stdin/out/err
+GetStdHandle on Windows XP behaves contrary to the documentation...
 diff -ur python3.org/Python/pythonrun.c python3/Python/pythonrun.c
---- python3.org/Python/pythonrun.c	2014-05-19 19:06:01.305362400 +0200
-+++ python3/Python/pythonrun.c	2014-05-19 19:07:13.649079800 +0200
-@@ -1083,7 +1083,11 @@
+--- python3.org/Python/pythonrun.c	2014-05-24 16:36:20.361672900 +0200
++++ python3/Python/pythonrun.c	2014-05-24 16:37:38.424159100 +0200
+@@ -1036,7 +1036,15 @@
+     int status = 0, fd;
+     PyObject * encoding_attr;
+     char *encoding = NULL, *errors;
+-
++#ifdef MS_WINDOWS
++    OSVERSIONINFOEX osvi;
++    BOOL bIsWindowsXP;
++
++    ZeroMemory(&osvi, sizeof(osvi));
++    osvi.dwOSVersionInfoSize = sizeof(osvi);
++    GetVersionEx(&osvi);
++    bIsWindowsXP = (osvi.dwMajorVersion < 6);
++#endif
+     /* Hack to avoid a nasty recursion issue when Python is invoked
+        in verbose mode: pre-import the Latin-1 and UTF-8 codecs */
+     if ((m = PyImport_ImportModule("encodings.utf_8")) == NULL) {
+@@ -1084,7 +1092,11 @@
       * and fileno() may point to an invalid file descriptor. For example
       * GUI apps don't have valid standard streams by default.
       */
 +#ifdef MS_WINDOWS
-+    if (!is_valid_fd(fd) || GetStdHandle(STD_INPUT_HANDLE) == NULL) {
++    if (!is_valid_fd(fd) || GetStdHandle(STD_INPUT_HANDLE) == NULL || bIsWindowsXP) {
 +#else
      if (!is_valid_fd(fd)) {
 +#endif
          std = Py_None;
          Py_INCREF(std);
      }
-@@ -1098,7 +1102,11 @@
+@@ -1099,7 +1111,11 @@
  
      /* Set sys.stdout */
      fd = fileno(stdout);
 +#ifdef MS_WINDOWS
-+    if (!is_valid_fd(fd) || GetStdHandle(STD_OUTPUT_HANDLE) == NULL) {
++    if (!is_valid_fd(fd) || GetStdHandle(STD_OUTPUT_HANDLE) == NULL || bIsWindowsXP) {
 +#else
      if (!is_valid_fd(fd)) {
 +#endif
          std = Py_None;
          Py_INCREF(std);
      }
-@@ -1114,7 +1122,11 @@
+@@ -1115,7 +1131,11 @@
  #if 1 /* Disable this if you have trouble debugging bootstrap stuff */
      /* Set sys.stderr, replaces the preliminary stderr */
      fd = fileno(stderr);
 +#ifdef MS_WINDOWS
-+    if (!is_valid_fd(fd) || GetStdHandle(STD_ERROR_HANDLE) == NULL) {
++    if (!is_valid_fd(fd) || GetStdHandle(STD_ERROR_HANDLE) == NULL || bIsWindowsXP) {
 +#else
      if (!is_valid_fd(fd)) {
 +#endif


More information about the Libreoffice-commits mailing list