From cfc3213bb02d2d5af2eb5576b6eaafe9b5691de9 Mon Sep 17 00:00:00 2001 From: Ali Serwat <82939264+AliSerwat@users.noreply.github.com> Date: Thu, 4 Jul 2024 21:25:47 +0330 Subject: [PATCH] Update disk.py Solution for import error: "cannot import name 'BytesType' from 'diskcache.core'" during running "p2ch10_explore_data.ipynb" --- util/disk.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/util/disk.py b/util/disk.py index 091d2bb..4b51198 100644 --- a/util/disk.py +++ b/util/disk.py @@ -1,9 +1,15 @@ +from util.logconf import logging +import io import gzip from diskcache import FanoutCache, Disk -from diskcache.core import BytesType, MODE_BINARY, BytesIO +# delete BytesType and BytesIO declarations +from diskcache.core import MODE_BINARY + +BytesType = bytes # Import them by ourselves +BytesIO = io.BytesIO + -from util.logconf import logging log = logging.getLogger(__name__) # log.setLevel(logging.WARN) log.setLevel(logging.INFO)