Menu

#399 Unicode exception when using ie.Navigate after dispatch

open
nobody
com (105)
5
2009-01-05
2009-01-05
Mounir
No

The situation: When using a IE browser after dispatch and navigating to a particular URL, the exception at the end of this note is observed
Important information: this is from the user of a commercial python program (provided as an executable) called CiteSmart. The error is observed very likely because th user is using a Corean version of Windows XP. This bug couldn't be reproduced on an english plate-form.

> Traceback (most recent call last):
> File "win32com\server\policy.pyo", line 285, in _Invoke_
> File "win32com\server\policy.pyo", line 290, in _invoke_
> File "win32com\server\policy.pyo", line 658, in _invokeex_
> File "win32com\server\policy.pyo", line 653, in
> _transform_args_
> : 'ascii' codec can't encode
> characters in position 0-1: ordinal not in

Discussion

  • Mark Hammond

    Mark Hammond - 2009-01-30

    This is very strange. That error seems to be:

    elif not core_has_unicode and arg_type==UnicodeType:
    arg = str(arg)

    and 'core_has_unicode' should *always* be True in recent builds. What version of Python are you using? Can you please confirm that line 653 in your transform.py does point at that code?

     
  • Mounir

    Mounir - 2009-01-31

    Mark
    thank you for taking time to review this issue.
    Yes the line you mention is there in the file policy.py at the lines 652-3 (and not in transform.py).

    The python version that was used is 2.5.1 (r251:54863)

    If there is anything I can do to help, let me know.

    Thank you for your amazing contribution and the excellent tools you provide us with.

     
  • Mark Hammond

    Mark Hammond - 2009-01-31

    Oops - I meant policy.py. If you check that file, you should find that core_has_unicode is always True for all supported Python versions - so I don't quite understand how we could have entered that block. The next win32com version will have removed it completely, but that still doesn't explain how you are hitting this.

     
  • Mounir

    Mounir - 2009-01-31

    Mark
    frankly I don't know what has happened. Again, this happened to the user of our product. He is using a Korean version of XP, so I don't have access to his computer and can't reproduce the problem.
    I guess there is little that can be done. We will see once the new win32com is out. By the way this has happened with IE, so there may be some reasons there (local configuration of the browser. Go figure...)

    Anyway thank you very much for taking a loot at this.