]> granicus.if.org Git - python/commitdiff
(Merge 3.2) Issue #10570: curses.tigetstr() is now expecting a byte string,
authorVictor Stinner <victor.stinner@haypocalc.com>
Wed, 2 Nov 2011 22:47:58 +0000 (23:47 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Wed, 2 Nov 2011 22:47:58 +0000 (23:47 +0100)
instead of a Unicode string.

This is an incompatible change, but the previous behaviour was completly wrong.

1  2 
Doc/library/curses.rst
Lib/test/test_curses.py
Misc/NEWS
Modules/_cursesmodule.c

Simple merge
index b4673e9863817a96fde599bab7a80eb021b762ff,09807834b47c75c30646556951eef67bee126436..ccbbc23433cba729382340ca3fb0b698365ac069
@@@ -264,22 -264,10 +264,26 @@@ def test_issue6243(stdscr)
      curses.ungetch(1025)
      stdscr.getkey()
  
 +def test_unget_wch(stdscr):
 +    if not hasattr(curses, 'unget_wch'):
 +        return
 +    ch = 'a'
 +    curses.unget_wch(ch)
 +    read = stdscr.get_wch()
 +    read = chr(read)
 +    if read != ch:
 +        raise AssertionError("%r != %r" % (read, ch))
 +
 +    ch = ord('a')
 +    curses.unget_wch(ch)
 +    read = stdscr.get_wch()
 +    if read != ch:
 +        raise AssertionError("%r != %r" % (read, ch))
 +
+ def test_issue10570():
+     b = curses.tparm(curses.tigetstr("cup"), 5, 3)
+     assert type(b) is bytes
  def main(stdscr):
      curses.savetty()
      try:
          test_userptr_without_set(stdscr)
          test_resize_term(stdscr)
          test_issue6243(stdscr)
 +        test_unget_wch(stdscr)
+         test_issue10570()
      finally:
          curses.resetty()
  
diff --cc Misc/NEWS
index c751ba689c7fee604f705d1fb73350b7accff133,993dfaec45cdcb44dbb55558ee5808ca8cd24cc5..11f98a7f47ab703cc5af59d675ba97ca4ad280f3
+++ b/Misc/NEWS
@@@ -350,13 -66,11 +350,16 @@@ Core and Builtin
  Library
  -------
  
+ - Issue #10570: curses.tigetstr() is now expecting a byte string, instead of
+   a Unicode string.
 +- Issue #13295: http.server now produces valid HTML 4.01 strict.
 +
  - Issue #2892: preserve iterparse events in case of SyntaxError.
  
 +- Issue #13287: urllib.request and urllib.error now contains a __all__ and
 +  exposes only relevant Classes, Functions. Patch by Florent Xicluna.
 +
  - Issue #670664: Fix HTMLParser to correctly handle the content of
    ``<script>...</script>`` and ``<style>...</style>``.
  
Simple merge