> From: webware-discuss-admin@...
> [mailto:webware-discuss-admin@... Behalf Of
> Michal Kaukic
> Sent: Thursday, December 09, 2004 5:56 AM
> To: webware-discuss@...; Michal Kaukic
> Subject: [Webware-discuss] Strange behaviour of string method
> "strip" in Webware servlet
> Recently I encountered an unexpected behaviour (at least for me) of
> the following code snippet I am using in Webware servlet:
> The string a_str is something like:
> a='Exam date: 20.04.2004, 08:00, NB-403'.
> In Webware's Detailed.log I can see error
> (when trying to insert exam_time and other data to database),
> from which it is
> evident that
> exam_time=' 08:00', i.e. NOT stripped.
> The same code works perfectly from interactive interpreter.
> Moreover, changing the string method 'strip' to the builtin function
> from module 'string':
> also helps, exam_time is '08:00' as it should be. I have no clue,
> what is going on.
> I am using Python 2.3.4 od Debian Sid machine. Maybe, it is Python issue?
> All thoughts leading to clarification of this situation are welcomed.
string.strip() behaves exactly the same inside Webware as it does on the
command line. Look to your data for the answer.
Is the data you are splitting and stripping in the servlet EXACTLY the same
as what you are using in the interpreter test? Is that supposed whitespace
before 08:00 actually some non-printing character that wouldn't be removed
by strip()? Or is it an HTML escape sequence (eg " ") that doesn't
appear when you copy'n'paste from a browser into another app?
Are you sure you are reading the error log correctly? Perhaps it inserts
whitespace before the value when it prints to the log?
Some suggestions, good luck debugging - Ben