bugen / pypipe

Python pipe command line tool
Apache License 2.0
796 stars 24 forks source link

Request for fix: the ppp rec section echo example #13

Closed horw closed 10 months ago

horw commented 10 months ago

Hi, the following example doesn't work properly for me:

echo 'Hello10010.2True{"id":100,"title":"sample"}'|./ppp rec -l5 -t 2:i,3:f,4:b,5:j "type(f1),type(f2),type(f3),type(f4),type(f5)"

I received an error message:

Traceback (most recent call last):
  File "/home/horw/PycharmProjects/pypipe/./ppp", line 694, in <module>
    args.handler(args)
  File "/home/horw/PycharmProjects/pypipe/./ppp", line 361, in rec_handler
    exec_code(code, args)
  File "/home/horw/PycharmProjects/pypipe/./ppp", line 187, in exec_code
    _exec_code(code, args)
  File "/home/horw/PycharmProjects/pypipe/./ppp", line 182, in _exec_code
    exec(compile(code, '<string>', 'exec'), _globals)
  File "<string>", line 29, in <module>
ValueError: not enough values to unpack (expected 5, got 1)
bugen commented 10 months ago

In my environment, I don't encounter any errors. It is speculated that the tab characters are being converted to spaces when copying examples from the README based on the error message.

horw commented 10 months ago

I retried it again, and for me, I used this command, but it still has an error. I tried it in a different environment.

echo 'Hello10010.2True{"id":100,"title":"sample"}'|./ppp rec -l5 -t 2:i,3:f,4:b,5:j "type(f1),type(f2),type(f3),type(f4),type(f5)"
horw commented 10 months ago

I got it, the problem was with the Fish terminal(Bash works ok). You are right; it looks like tab characters in 'Hello 100 10.2 True {"id":100,"title":"sample"}' were replaced with spaces. Thanks for your help

bugen commented 10 months ago

It seems to have been resolved, so I will close this issue.