Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-apache/mod_wsgi/files/
Date: Sun, 01 Jan 2023 18:16:40
Message-Id: 1672596978.8f649e01d7a5dcf6c597b4d33aa20885950ae96d.conikost@gentoo
1 commit: 8f649e01d7a5dcf6c597b4d33aa20885950ae96d
2 Author: Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
3 AuthorDate: Sun Jan 1 13:45:52 2023 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 1 18:16:18 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f649e01
7
8 www-apache/mod_wsgi: remove unused patch
9
10 Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
11 Closes: https://github.com/gentoo/gentoo/pull/28914
12 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
13
14 .../mod_wsgi/files/mod_wsgi-4.7.1-py310.patch | 126 ---------------------
15 1 file changed, 126 deletions(-)
16
17 diff --git a/www-apache/mod_wsgi/files/mod_wsgi-4.7.1-py310.patch b/www-apache/mod_wsgi/files/mod_wsgi-4.7.1-py310.patch
18 deleted file mode 100644
19 index 274046d99ca0..000000000000
20 --- a/www-apache/mod_wsgi/files/mod_wsgi-4.7.1-py310.patch
21 +++ /dev/null
22 @@ -1,126 +0,0 @@
23 -From b439f1c411a9479ccc03c16465cdff50fede79d3 Mon Sep 17 00:00:00 2001
24 -From: Petr Viktorin <encukou@×××××.com>
25 -Date: Thu, 10 Jun 2021 15:45:03 +0200
26 -Subject: [PATCH] Use Py_CompileString rather than
27 - PyParser_SimpleParseFile/PyNode_Compile
28 -From: https://github.com/GrahamDumpleton/mod_wsgi/commit/b439f1c411a9479ccc03c16465cdff50fede79d3
29 -
30 ----
31 - src/server/mod_wsgi.c | 68 +++++++++++++++++++++++++++++++---------
32 - src/server/wsgi_python.h | 1 -
33 - 2 files changed, 53 insertions(+), 16 deletions(-)
34 -
35 -diff --git a/src/server/mod_wsgi.c b/src/server/mod_wsgi.c
36 -index b657a748..4f1d8765 100644
37 ---- a/src/server/mod_wsgi.c
38 -+++ b/src/server/mod_wsgi.c
39 -@@ -3645,7 +3645,10 @@ static PyObject *wsgi_load_source(apr_pool_t *pool, request_rec *r,
40 - FILE *fp = NULL;
41 - PyObject *m = NULL;
42 - PyObject *co = NULL;
43 -- struct _node *n = NULL;
44 -+ char *source;
45 -+ size_t pos = 0;
46 -+ size_t allocated = 1024;
47 -+ size_t nread;
48 -
49 - #if defined(WIN32) && defined(APR_HAS_UNICODE_FS)
50 - apr_wchar_t wfilename[APR_PATH_MAX];
51 -@@ -3730,36 +3733,71 @@ static PyObject *wsgi_load_source(apr_pool_t *pool, request_rec *r,
52 - return NULL;
53 - }
54 -
55 -- n = PyParser_SimpleParseFile(fp, filename, Py_file_input);
56 --
57 -+ source = malloc(allocated);
58 -+ if (source != NULL) {
59 -+ do {
60 -+ nread = fread(source + pos, 1, allocated - pos, fp);
61 -+ pos += nread;
62 -+ if (nread == 0) {
63 -+ if (ferror(fp)) {
64 -+ free(source);
65 -+ source = NULL;
66 -+ }
67 -+ break;
68 -+ }
69 -+ if (pos == allocated) {
70 -+ allocated *= 2;
71 -+ char *reallocated_source = realloc(source, allocated);
72 -+ if (reallocated_source == NULL) {
73 -+ free(source);
74 -+ source = NULL;
75 -+ break;
76 -+ }
77 -+ source = reallocated_source;
78 -+ }
79 -+ } while (!feof(fp));
80 -+ }
81 - fclose(fp);
82 --
83 -- if (!n) {
84 -+ if (source == NULL) {
85 - Py_BEGIN_ALLOW_THREADS
86 - if (r) {
87 -- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
88 -+ ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
89 - "mod_wsgi (pid=%d, process='%s', application='%s'): "
90 -- "Failed to parse Python script file '%s'.", getpid(),
91 -+ "Could not read source file '%s'.", getpid(),
92 - process_group, application_group, filename);
93 - }
94 - else {
95 -- ap_log_error(APLOG_MARK, APLOG_ERR, 0, wsgi_server,
96 -+ ap_log_error(APLOG_MARK, APLOG_ERR, errno, wsgi_server,
97 - "mod_wsgi (pid=%d, process='%s', application='%s'): "
98 -- "Failed to parse Python script file '%s'.", getpid(),
99 -+ "Could not read source file '%s'.", getpid(),
100 - process_group, application_group, filename);
101 - }
102 - Py_END_ALLOW_THREADS
103 -+ return NULL;
104 -+ }
105 -
106 -- wsgi_log_python_error(r, NULL, filename, 0);
107 -+ co = Py_CompileString(filename, source, 0);
108 -+ free(source);
109 -
110 -+ if (!co) {
111 -+ Py_BEGIN_ALLOW_THREADS
112 -+ if (r) {
113 -+ ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
114 -+ "mod_wsgi (pid=%d, process='%s', application='%s'): "
115 -+ "Could not compile source file '%s'.", getpid(),
116 -+ process_group, application_group, filename);
117 -+ }
118 -+ else {
119 -+ ap_log_error(APLOG_MARK, APLOG_ERR, errno, wsgi_server,
120 -+ "mod_wsgi (pid=%d, process='%s', application='%s'): "
121 -+ "Could not compile source file '%s'.", getpid(),
122 -+ process_group, application_group, filename);
123 -+ }
124 -+ Py_END_ALLOW_THREADS
125 - return NULL;
126 - }
127 -
128 -- co = (PyObject *)PyNode_Compile(n, filename);
129 -- PyNode_Free(n);
130 --
131 -- if (co)
132 -- m = PyImport_ExecCodeModuleEx((char *)name, co, (char *)filename);
133 -+ m = PyImport_ExecCodeModuleEx((char *)name, co, (char *)filename);
134 -
135 - Py_XDECREF(co);
136 -
137 -diff --git a/src/server/wsgi_python.h b/src/server/wsgi_python.h
138 -index fa06e2cb..3b34b731 100644
139 ---- a/src/server/wsgi_python.h
140 -+++ b/src/server/wsgi_python.h
141 -@@ -43,7 +43,6 @@
142 -
143 - #include "structmember.h"
144 - #include "compile.h"
145 --#include "node.h"
146 - #include "osdefs.h"
147 - #include "frameobject.h"
148 -