nghung270192 / colorama

Automatically exported from code.google.com/p/colorama
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Python 3.3 Error on \033[2J #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've fixed the following error and am running a modified copy of Colorama for 
my current project. This is probably only an error on Python 3.3+ and I've only 
tested on 3.3.

The clear ANSI throws a "TypeError: one character string expected" at line 121 
in win32.py.
Fixed by replacing
    char = c_char(char)
with
    char = c_char(char.encode())

This could have also been fixed in winterm.py instead at line 116 by declaring 
the second argument as a byte, replacing
    win32.FillConsoleOutputCharacter(handle, ' ', dw_con_size, coord_screen)
with
    win32.FillConsoleOutputCharacter(handle, b' ', dw_con_size, coord_screen)

Original issue reported on code.google.com by Devon.Mo...@gmail.com on 27 Apr 2014 at 6:09

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks heaps for the bug report, very much appreciated. I thought I'd run it on 
3.4 but... ah. You are talking about the 'clear screen' functionality is that 
right? That was added by a third party patch and I don't think there are any 
tests for it. 

I'll take a look and try to push a new version out real soon.

Original comment by tart...@gmail.com on 27 Apr 2014 at 12:24

GoogleCodeExporter commented 9 years ago
Closing as per Wiggin's comment on https://github.com/tartley/colorama/issues/25

Original comment by tart...@gmail.com on 16 Feb 2015 at 12:07