Coder Social home page Coder Social logo

s3pub's People

Contributors

rene-armida avatar

Watchers

 avatar  avatar

s3pub's Issues

Missing dependencies: PyYAML

Installing without dependencies in development.txt leads to ImportError during run

Traceback (most recent call last):
  File "/home/marmida/venvs/s3pub-test/bin/s3pub", line 9, in <module>
    load_entry_point('s3pub==0.1.0', 'console_scripts', 's3pub')()
  File "/home/marmida/venvs/s3pub-test/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 546, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/marmida/venvs/s3pub-test/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2666, in load_entry_point
    return ep.load()
  File "/home/marmida/venvs/s3pub-test/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2339, in load
    return self.resolve()
  File "/home/marmida/venvs/s3pub-test/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2345, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/marmida/venvs/s3pub-test/local/lib/python2.7/site-packages/s3pub/cmdline.py", line 9, in <module>
    import yaml
ImportError: No module named yaml

Py3 problem: AttributeError

Trying a basic run under Python 3 causes this error:

(s3pub-test-py3)marmida@longan:~/develop/s3pub$ PYTHONPATH=. python s3pub/cmdline.py /tmp/testup/ s3pub-test/up20150903/
Traceback (most recent call last):
  File "s3pub/cmdline.py", line 155, in <module>
    main()
  File "s3pub/cmdline.py", line 146, in main
    args.src.decode('utf-8'),
AttributeError: 'str' object has no attribute 'decode'

Py3 unit test errors: string handling

Unit tests fail under Python 3 because of string / unicode changes:

(s3pub-test-py3)marmida@longan:~/develop/s3pub$ nosetests
................................EE
======================================================================
ERROR: do_upload: returns only modified keys when there is no index document.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/marmida/venvs/s3pub-test-py3/lib/python3.4/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/marmida/develop/s3pub/s3pub/tests/test_upload.py", line 247, in wrapped
    return func(mock_todos, mock_connection, mock_creds)
  File "/home/marmida/develop/s3pub/s3pub/tests/test_upload.py", line 257, in test_do_upload_no_website
    set(upload.do_upload('bogus', 'bogus', False, mock_creds)),
  File "/home/marmida/develop/s3pub/s3pub/upload.py", line 150, in do_upload
    dict((lpath, info[2]) for lpath, (info, _) in iteritems(to_upload)))
  File "/home/marmida/develop/s3pub/s3pub/progress.py", line 30, in __init__
    progressbar.Bar(left='[', right=']'),
  File "/home/marmida/venvs/s3pub-test-py3/lib/python3.4/site-packages/progressbar/widgets.py", line 354, in __init__
    self.marker = _marker(marker)
  File "/home/marmida/venvs/s3pub-test-py3/lib/python3.4/site-packages/progressbar/widgets.py", line 348, in _marker
    if isinstance(marker, basestring):
NameError: name 'basestring' is not defined

======================================================================
ERROR: do_upload: adds directory paths when index documents are invalidated.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/marmida/venvs/s3pub-test-py3/lib/python3.4/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/marmida/develop/s3pub/s3pub/tests/test_upload.py", line 247, in wrapped
    return func(mock_todos, mock_connection, mock_creds)
  File "/home/marmida/develop/s3pub/s3pub/tests/test_upload.py", line 283, in test_do_upload_with_website
    set(upload.do_upload('bogus', 'bogus', False, mock_creds)),
  File "/home/marmida/develop/s3pub/s3pub/upload.py", line 150, in do_upload
    dict((lpath, info[2]) for lpath, (info, _) in iteritems(to_upload)))
  File "/home/marmida/develop/s3pub/s3pub/progress.py", line 30, in __init__
    progressbar.Bar(left='[', right=']'),
  File "/home/marmida/venvs/s3pub-test-py3/lib/python3.4/site-packages/progressbar/widgets.py", line 354, in __init__
    self.marker = _marker(marker)
  File "/home/marmida/venvs/s3pub-test-py3/lib/python3.4/site-packages/progressbar/widgets.py", line 348, in _marker
    if isinstance(marker, basestring):
NameError: name 'basestring' is not defined

----------------------------------------------------------------------
Ran 34 tests in 0.086s

FAILED (errors=2)

Second run with same parameters deletes files

This is a real nasty behavior: when run a second time with the same parameters, it looks like s3pub deletes the files just uploaded the first time, even though it goes through the work to upload the files:

(s3pub)marmida@longan:/tmp/what$ s3pub . sdna-web-test/s3pub-test/
./adir/bfile (2/2) 100% [###########################################################] Time: 0:00:00  34.10  B/s
(s3pub)marmida@longan:/tmp/what$ /app/bin/s3cmd ls -r s3://sdna-web-test/
2015-09-09 19:55         9   s3://sdna-web-test/s3pub-test/adir/bfile
2015-09-09 19:55         6   s3://sdna-web-test/s3pub-test/afile
(s3pub)marmida@longan:/tmp/what$ s3pub . sdna-web-test/s3pub-test/       
./adir/bfile (2/2) 100% [###########################################################] Time: 0:00:00  33.78  B/s
(s3pub)marmida@longan:/tmp/what$ /app/bin/s3cmd ls -r s3://sdna-web-test/
(s3pub)marmida@longan:/tmp/what$

First, the files should not be modified - they should all be skipped, because the local files match the contents of the remote files.

Second, the files should certainly not be deleted. The program instead should exit without making any modifications or producing any output, even progress bar output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.