jazzband / django-push-notifications

Send push notifications to mobile devices through GCM or APNS in Django.
MIT License
2.26k stars 613 forks source link

Python crashes on runserver when django-push-notifications is enabled #549

Closed nlittlejohns closed 4 years ago

nlittlejohns commented 4 years ago

Just installed Django-push-notifications 1.6.1 via pip, added it to my installed_apps and configured for APNS.

When I run manage.py runserver, python crashes with this message: zsh: abort env PYTHONIOENCODING=UTF-8 PYTHONUNBUFFERED=1 --default --client --host

If I run Python in verbose mode, these are the last few lines:

# code object from '/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/macholib/__pycache__/dylib.cpython-37.pyc'
import 'ctypes.macholib.dylib' # <_frozen_importlib_external.SourceFileLoader object at 0x10492f6d0>
import 'ctypes.macholib.dyld' # <_frozen_importlib_external.SourceFileLoader object at 0x104921550>
import 'ctypes.util' # <_frozen_importlib_external.SourceFileLoader object at 0x1049098d0>
zsh: abort      python -v manage.py runserver

running python manage.py runserver --verbosity 3 returns no additional output.

Using Python 3.7.4 and Django 2.2.9, any suggestions? I've never seen it just crash like this. The crash goes away as soon as I remove push_notifications from my installed apps.

(Running on macOS Catalina in a virtual env)

Edit: I've tried re-building my environment fresh and installing Django-push-notifications from Git instead of pip to get the latest. I still get the same crash. Perhaps there's a conflict with another package I'm using? Here's a list of what I have installed:

Package                    Version   
-------------------------- ----------
apns2                      0.7.1     
asgiref                    3.2.3     
asn1crypto                 0.24.0    
astroid                    2.2.5     
async-timeout              3.0.1     
attrs                      19.1.0    
autobahn                   19.6.2    
Automat                    0.7.0     
autopep8                   1.4.4     
cached-property            1.5.1     
certifi                    2019.11.28
cffi                       1.12.3    
channels                   2.2.0     
chardet                    3.0.4     
constantly                 15.1.0    
cryptography               2.7       
daphne                     2.3.0     
dj-database-url            0.5.0     
Django                     3.0.2     
django-crispy-forms        1.8.1     
django-extensions          2.2.6     
django-formset-js          0.5.0     
django-guardian            2.1.0     
django-jquery-js           3.1.1     
django-progressive-web-app 0.1.1     
django-push-notifications  2.0.0     
django-recurrence          1.10.1    
django-reset-migrations    0.4.0     
django-tempus-dominus      5.1.2.9   
django-url-filter          0.3.14    
djangorestframework        3.11.0    
enum-compat                0.0.3     
h2                         2.6.2     
hpack                      3.0.0     
http-ece                   1.1.0     
hyper                      0.7.0     
hyperframe                 3.2.0     
hyperlink                  19.0.0    
icalendar                  4.0.3     
idna                       2.8       
incremental                17.5.0    
isort                      4.3.20    
lazy-object-proxy          1.4.1     
mccabe                     0.6.1     
Pillow                     6.0.0     
pip                        19.3.1    
psycopg2-binary            2.8.3     
py-vapid                   1.7.0     
pycodestyle                2.5.0     
pycparser                  2.19      
PyHamcrest                 1.9.0     
PyJWT                      1.7.1     
pylint                     2.3.1     
python-dateutil            2.8.0     
python-decouple            3.1       
pytz                       2019.3    
pywebpush                  1.10.1    
requests                   2.22.0    
setuptools                 45.0.0    
six                        1.12.0    
sqlparse                   0.3.0     
Twisted                    19.2.1    
txaio                      18.8.1    
typed-ast                  1.4.0     
urllib3                    1.25.7    
wheel                      0.33.6    
wrapt                      1.11.2    
zope.interface             4.6.0     
nlittlejohns commented 4 years ago

Ok, figured out where the conflict was: cryptography 2.7.

Can't actually figure out where this requirement came from in the first place, it seems I've ended up with quite a few extra packages installed that I don't need. Did a clean sweep and just installed the barebones and it seems happy now!

CARocha commented 4 years ago

i have same error in catalina i fix uninstall asn1crypto 0.24.0 and install lastest version

anugurti-pranaykumar commented 4 years ago

Thanks CARocha reinstalling asn1crypto , solved