-
Notifications
You must be signed in to change notification settings - Fork 835
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
SlackApiError cannot be unpickled #1291
Comments
Hi @youtux, thanks for writing in! First off, I would suggest catching the exception in your async code and generate some object or your own exception, which is serializable instead. The response object has its state for pagination (more specifically, reference to WebClient instance). So, we don't recommend trying to enable the object pickle-ready to avoid potential misbehavior. Also, even if we decide to enhance this SDK for this use case in the future, the change won't come to slackclient v2. The reason is that, unfortunately, we are no longer actively working on the v2 SDK (except critical security fixes). It'd be appreciated if you could understand this. |
I understand that, still it would greatly help if this exception was picklable, even if that means to lose pagination (you can remove the reference to the WebClient instance by overriding
That wouldn't be a problem, I can upgrade to v3. |
I can open a PR if you agree. |
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized. |
Still an issue |
Hi @youtux, I've excluded this issue from the auto-triage process to repeat the same one month later. With that being said, we won't make the changes that you suggested at least in the short term (for the reason I mentioned above, plus due to your priorities as the whole team -- we're focusing on the next-generation platform project now). As I mentioned in my first rely, please consider a different approach for your use case. |
SlackApiError
raises an error when trying to unpickle it.This is particularly annoying in a Celery task since another bug in celery will cause the whole worker node to fail.
The Slack SDK version
2.9.4
Python runtime version
3.11.0
OS info
ProductName: macOS
ProductVersion: 13.0
BuildVersion: 22A380
Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000
Steps to reproduce:
Expected result:
No error.
Actual result:
Solution
The SlackApiError could be implemented in such a way that the constructor accepts only the message, and the response defaults to None. Then the string representation can be delegated to
__str__
:The text was updated successfully, but these errors were encountered: