Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.

tempfile._TemporaryFileWrapper not available under Google Appengine #106

Closed
cdman opened this issue Oct 4, 2016 · 6 comments
Closed

tempfile._TemporaryFileWrapper not available under Google Appengine #106

cdman opened this issue Oct 4, 2016 · 6 comments
Labels

Comments

@cdman
Copy link

cdman commented Oct 4, 2016

Google appengine replaces the tempfile module with a custom one (since you can't write to the FS under "traditional" GAE): https://code.google.com/p/googleappengine/source/browse/trunk/python/google/appengine/dist/tempfile.py

However this module lacks the _TemporaryFileWrapper on which utils.DownloadedFile is based: https://github.com/core-api/python-client/blob/master/coreapi/utils.py#L119

Given that _TemporaryFileWrapper is an undocumented API (class) IMHO the dependency on it should be removed.

@tomchristie
Copy link
Contributor

👍 Good call.

@tomchristie
Copy link
Contributor

Worth noting that even when we do resolve this, the DownloadCodec still wouldn't work under GAE, but that's much less of a concern. (Ie. at least everything else will work.)

@tomchristie tomchristie added the bug label Oct 4, 2016
@canthonyscott
Copy link

Is there any workaround for this? I am trying to deploy an app to the Google App Engine standard python environment and this is causing Django to crash on load.

For the record everything works fine in the GAE flexible environment, but not in the standard environment.

@cdman
Copy link
Author

cdman commented Oct 15, 2016

It seems to me that rather than using _TemporaryFileWrapper, we should use NamedTemporaryFile - which is a function, not a class. This would "work" on GAE in the sense that the module would load (but calling it would still raise a NotImplementedError).

@tomchristie
Copy link
Contributor

Hoping to look into resolving this sometime over the next few days.
Pull requests welcome in the meantime.

@tomchristie
Copy link
Contributor

Okay, that should be resolved now. If anyone wants to confirm that'd be fab.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants