Skip to content

TabError #4

@jimcheetham

Description

@jimcheetham

There's an unwanted space character at the beginning of line 57 of convertfb, that causes execution to fail with a TabError on line 58.

This is with Python 3.11.2 on Debian 12

$ python3 convertfb --help
  File "/home/jim/tmp/convertfb/convertfb", line 58
    print ('cut the Image height to',args.buf_width)
TabError: inconsistent use of tabs and spaces in indentation

Whitespace highlighting will help you see the errant character on a colour terminal, but doesn't survive copy/paste into github :-

$ git config diff.wsErrorHighlight all
jim@Perspex:~/tmp/convertfb$ git diff
diff --git a/convertfb b/convertfb
index fe79b84..efcaa98 100755
--- a/convertfb
+++ b/convertfb
@@ -54,7 +54,7 @@ if(w > args.buf_width):
        print ('cut the Image width to',args.buf_width)

 if(h > args.buf_width):
-       h = args.buf_height
+       h = args.buf_height
        print ('cut the Image height to',args.buf_width)

Showing the three lines, and using 'od -c' to show all the actual characters :-

$ sed -ne '56,58p' < convertfb
if(h > args.buf_width):
        h = args.buf_height
        print ('cut the Image height to',args.buf_width)

$ sed -ne '56,58p' < convertfb | od -c
0000000   i   f   (   h       >       a   r   g   s   .   b   u   f   _
0000020   w   i   d   t   h   )   :  \n      \t   h       =       a   r
0000040   g   s   .   b   u   f   _   h   e   i   g   h   t  \n  \t   p
0000060   r   i   n   t       (   '   c   u   t       t   h   e       I
0000100   m   a   g   e       h   e   i   g   h   t       t   o   '   ,
0000120   a   r   g   s   .   b   u   f   _   w   i   d   t   h   )  \n
0000140

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions