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.

Author Ivan.Pozdeev
Recipients Ivan.Pozdeev
Date 2014-10-04.01:54:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1412387689.66.0.814406977046.issue22552@psf.upfronthosting.co.za>
In-reply-to
Content
a LibraryLoader returns the same _FuncPtr object for a given function every time. This way, if two libraries set its attributes (most possibly, `argtypes') to incompatible values (both representing the same C-level entities), one of them will stop working.

I've just discovered such a problem with `pyreadline' and `colorama' which both utilize `windll.kernel32.GetConsoleScreenBufferInfo'.

One solution is to make LibraryLoader return a new object each time. Another (worse IMO) is to provide a clone function for _FuncPtr (it cannot be clones by `copy.copy()').

An example code:

>>> import pyreadline
>>> import pip._vendor.colorama
Readline internal error
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\pyreadline\console\console.py", line 768,
in hook_wrapper_23
    res = ensure_str(readline_hook(prompt))
  File "c:\python27\lib\site-packages\pyreadline\rlmain.py", line 569, in readline
    self.readline_setup(prompt)
  File "c:\python27\lib\site-packages\pyreadline\rlmain.py", line 565, in readline_setup
    self._print_prompt()
  File "c:\python27\lib\site-packages\pyreadline\rlmain.py", line 466, in _print_prompt
    x, y = c.pos()
  File "c:\python27\lib\site-packages\pyreadline\console\console.py", line 261,
in pos
    self.GetConsoleScreenBufferInfo(self.hout, byref(info))
ArgumentError: argument 2: <type 'exceptions.TypeError'>: expected LP_CONSOLE_SCREEN_BUFFER_INFO instance instead of pointer to CONSOLE_SCREEN_BUFFER_INFO

(the same error is printed continuously, on Ctrl-C, the interpreter crashes)
History
Date User Action Args
2014-10-04 01:54:49Ivan.Pozdeevsetrecipients: + Ivan.Pozdeev
2014-10-04 01:54:49Ivan.Pozdeevsetmessageid: <1412387689.66.0.814406977046.issue22552@psf.upfronthosting.co.za>
2014-10-04 01:54:49Ivan.Pozdeevlinkissue22552 messages
2014-10-04 01:54:48Ivan.Pozdeevcreate