nghung270192 / colorama

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

Clear the screen crashes #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On 64 bit windows 7, python 2.6.5

What steps will reproduce the problem?
1. Open a console
2. Run python to get the interpreter
3. Initialize colorama and print the control code to clear the screen (see full 
trace below)

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\julian>python
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from colorama import init
>>> init()
>>> print '\x1b[2J'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python26\lib\site-packages\colorama\ansitowin32.py", line 34, in write
    self.__convertor.write(text)
  File "C:\Python26\lib\site-packages\colorama\ansitowin32.py", line 115, in write
    self.write_and_convert(text)
  File "C:\Python26\lib\site-packages\colorama\ansitowin32.py", line 140, in write_and_convert
    self.convert_ansi(*match.groups())
  File "C:\Python26\lib\site-packages\colorama\ansitowin32.py", line 154, in convert_ansi
    self.call_win32(command, params)
  File "C:\Python26\lib\site-packages\colorama\ansitowin32.py", line 181, in call_win32
    func(params, on_stderr=self.on_stderr)
  File "C:\Python26\lib\site-packages\colorama\winterm.py", line 111, in erase_data
    coord_screen = win32.COORD(0,0)
AttributeError: 'module' object has no attribute 'COORD'
>>>

Original issue reported on code.google.com by bishop.j...@gmail.com on 18 Dec 2013 at 6:16

GoogleCodeExporter commented 9 years ago
Thanks for the bug report. Sounds like problem. :-)

I'll only have access to OSX for the next couple of weeks, so won't be able to 
look at this. If anyone wanted to be helpful, useful contributions would be:

* Can anyone else verify the bug exists?
* Does it work on other Windows versions?
* Has it ever worked?
* Why don't we have a test for this? (or do we, and it's failing???)
* If there is a test (or if you create one), then does a bisect reveal which 
commit introduced this bug?
* Fixes welcome, obviously. :-)

Original comment by tart...@gmail.com on 19 Dec 2013 at 8:29

GoogleCodeExporter commented 9 years ago
I confirm the problem.
As far as I see, erase is not used in the demos.
I pushed a fix to my clone.
(it also includes support for erase modes 0 and 1)

Original comment by nvandenb...@gmail.com on 3 Jan 2014 at 11:32

GoogleCodeExporter commented 9 years ago
Thank you nvanderbergg. I see your clone w/ commits. I'll look at merging them 
tonight and pushing out a new release. Feel free to prod me if I seem to have 
forgotten. Huge thanks!

Original comment by tart...@gmail.com on 6 Jan 2014 at 11:45

GoogleCodeExporter commented 9 years ago
Haven't forgotten... soon...

Original comment by tart...@gmail.com on 8 Jan 2014 at 1:29

GoogleCodeExporter commented 9 years ago

Original comment by tart...@gmail.com on 20 Apr 2014 at 9:51

GoogleCodeExporter commented 9 years ago

D:\Projects\Py3\colorama>ver

Microsoft Windows XP [Version 5.1.2600]

D:\Projects\Py3\colorama>py
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from colorama import init
>>> init()
>>> print('\x1b[2J')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Python\v342\lib\site-packages\colorama\ansitowin32.py", line 35, in write
    self.__convertor.write(text)
  File "D:\Python\v342\lib\site-packages\colorama\ansitowin32.py", line 117, in write
    self.write_and_convert(text)
  File "D:\Python\v342\lib\site-packages\colorama\ansitowin32.py", line 142, in write_and_convert
    self.convert_ansi(*match.groups())
  File "D:\Python\v342\lib\site-packages\colorama\ansitowin32.py", line 156, in convert_ansi
    self.call_win32(command, params)
  File "D:\Python\v342\lib\site-packages\colorama\ansitowin32.py", line 183, in call_win32
    func(params, on_stderr=self.on_stderr)
  File "D:\Python\v342\lib\site-packages\colorama\winterm.py", line 111, in erase_data
    coord_screen = win32.COORD(0,0)
AttributeError: 'module' object has no attribute 'COORD'
>>> ^Z

Original comment by devpla...@gmail.com on 20 Nov 2014 at 11:05

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:06