import tarfile


with tarfile.open('/tmp/quandl-xjpx.tar', 'w') as f:
    f.add('/tmp/quandl-xjpx')

import tarfile
import os


with tarfile.open('/tmp/quandl-xjpx.tar', 'w') as f:
    os.chdir('/tmp/quandl-xjpx')
    for fn in os.listdir('.'):
        f.add(fn)

Fix bug on transform quandl archive
Fix bug on transform quandl archive

  import tarfile
+ import os
  
  
  with tarfile.open('/tmp/quandl-xjpx.tar', 'w') as f:
-     f.add('/tmp/quandl-xjpx')
+     os.chdir('/tmp/quandl-xjpx')
+     for fn in os.listdir('.'):
+         f.add(fn)
  
Fix bug on transform quandl archive
## Code Before:
import tarfile


with tarfile.open('/tmp/quandl-xjpx.tar', 'w') as f:
    f.add('/tmp/quandl-xjpx')

## Instruction:
Fix bug on transform quandl archive
## Code After:
import tarfile
import os


with tarfile.open('/tmp/quandl-xjpx.tar', 'w') as f:
    os.chdir('/tmp/quandl-xjpx')
    for fn in os.listdir('.'):
        f.add(fn)
