This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Win32COM policy.py unicode exceptions
Type: Stage:
Components: Windows Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, rbell01824
Priority: normal Keywords:

Created on 2006-01-10 14:34 by rbell01824, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg27263 - (view) Author: rbell01824 (rbell01824) Date: 2006-01-10 14:34
Getting exceptions when catching events while
interacting with InternetExplorer.Application.

Class connects to IE via

self.ie =
DispatchWithEvents("InternetExplorer.Application",
InternetExplorerEvents)

Subsequent events on some (not all) URLs cause
exceptions as follows:

pythoncom error: Python error invoking COM method.

Traceback (most recent call last):
  File
"C:\Python24\Lib\site-packages\win32com\server\policy.py",
line 285, in _Invoke_
    return self._invoke_(dispid, lcid, wFlags, args)
  File
"C:\Python24\Lib\site-packages\win32com\server\policy.py",
line 290, in _invoke_
    return S_OK, -1, self._invokeex_(dispid, lcid,
wFlags, args, None, None)
  File
"C:\Python24\Lib\site-packages\win32com\server\policy.py",
line 653, in _invokeex_
    args, kwArgs = self._transform_args_(args, kwArgs,
dispid, lcid, wFlags, serviceProvider)
  File
"C:\Python24\Lib\site-packages\win32com\server\policy.py",
line 648, in _transform_args_
    arg = str(arg)
exceptions.UnicodeEncodeError: 'ascii' codec can't
encode character u'\xae' in position 67: ordinal not in
range(128)

URL being accessed via 

        self.ie.Navigate( url )

A number of URLs lead to the behavior including the
following:

http://www.cnb.com:80/
http://www.cnb1.com:80/
http://www.charterbankcc.com:80/
http://www.charterbankec.com:80/

I can provide test code if it is helpful.

msg27264 - (view) Author: rbell01824 (rbell01824) Date: 2006-01-10 15:11
Logged In: YES 
user_id=1190195

The following url reproduces multiple instances of the behavior:

http://www.clever.net/kerry/scuba/main.htm

The browser should be configured to allow popups.
msg27265 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-01-10 22:49
Logged In: YES 
user_id=1188172

Since it's a problem with the win32 extensions which aren't
part of the official Python distribution, please report this
to ActiveState or the Pywin32 maintainer.
History
Date User Action Args
2022-04-11 14:56:14adminsetgithub: 42782
2006-01-10 14:34:41rbell01824create