GoogleCloudPlatform / GoogleCloudPlatform/appengine-python-standard

NDB_PY2_UNPICKLE_COMPAT?

Đang mở
#103 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
86
Fork
61
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

There is an env var being checked in a couple places that I don't see mentioned outside the code:
```
class PickleProperty(BlobProperty):
...
def _from_base_type(self, value):
try:
return pickle.loads(value)
except UnicodeDecodeError:
if int(os.environ.get('NDB_PY2_UNPICKLE_COMPAT', '0')):
return pickle.loads(value, encoding='bytes')
raise
```
```
class Key(object):
...
def __new__(cls, *_args, **kwargs):
...
if int(os.environ.get('NDB_PY2_UNPICKLE_COMPAT', '0')):
kwargs = {six.ensure_str(k): v for (k, v) in kwargs.items()}
```
Should we set this, is it set for us, should we avoid it?
I'm running into some assorted pickle-related issues which had me looking at [this (not-so-)recent change](https://github.com/GoogleCloudPlatform/appengine-python-standard/pull/88), and it's a bit tricky to figure out if it's better to try more "global" sorts of fixes or just site-specific workarounds to avoid dealing with messier problems.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.