Python ActiveX Scripting Engine raising Unicode errors

Steve Holden sholden at holdenweb.com
Thu Jan 18 21:04:48 EST 2001


"Syver Enstad" <syver at NOSPAMcyberwatcher.com> wrote in message
news:947j84$503$1 at troll.powertech.no...
> > >
> > This is too weird: I just renamed pySQL.py, checked that there is no
> pySQL.*
> > file *anywhere* on my disks, and the ASP page still claims to be seeing
an
> > error in it!
>
> In my experience imported modules stay in memory until you unload the IIS
> application or restart the w3svc service. You can also make an asp page
with
> reload statements for the relevant modules as long as this asp page is
> situated in the same application.
>
Thanks. This is PWS, so I have less control. Starting and stopping the
server made no difference. Rebooting did, however, cause the module to be
reloaded ...

True enough, this error was occurring in the one module whose import
statement I had not followed with an immediate reload().

> > Clearly some weird cacheing going on here.
>
> Yes!
>
> Regarding the unicode error, you probably try to process characters
outside
> the 128 ascii characters, is it possible that some international
characters
> have been entered into the text field?
>
That's what I thought, and I *did* find a few spaces in there with the top
bit set. Unfortunately, even after purging them I am still seeing the error.
I have checked all the fields in the database, and can find *no* characters
greater than 127 in them. Unless my checking code is wrong, of course. The
essence of it is to create a transalte table as:

    ttbl = " "*128 + "!"*128

and the check is

    s = (row[1] or "").translate(ttbl)
    if "!" in s:
        ...

I'd appreciate any other thoughts...

regards
 Steve





More information about the Python-list mailing list