Python 2.5/ wx.stc.Paste intermittent corruption

Using Python 2.5 release and wx.VERSION_STRING == '2.6.3.3'

When I paste text into an stc window, sometimes some of the characters are pasted as random unprintable characters.

I cannot reliably reproduce the behavior. It tends to happen more with longer pieces of text, but can happen with short snippets too. Sometimes a few characters are garbled, on other occasions the entire snippet is pasted as NUL. The same piece of text can paste correctly once, but if repasted become corrupted. This occurs whether the source of the text is another stc buffer, or an external program (e.g., NotePad, PSPad).

This does not happen on Python 2.4 with wx.VERSION_STRING == '2.6.1.0'

I'd much appreciate any clue as to what might be going on.

Thanks

Michael

Are you copying/pasting unicode characters? Do you have a custom paste
handler (menu item, keyboard binding, etc.)? Have you used memtest86
(if you are on an x86 machine) to verify that your memory isn't bad?
Are you using any "download managers", etc. that may be stealing or
corrupting text you copy?

- Josiah

···

Michael Spencer <mahs@telcopartners.com> wrote:

Using Python 2.5 release and wx.VERSION_STRING == '2.6.3.3'

When I paste text into an stc window, sometimes some of the characters are
pasted as random unprintable characters.

Josiah Carlson wrote:

Using Python 2.5 release and wx.VERSION_STRING == '2.6.3.3'

When I paste text into an stc window, sometimes some of the characters are pasted as random unprintable characters.

Are you copying/pasting unicode characters?

The text itself is plain ASCII (valid python sourcecode). I don't know anything about the internal representation of stc or the windows clipboard.

  Do you have a custom paste

handler (menu item, keyboard binding, etc.)?

Nothing obvious. wx.stc.Paste is not overridden. I have keyboard event-handlers, but nothing that intentionally messes with the clipboard buffer. Note also that it happens on Python 2.5 (with wx 2.6.3.3) and not on Python 2.4 (with wx 2.6.1.1). Still, I'll look further here.

Have you used memtest86

(if you are on an x86 machine) to verify that your memory isn't bad?

No, but it happens similarly on two different windows machines.

Are you using any "download managers", etc. that may be stealing or
corrupting text you copy?

- Josiah

Scary thought, but it doesn't happen in other apps.

Thanks for the ideas.

Michael

···

Michael Spencer <mahs@telcopartners.com> wrote:

Michael Spencer wrote:

Using Python 2.5 release and wx.VERSION_STRING == '2.6.3.3'

When I paste text into an stc window, sometimes some of the characters are pasted as random unprintable characters.

I cannot reliably reproduce the behavior. It tends to happen more with longer pieces of text, but can happen with short snippets too. Sometimes a few characters are garbled, on other occasions the entire snippet is pasted as NUL. The same piece of text can paste correctly once, but if repasted become corrupted. This occurs whether the source of the text is another stc buffer, or an external program (e.g., NotePad, PSPad).

This does not happen on Python 2.4 with wx.VERSION_STRING == '2.6.1.0'

I'd much appreciate any clue as to what might be going on.

Which platform? Ansi or Unicode build? Is the source providing ansi strings or unicode strrings? If ansi then is the source using the same encoding that the target is? When a paste fails or is garbled, does an immediate paste into another app also fail or does it succeed?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Michael Spencer wrote:

Using Python 2.5 release and wx.VERSION_STRING == '2.6.3.3'

When I paste text into an stc window, sometimes some of the characters are pasted as random unprintable characters.

I cannot reliably reproduce the behavior. It tends to happen more with longer pieces of text, but can happen with short snippets too. Sometimes a few characters are garbled, on other occasions the entire snippet is pasted as NUL. The same piece of text can paste correctly once, but if repasted become corrupted. This occurs whether the source of the text is another stc buffer, or an external program (e.g., NotePad, PSPad).

This does not happen on Python 2.4 with wx.VERSION_STRING == '2.6.1.0'

I'd much appreciate any clue as to what might be going on.

Which platform? Ansi or Unicode build? Is the source providing ansi strings or unicode strrings? If ansi then is the source using the same encoding that the target is? When a paste fails or is garbled, does an immediate paste into another app also fail or does it succeed?

Thanks for the follow-up, Robin.

Both machines: WinXP, Python 2.5, wx 2.6.3.3 ANSI build
Source is ANSI, e.g., another stc window or notepad
Encoding: windows default I presume, but I'm on shaky ground here
An immediate paste into another app following a garbled paste succeeds

Update, after further investigation: Copy/pasting sufficiently large source (e.g., the whole of the doctest module, causes wxPython to crash. Again this is true of the Python 2.5/wx2.6 combination, not 2.4/wx2.6. On smaller copy/pastes, the garbling happens randomly as described above.

The same failing behavior occurs with even minimal app (i.e., App, Frame, stc) and also the PyAlaCarte editor.

Michael