devknight / gitinspector

Automatically exported from code.google.com/p/gitinspector
GNU General Public License v3.0
0 stars 0 forks source link

gitinspector crashed on Windows 8 #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reproduce the failure

1. Windows 8 install Git-1.8.3-preview20130601 with Advance(cheetah plugin)
2. Python 3.3
3. Run with Powershell or Cmd

What is the expected output? What do you see instead?
Expect normal outcome, but only get parts.

Please use labels and text to provide additional information.
Command Prompt Print:

PS C:\Users\ZhijieWang> cd Eclipse_WorkSpace
PS C:\Users\ZhijieWang\Eclipse_WorkSpace> py gitinspector/gitinspector.py 
PittClass
The following historical commit information, by author, was found in the 
repository:

←[1mAuthor                     Commits    Insertions      Deletions    % of 
changes←[0;0m
Zhijie Wang                      4           514            237          100.00

Traceback (most recent call last):
  File "gitinspector/gitinspector.py", line 196, in <module>
  File "gitinspector/gitinspector.py", line 188, in main
  File "gitinspector/gitinspector.py", line 81, in output
  File "C:\Users\ZhijieWang\Eclipse_WorkSpace\gitinspector\outputable.py", line 38, in output
    outputable.output_text()
  File "C:\Users\ZhijieWang\Eclipse_WorkSpace\gitinspector\blame.py", line 214, in output_text
    print(textwrap.fill(_(BLAME_INFO_TEXT) + ":", width=terminal.get_size()[0]) + "\n")
  File "C:\Users\ZhijieWang\Eclipse_WorkSpace\gitinspector\terminal.py", line 97, in get_size
    (width, height) = __get_size_windows__()
TypeError: 'NoneType' object is not iterable
PS C:\Users\ZhijieWang\Eclipse_WorkSpace> ls

    Directory: C:\Users\ZhijieWang\Eclipse_WorkSpace

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         6/17/2013   7:22 PM            .metadata
d----         6/10/2013   3:22 PM            CodeJamQualificationRound
d----         6/10/2013   3:22 PM            CodeJamRound1B
d----         7/21/2013   9:42 PM            gitinspector
d----         6/10/2013   3:22 PM            Othelo
d----         7/19/2013   8:03 PM            PittClass
d----          7/9/2013   4:51 PM            RemoteSystemsTempFiles
d----         6/10/2013   3:22 PM            round1A
d----         6/10/2013   3:22 PM            Round1B
d----         6/10/2013   3:22 PM            SchoolConnect

PS C:\Users\ZhijieWang\Eclipse_WorkSpace>

Original issue reported on code.google.com by wangzhij...@gmail.com on 22 Jul 2013 at 1:49

GoogleCodeExporter commented 9 years ago
This is an interesting bug. It seems the terminal fails to report width and 
height.
It works great under Windows 7 (and previous versions); but reading up on it it 
seems things have changed slightly in Windows 8 and people use yet another 
method to get the terminal size.

I will look into it shortly.

/Adam Waldenberg

Original comment by gitinspe...@ejwa.se on 22 Jul 2013 at 2:37

GoogleCodeExporter commented 9 years ago
I don't have a Windows 8 installation; so you will have to assist me a little.

Reading around there seems to be a method used in conjunction with tput. Could 
you check if the tput command is available in your terminal in Windows 8? In 
that case, that command could be used to fetch the terminal size, executing the 
commands;

tput cols
tput lines

... should return the number of columns and lines of the current terminal.

/Adam Waldenberg

Original comment by gitinspe...@ejwa.se on 22 Jul 2013 at 1:06

GoogleCodeExporter commented 9 years ago
Unfortunately, neither of them works in PowerShell or cmd prompt

PS C:\Users\ZhijieWang> tput cols
tput : The term 'tput' is not recognized as the name of a cmdlet, function, 
script file, or operable program. Che
the spelling of the name, or if a path was included, verify that the path is 
correct and try again.
At line:1 char:1
+ tput cols
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (tput:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\ZhijieWang> tput lines
tput : The term 'tput' is not recognized as the name of a cmdlet, function, 
script file, or operable pro
the spelling of the name, or if a path was included, verify that the path is 
correct and try again.
At line:1 char:1
+ tput lines
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (tput:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\ZhijieWang>

Original comment by wangzhij...@gmail.com on 22 Jul 2013 at 2:26

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 9b5e82bc2cdf.

Original comment by gitinspe...@ejwa.se on 22 Jul 2013 at 11:10

GoogleCodeExporter commented 9 years ago
The terminal now falls back to default size (80*25) if the size of the terminal 
could not be determined. See the revision above for more information.

This is the correct behavior anyway (even if it shouldn't fail). Reading up on 
it the current method *SHOULD* work under Windows 8 as well. Something in your 
environment probably makes it fail. Maybe some missing modules in the Python 
installation? I will add some error printouts to stderr; when the terminal size 
can't be determined for some reason, so that it is easier to do something about 
it.

/Adam Waldenberg

Original comment by gitinspe...@ejwa.se on 22 Jul 2013 at 11:16