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

error variable size #15

Open
jrzeponi opened this issue May 8, 2020 · 3 comments
Open

error variable size #15

jrzeponi opened this issue May 8, 2020 · 3 comments

Comments

@jrzeponi
Copy link

jrzeponi commented May 8, 2020

Describe the bug
I using script after install get error of pv expect integer argument

To Reproduce

$ tar-progress -cf /home/bkp/mozila_geral.tar .cache/mozilla .mozilla
pv: -s: integer argument expected
tar: -: Função write falhou: Pipe quebrado
tar: Error is not recoverable: exiting now

Expected behavior
Expect this work without problem, like this way

$ tar-progress -cf /home/bkp/mozila_geral.tar .cache/mozilla .mozilla
1,44GiB 0:00:06 [ 229MiB/s] [=================================================================================================================] 102% 

System Information(please complete the following information):

  • OS: Manjaro 20.0
  • Version tar-progress 1.3.3

Additional context
To fix it i change file

/usr/lib/python3.8/site-packages/tar_progress/classes/linux.py

I change on lines 35, 37, 39, 41
Original lines

    34          if compression == "gz":
    35              command = "tar -cf - " + files + " | pv -s " + size + " | gzip > " + filename
    36          elif compression == "bz2":
    37              command = "tar -cf - " + files + " | pv -s " + size + " | bzip2 > " + filename
    38          elif compression == "xz":
    39              command = "tar -cf - " + files + " | pv -s " + size + " | xz > " + filename
    40          else:
    41              command = "tar -cf - " + files + " | pv -s " + size + " > " + filename
    42          os.system(command)

Changed

    34          if compression == "gz":
    35              command = "tar -cf - " + files + " | pv -s " + size.decode() + " | gzip > " + filename
    36          elif compression == "bz2":
    37              command = "tar -cf - " + files + " | pv -s " + size.decode() + " | bzip2 > " + filename
    38          elif compression == "xz":
    39              command = "tar -cf - " + files + " | pv -s " + size.decode() + " | xz > " + filename
    40          else:
    41              command = "tar -cf - " + files + " | pv -s " + size.decode() + " > " + filename
    42          os.system(command)

I just decode variable size

PS: First contribute sorry with I forgotten something

@henri9813
Copy link
Owner

Hello,

Thank you very much for your feedback !

Can you please tell me what python version you are using ?

Henri

@henri9813
Copy link
Owner

@jrzeponi which python version are you using ?

@jrzeponi
Copy link
Author

@henri9813 sorry I hadn't this version any more, it was 3.8, but I can't specify release of that, because system upgrade to 3.9

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

2 participants