Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabError #4

Open
jimcheetham opened this issue Jul 21, 2024 · 0 comments
Open

TabError #4

jimcheetham opened this issue Jul 21, 2024 · 0 comments

Comments

@jimcheetham
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant