Attachment 'install-diff-log.txt'
Download 1 root@dss2 ~/moin-1.5.5a> python setup.py --quiet install --record=install.local
2 /usr/lib/python2.3/site-packages/MoinMoin/support/lupy/store.py:158: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up
3 self.writeInt((i >> 32) & 0xFFFFFFFF)
4 /usr/lib/python2.3/site-packages/MoinMoin/support/lupy/store.py:159: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up
5 self.writeInt(i & 0xFFFFFFFF)
6 root@dss2 ~/moin-1.5.5a> cd /usr/lib/python/site-packages/
7 root@dss2 /usr/lib/python/site-packages> diff --recursive --brief MoinMoin MoinMoin1.5.5a/
8 Files MoinMoin/action/MyPages.pyc and MoinMoin1.5.5a/action/MyPages.pyc differ
9 Files MoinMoin/action/rss_rc.pyc and MoinMoin1.5.5a/action/rss_rc.pyc differ
10 Files MoinMoin/i18n/__init__.pyc and MoinMoin1.5.5a/i18n/__init__.pyc differ
11 Files MoinMoin/i18n/meta.pyc and MoinMoin1.5.5a/i18n/meta.pyc differ
12 Files MoinMoin/request.py and MoinMoin1.5.5a/request.py differ
13 Files MoinMoin/request.pyc and MoinMoin1.5.5a/request.pyc differ
14 Only in MoinMoin1.5.5a/: request.py.new
15 Only in MoinMoin1.5.5a/_tests: test_formatter.py
16 Only in MoinMoin1.5.5a/_tests: test_formatter.pyc
17 Files MoinMoin/theme/__init__.pyc and MoinMoin1.5.5a/theme/__init__.pyc differ
18 Files MoinMoin/util/mail.pyc and MoinMoin1.5.5a/util/mail.pyc differ
19 root@dss2 /usr/lib/python/site-packages>
20
21 t@dss2 /usr/lib/python/site-packages> diff -u MoinMoin/request.py MoinMoin1.5.5a/request.py
22 --- MoinMoin/request.py 2006-09-15 14:26:51.000000000 -0700
23 +++ MoinMoin1.5.5a/request.py 2006-09-26 15:26:32.000000000 -0700
24 @@ -10,17 +10,8 @@
25 import os, re, time, sys, cgi, StringIO
26 import copy
27 from MoinMoin import config, wikiutil, user, caching
28 -from MoinMoin import error, multiconfig
29 from MoinMoin.util import MoinMoinNoFooter, IsWin9x
30
31 -# umask setting --------------------------------------------------------
32 -# We do this once per Python process, when request is imported:
33 -try:
34 - # we need to use a bitwise inverted value of config.umask
35 - os.umask(0777 ^ config.umask)
36 -except: # we are on win32
37 - pass
38 -
39 # Timing ---------------------------------------------------------------
40
41 class Clock:
42 @@ -29,46 +20,21 @@
43 """
44
45 def __init__(self):
46 - self.timings = {}
47 - self.states = {}
48 + self.timings = {'total': time.time()}
49
50 def start(self, timer):
51 - state = self.states.setdefault(timer, 'new')
52 - if state == 'new':
53 - self.timings[timer] = time.time()
54 - self.states[timer] = 'running'
55 - elif state == 'running':
56 - pass # this timer is already running, do nothing
57 - elif state == 'stopped':
58 - # if a timer is stopped, timings has the sum of all times it was running
59 - self.timings[timer] = time.time() - self.timings[timer]
60 - self.states[timer] = 'running'
61 + self.timings[timer] = time.time() - self.timings.get(timer, 0)
62
63 def stop(self, timer):
64 - state = self.states.setdefault(timer, 'neverstarted')
65 - if state == 'running':
66 - self.timings[timer] = time.time() - self.timings[timer]
67 - self.states[timer] = 'stopped'
68 - elif state == 'stopped':
69 - pass # this timer already has been stopped, do nothing
70 - elif state == 'neverstarted':
71 - pass # this timer never has been started, do nothing
72 + self.timings[timer] = time.time() - self.timings[timer]
73
74 def value(self, timer):
75 - state = self.states.setdefault(timer, 'nosuchtimer')
76 - if state == 'stopped':
77 - result = "%.3fs" % self.timings[timer]
78 - elif state == 'running':
79 - result = "%.3fs (still running)" % (time.time() - self.timings[timer])
80 - else:
81 - result = "- (%s)" % state
82 - return result
83 + return "%.3f" % (self.timings[timer], )
84
85 def dump(self):
86 outlist = []
87 - for timer in self.timings.keys():
88 - value = self.value(timer)
89 - outlist.append("%s = %s" % (timer, value))
90 + for timing in self.timings.items():
91 + outlist.append("%s = %.3fs" % timing)
92 outlist.sort()
93 return outlist
94
95 @@ -142,15 +108,10 @@
96 else:
97 self.writestack = []
98 self.clock = Clock()
99 - self.clock.start('total')
100 # order is important here!
101 self.__dict__.update(properties)
102 - try:
103 - self._load_multi_cfg()
104 - except error.NoConfigMatchedError:
105 - self.makeForbidden(404, 'No wiki configuration matching the URL found!\r\n')
106 - return
107 -
108 + self._load_multi_cfg()
109 +
110 self.isSpiderAgent = self.check_spider()
111
112 # Set decode charsets. Input from the user is always in
113 @@ -190,12 +151,13 @@
114 if not self.forbidden and self.surge_protect():
115 self.makeUnavailable503()
116
117 + from MoinMoin import i18n
118 +
119 self.logger = None
120 self.pragma = {}
121 self.mode_getpagelinks = 0
122 self.no_closing_html_code = 0
123
124 - from MoinMoin import i18n
125 self.i18n = i18n
126 self.lang = i18n.requestLanguage(self)
127 # Language for content. Page content should use the wiki default lang,
128 @@ -206,19 +168,15 @@
129 self.opened_logs = 0
130 self.reset()
131
132 - def surge_protect(self, kick_him=False):
133 - """ check if someone requesting too much from us,
134 - if kick_him is True, we unconditionally blacklist the current user/ip
135 - """
136 - limits = self.cfg.surge_action_limits
137 - if not limits:
138 - return False
139 + def surge_protect(self):
140 + """ check if someone requesting too much from us """
141 validuser = self.user.valid
142 current_id = validuser and self.user.name or self.remote_addr
143 if not validuser and current_id.startswith('127.'): # localnet
144 return False
145 current_action = self.form.get('action', ['show'])[0]
146
147 + limits = self.cfg.surge_action_limits
148 default_limit = self.cfg.surge_action_limits.get('default', (30, 60))
149
150 now = int(time.time())
151 @@ -258,10 +216,6 @@
152 maxnum, dt = limits.get(current_action, default_limit)
153 events = surgedict.setdefault(current_id, copy.copy({}))
154 timestamps = events.setdefault(current_action, copy.copy([]))
155 -
156 - if kick_him: # ban this guy, NOW
157 - timestamps.extend([(now + self.cfg.surge_lockout_time, "!")] * (2*maxnum))
158 -
159 surge_detected = surge_detected or len(timestamps) > maxnum
160
161 surge_indicator = surge_detected and "!" or ""
162 @@ -301,9 +255,8 @@
163 def _load_multi_cfg(self):
164 # protect against calling multiple times
165 if not hasattr(self, 'cfg'):
166 - self.clock.start('load_multi_cfg')
167 + from MoinMoin import multiconfig
168 self.cfg = multiconfig.getConfig(self.url)
169 - self.clock.stop('load_multi_cfg')
170
171 def setAcceptedCharsets(self, accept_charset):
172 """ Set accepted_charsets by parsing accept-charset header
173 @@ -349,7 +302,8 @@
174 """
175 # Values we can just copy
176 self.env = env
177 - self.http_accept_language = env.get('HTTP_ACCEPT_LANGUAGE', self.http_accept_language)
178 + self.http_accept_language = env.get('HTTP_ACCEPT_LANGUAGE',
179 + self.http_accept_language)
180 self.server_name = env.get('SERVER_NAME', self.server_name)
181 self.server_port = env.get('SERVER_PORT', self.server_port)
182 self.saved_cookie = env.get('HTTP_COOKIE', '')
183 @@ -359,8 +313,6 @@
184 self.request_method = env.get('REQUEST_METHOD', None)
185 self.remote_addr = env.get('REMOTE_ADDR', '')
186 self.http_user_agent = env.get('HTTP_USER_AGENT', '')
187 - self.if_modified_since = env.get('If-modified-since') or env.get(cgiMetaVariable('If-modified-since'))
188 - self.if_none_match = env.get('If-none-match') or env.get(cgiMetaVariable('If-none-match'))
189
190 # REQUEST_URI is not part of CGI spec, but an addition of Apache.
191 self.request_uri = env.get('REQUEST_URI', '')
192 @@ -657,6 +609,18 @@
193 return ''
194 return self.script_name
195
196 + def getPageNameFromQueryString(self):
197 + """ Try to get pagename from the query string
198 +
199 + Support urls like http://netloc/script/?page_name. Allow
200 + solving path_info encoding problems by calling with the page
201 + name as a query.
202 + """
203 + pagename = wikiutil.url_unquote(self.query_string, want_unicode=False)
204 + pagename = self.decodePagename(pagename)
205 + pagename = self.normalizePagename(pagename)
206 + return pagename
207 +
208 def getKnownActions(self):
209 """ Create a dict of avaiable actions
210
211 @@ -784,14 +748,12 @@
212 try:
213 if isinstance(d, unicode):
214 # if we are REALLY sure, we can use "strict"
215 - d = d.encode(config.charset, 'replace')
216 - elif d is None:
217 - continue
218 + d = d.encode(config.charset, 'replace')
219 wd.append(d)
220 except UnicodeError:
221 print >>sys.stderr, "Unicode error on: %s" % repr(d)
222 return ''.join(wd)
223 -
224 +
225 def decodePagename(self, name):
226 """ Decode path, possibly using non ascii characters
227
228 @@ -1018,7 +980,6 @@
229 def makeForbidden(self, resultcode, msg):
230 statusmsg = {
231 403: 'FORBIDDEN',
232 - 404: 'Not found',
233 503: 'Service unavailable',
234 }
235 self.http_headers([
236 @@ -1081,15 +1042,6 @@
237 else:
238 pagename = None
239
240 - # need to inform caches that content changes based on:
241 - # * cookie (even if we aren't sending one now)
242 - # * User-Agent (because a bot might be denied and get no content)
243 - # * Accept-Language (except if moin is told to ignore browser language)
244 - if self.cfg.language_ignore_browser:
245 - self.setHttpHeader("Vary: Cookie,User-Agent")
246 - else:
247 - self.setHttpHeader("Vary: Cookie,User-Agent,Accept-Language")
248 -
249 # Handle request. We have these options:
250
251 # 1. If user has a bad user name, delete its bad cookie and
252 @@ -1130,6 +1082,10 @@
253 else:
254 if action is None:
255 action = 'show'
256 + if not pagename and self.query_string:
257 + # Remove the action from the query_string
258 + self.query_string = self.query_string.replace('action=%s' % action,'')
259 + pagename = self.getPageNameFromQueryString()
260 # pagename could be empty after normalization e.g. '///' -> ''
261 # Use localized FrontPage if pagename is empty
262 if not pagename:
263 @@ -1191,11 +1147,7 @@
264 self.http_headers(["Status: 302 Found", "Location: %s" % url])
265
266 def setHttpHeader(self, header):
267 - """ Save header for later send.
268 -
269 - Attention: although we use a list here, some implementations use a dict,
270 - thus multiple calls with the same header type do NOT work in the end!
271 - """
272 + """ Save header for later send. """
273 self.user_headers.append(header)
274
275 def setResponseCode(self, code, message=None):
276 @@ -1293,7 +1245,9 @@
277 # Set Cache control header for http 1.1 caches
278 # See http://www.cse.ohio-state.edu/cgi-bin/rfc/rfc2109.html#sec-4.2.3
279 # and http://www.cse.ohio-state.edu/cgi-bin/rfc/rfc2068.html#sec-14.9
280 - self.setHttpHeader('Cache-Control: no-cache="set-cookie", private, max-age=0')
281 + self.setHttpHeader('Cache-Control: no-cache="set-cookie"')
282 + self.setHttpHeader('Cache-Control: private')
283 + self.setHttpHeader('Cache-Control: max-age=0')
284
285 # Set Expires for http 1.0 caches (does not support Cache-Control)
286 yearago = time.time() - (3600 * 24 * 365)
287 @@ -1331,7 +1285,7 @@
288 'query_string',
289 # 'remote_addr',
290 'request_method',
291 -# 'request_uri',
292 + 'request_uri',
293 # 'saved_cookie',
294 'script_name',
295 # 'server_name',
296 @@ -1450,9 +1404,7 @@
297 self.http_accept_language = self.twistd.getHeader('Accept-Language')
298 self.saved_cookie = self.twistd.getHeader('Cookie')
299 self.http_user_agent = self.twistd.getHeader('User-Agent')
300 - self.if_modified_since = self.twistd.getHeader('If-Modified-Since')- self.if_none_match = self.twistd.getHeader('If-None-Match')
301 -
302 +
303 # Copy values from twisted request
304 self.server_protocol = self.twistd.clientproto
305 self.server_name = self.twistd.getRequestHostname().split(':')[0]
306 @@ -1599,8 +1551,6 @@
307 self.http_host = 'localhost'
308 self.http_referer = ''
309 self.script_name = '.'
310 - self.if_modified_since = None
311 - self.if_none_match = None
312 RequestBase.__init__(self, properties)
313 self.cfg.caching_formats = [] # don't spoil the cache
314 self.initTheme() # usually request.run() does this, but we don't use it@@ -1682,10 +1632,6 @@
315 self.http_user_agent = sa.headers.getheader('user-agent', '')
316 co = filter(None, sa.headers.getheaders('cookie'))
317 self.saved_cookie = ', '.join(co) or ''
318 - self.if_modified_since = (sa.headers.getheader('if-modified-since')- or self.if_modified_since)
319 - self.if_none_match = (sa.headers.getheader('if-none-match')
320 - or self.if_none_match)
321
322 # Copy rest from standalone request
323 self.server_name = sa.server.server_name
324 @@ -1810,6 +1756,10 @@
325 else:
326 env=req.subprocess_env
327 self._setup_vars_from_std_env(env)
328 + #DSS Patch:
329 + self.if_modified_since = None
330 + self.if_none_match = None
331 + #End DSS Patch
332 RequestBase.__init__(self)
333
334 except Exception, err:
335 root@dss2 /usr/lib/python/site-packages>
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.