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
Config masks exceptions from ConfigParser #3433
Comments
What version of python 3 are you using? I'm trying to repro the issue. I made a small change to raise exceptions on TypeErrors just to see if I could get the same error:
Using this script:
I get this output on python 3.4:
Boto supports python3, so if there's any issues you're seeing I'd like to get them fixed. I do agree that we should probably remove the bare except clauses in that module. But first I'd like to track down what's going wrong here. |
This was on a work computer, and I'm away from it for another week, so I can't verify it immediately. However, it should have been python 3.5.1. I suspect the issue arose from the change in 3.2:
However, you should have this change in your version. Additionally, looking at the code now, both the excerpt I listed in the issue and the CPython implementation, I'm not sure where that error would come from. When I get back into work, I'll poke at my machine and see what's happening. |
We've just run into this problem as well. It seems to be related to the configparser changes in Python 3.5.1 as it works on Python 3.5.0. |
I believe the python tracking issue that introduced this bug is http://bugs.python.org/issue21159. There is a comment that it is causing problems in various libraries (including boto): http://bugs.python.org/issue21159#msg257662 It was introduced in python 3.5.1 and python 3.4.4, I think. |
Just encountered this too. Very annoying to track down with the blanket |
hit the same error. |
The current file storage backend, S3BotoStorage, [cannot be used for Python versions >=3.4.4](boto/boto#3433). Therfore we need to update the plugin to use the S3Boto3Storage which uses a different configuration logic. As a result, the following configuration parameters are changed: * `S3_ADDRESSING_STYLE` is added; * `S3_SIGNATURE_VERSION` is added; * `S3_REGION` is added; * `S3_AUTO_CREATE_BUCKET` is removed; Also we switch to presigned URLs which removes the need for setting bucket ACL to be public. Fixes: hastexo#8
The current file storage backend, S3BotoStorage, cannot be used for Python versions >=3.4.4 (boto/boto#3433). Therfore we need to update the plugin to use the S3Boto3Storage which uses a different configuration logic. As a result, the following configuration parameters are changed: - S3_ADDRESSING_STYLE is added; - S3_SIGNATURE_VERSION is added; - S3_REGION is added; - S3_AUTO_CREATE_BUCKET is removed; Also we switch to presigned URLs which removes the need for setting bucket ACL to be public. Fixes: hastexo#8
The current file storage backend, S3BotoStorage, cannot be used for Python versions >=3.4.4 (boto/boto#3433). Therfore we need to update the plugin to use the S3Boto3Storage which uses a different configuration logic. As a result, the following configuration parameters are changed: - S3_ADDRESSING_STYLE is added; - S3_SIGNATURE_VERSION is added; - S3_REGION is added; - S3_AUTO_CREATE_BUCKET is removed; Also we switch to presigned URLs which removes the need for setting bucket ACL to be public. Additionally, "contrib" is added to the package name to differentiate this plugin from official Tutor plugins. Fixes: hastexo#8
In upstream openedx-platform, if COURSE_IMPORT_EXPORT_BUCKET is set, COURSE_IMPORT_EXPORT_STORAGE will be set to ImportExportS3Storage which is a subclass of S3BotoStorage (https://github.com/edx/edx-platform/blob/master/cms/envs/production.py#L340). S3BotoStorage will break for Python versions >= 3.4.4 (see boto/boto#3433). Therefor we remove the COURSE_IMPORT_EXPORT_BUCKET parameter until this is fixed in upstream edx-platform.
In upstream openedx-platform, if COURSE_IMPORT_EXPORT_BUCKET is set, COURSE_IMPORT_EXPORT_STORAGE will be set to ImportExportS3Storage which is a subclass of S3BotoStorage (https://github.com/edx/edx-platform/blob/master/cms/envs/production.py#L340). S3BotoStorage will break for Python versions >= 3.4.4 (see boto/boto#3433). Therefor we remove the COURSE_IMPORT_EXPORT_BUCKET parameter until this is fixed in upstream edx-platform.
I spent a while trying to figure out why boto wasn't authenticating, to find out eventually that it's because it's not supported on Python 3. That was I suppose my fault for not checking, but it ended up being a bit more difficult than it should've because of how boto is swallowing exceptions.
In the
Config
class, we've got methods like this:The ConfigParser line raises an exception in Python 3:
but unfortunately, this is swallowed by the
except
. As a result, the default value is used, and no indication is ever given to the user that anything is wrong. This is particularly annoying to track down because increasing the debug level in the configuration file is silently ignored (because everything in there is!), so it takes some digging around in the shell to even start on the path to find out what's going on.I don't know enough about boto to know when an exception is expected, but if someone can provide some historical information on that subject, I'd be glad to prepare a patch to change the
except
s throughoutConfig
.The text was updated successfully, but these errors were encountered: