473,467 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Probable Pywin32 (win32com.client) bug??

This is a heads-up on a possible memory corruption type of bug in
recent and present versions of Python/win32com. I dont know if its
general, or specific to using win32com.client to access CDO as my
example does.

My script was tiny - it just opens a MAPI/CDO session and traverses
the email folders - but it keeps crashing Python at random places.

After 2 days of trying everything without success, I've finally
discovered that it depends on how I sequence through a (valid)
collection of folders returned by CDO:

If I do this:

for o in Folders:
....do something with the 'o' object...

Then the script seems to work OK, but it later crashes Python (in
CDO.DLL according to Windows). If it does crash, its always at the
same (unrelated) place in the script, though this changes "randomly"
whenever the script is changed or run in a different environment (eg.
IDE or command line). This suggests to me that there is some kind of
memory corruption going on.

But if I do this:

o = Folders.GetFirst()
while o:
....do something with the 'o' object...
o = Folders.GetNext()

Then the whole script works (the same) and is totally robust (no
Python crashes).

Could this be some kind of corruption going on within win32com when
the first technique is used? I've googled around, and as far as I can
see this is perfectly valid code.

Is this group the appropriate place to post this, eg. for Mark H to
see?

I have the whole 50-line script available if anyone else wants to try
this.

My system:
XP SP 1a
Outlook 2003 (with its CDO)
Python 2.3.2 (last ActiveState distribution) or 2.3.4
Pywin32 2.02 for Python 2.3
Jul 18 '05 #1
0 1338

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Justin Stockton | last post by:
I recently upgraded from ActivePython 2.2.2 to ActivePython 2.3.2 and I'm running into an issue importing the win32com.client module. Before installing the new version, I made sure to properly...
2
by: Michael Jordan | last post by:
I'm hoping that someone here can give me some insight into a problem I'm running into with Python, pywin32 and Excel. All-in-all using Python and pywin32 is great but I've run into a strange...
1
by: Philippe C. Martin | last post by:
Hi, I just got the pywin32 "hello world" COM server to install and I did manage to use it from VB 6.0. However, there are some glitches I do not comprehend: 1) at one point I got a python...
2
by: agostino.russo | last post by:
I managed to make pywin32 work from a network installation (not really hard work: a shared folder + copying some dlls + setting PYTHONPATH). PythonWin amd COM seem to be working fine from the...
0
by: Do Re Mi chel La Si Do | last post by:
Hi! I had found (since only 2 hours) that KixForm can to do used by Python + PyWin32 At the end of the message, a very small example It's an Active-X, in one file (.DLL), and one help-file...
2
by: kogrover | last post by:
ISSUE: COM Excel Sort works with Early Binding, but not Late Binding, but py2exe only does Late Binding I have code similar to this (type from notes, so there may be a typo...) import...
0
by: Andrea Gavana | last post by:
Hi All, I have a very simple python script that tries to put a rectangular shape in a worksheet and then add some text inside that shape. The main problem, is that as usual Excel doesn't like...
0
by: mazerj2006 | last post by:
I'm an old hand at python, but totally new to win32com -- I've run into a snag that seems to be related to python's (usually handy) lack of distinction between floats and doubles. Can anyone...
1
by: kernel1983 | last post by:
By reading the doc of pywin32 we can invoke COM like: o = win32com.client.Dispatch("Excel.Application") but is it possible to invoke some GUID directly?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.