Comments (7)
I got this error, too. I solved by setting encoding to UTF-8.
pyrax.encoding = "utf-8"
According to the documentation, the encoding is supposed to be UTF-8 by default. I think this is a bug.
from pyrax.
There is an error in line 25 of your script:
upload_key, total_bytes = cf_ord.sync_folder_to_container(folder, container, delete=True, include_hidden=True, ignore_timestamps=True)
You are using the method signature for cf.upload_folder()
; cf.sync_folder_to_container()
doesn't run in the background.
That doesn't explain the encoding issue, though. Make sure that you don't have an encoding =
entry in your .pyrax.cfg file, and then in your script, add this line right after you import pyrax:
print "Encoding:", pyrax.encoding
That should print 'utf-8', which is the default.
from pyrax.
No pyrax.cfg in use.
Updated the code: https://github.com/Linuturk/www.onitato.com/blob/master/cf_pyrax.py
Updated Output:
Encoding: None
Syncing all objects to www.onitato.com container from folder /var/lib/jenkins/workspace/www.onitato.com/output/.
Sync complete.
from pyrax.
@EdLeafe I, too, have experienced this error without using a configuration file at all:
>>> import pyrax
>>> pyrax.set_credentials('dustinfarris', 'xxxapikeyxxx')
>>> connection = pyrax.connect_to_couldfiles(region="ORD")
>>> container = connection.get_container("dustinfarris")
>>> connection.sync_folder_to_container("/Users/dustin/Documents/", container)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/dustin/.virtualenvs/dustinfarris/lib/python2.7/site-packages/pyrax/cf_wrapper/client.py", line 516, in sync_folder_to_container
include_hidden=include_hidden, ignore_timestamps=ignore_timestamps)
File "/Users/dustin/.virtualenvs/dustinfarris/lib/python2.7/site-packages/pyrax/cf_wrapper/client.py", line 542, in _sync_folder_to_container
obj = cont.get_object(fullname)
File "/Users/dustin/.virtualenvs/dustinfarris/lib/python2.7/site-packages/pyrax/cf_wrapper/container.py", line 85, in get_object
name = name.decode(pyrax.encoding)
TypeError: decode() argument 1 must be string, not None
>>>
As I mentioned above, explicitly setting pyrax.encoding to "utf-8" resolves the error.
from pyrax.
@EdLeafe Unless _read_config_settings is actually called, encoding is set to None. You never actually set this variable anywhere else than in the mentioned function.
from pyrax.
Ah, I see it now - thanks. I will have this fixed soon, and will include the fix to issue #10, too.
from pyrax.
Please test with the current 'working' branch and let me know if you still see any issues.
from pyrax.
Related Issues (20)
- CloudFiles set_temp_url_key and get_temp_url_key Bug HOT 2
- pyrax.cloud_dns.list limited to 100 HOT 1
- requests 2.11.0 breaks pyrax ttl HOT 2
- Support for specific python-novaclient version HOT 14
- pyrax - out of date HOT 2
- Search for [email protected] and remove HOT 3
- delete operations don't return anything
- Remove pbr version pinning HOT 4
- Handling whitespace using pyrax
- 💖 Open for maintainers : adopt pyrax HOT 6
- Switch from using pep8 to flake8 for syntax/linting HOT 1
- Sporadic CI flakiness HOT 1
- pyrax is required for this module
- pyrax.exceptions.NotFound: No CloudDNSDomain matching: {'name': u'com'}. (HTTP 404)
- rackspacesdk doesn't work HOT 2
- why cant install wrapt module
- Release the latest code as 1.9.9 HOT 1
- Proposing a PR to fix a few small typos HOT 2
- TypeError __init__() got an unexpected keyword argument 'username'
- Tenant_id parsing is not working due to different response from API_KEY authentication in some usser HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyrax.