Open biffyw opened 3 months ago
@biffyw Hi! I will fix this asap
Hi again,
I did an editable install of the project and fixed the function signature, but then this happened:
File "/usr/lib/python3.9/zipfile.py", line 722, in __init__
self.seekable = file.seekable
AttributeError: 'BytesIOProxy' object has no attribute 'seekable'
So I added the Seekable attribute and now my use case works as expected. Here is the diff:
diff --git a/ombott/request_pkg/multipart.py b/ombott/request_pkg/multipart.py
index fc5b7e6..d0b13b7 100644
--- a/ombott/request_pkg/multipart.py
+++ b/ombott/request_pkg/multipart.py
@@ -345,7 +345,7 @@ class BytesIOProxy:
def tell(self) -> int:
return self._pos - self._st
- def seek(self, pos: int):
+ def seek(self, pos: int, whence: int = 0):
if pos < 0:
pos = 0
self._pos = min(self._st + pos, self._end)
@@ -365,6 +365,9 @@ class BytesIOProxy:
def writable(self) -> bool:
return False
+ def seekable(self) -> bool:
+ return True
+
def fileno(self):
raise OSError('Not supported')
@biffyw fine! But i think we need to implement whence
-feature as it should be
@biffyw Hi!, test, please: https://github.com/valq7711/ombott/tree/improve-bytes-io-proxy
Working as expected, thank you! This being the first time I've opened an issue , do I close it or do you?
FYI, I saw this in the py4web group: https://groups.google.com/g/py4web/c/7TfrgaZDVzI
The object being passed to ExcelReader is an ombott.request_pkg.multipart.BytesIOProxy object.
I'm using py4web 1.20240602.1 with openpxyl 3.1.4 and ombott 2.0 My same code works fine with py4web 1.20230528.1, openpyxl 3.1.2 and ombott 1.0.0 but I can see a lot changed... In both cases, interpreter is python 3.9.2 in separate virtual environments on Windows 10 Pro Build 19045
Happy to provide any additional details, thanks in advance.