Skip to content
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

Make it to serve Python 3.6--currently not solving #40

Open
ghost opened this issue Feb 8, 2018 · 4 comments
Open

Make it to serve Python 3.6--currently not solving #40

ghost opened this issue Feb 8, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Feb 8, 2018

Hi Mitch,

maybe when you have time pls update this source code to be compatible with python 3 and the rest of them etc. Currently not working :( and it sucks cos it gaves a lot of errors.

@HassenPy
Copy link
Owner

HassenPy commented Feb 9, 2018

Hi there @iocohen,

I ll take a look at this issue this weekend.
Also, I'm planning to rewrite the whole project, also dropping support to older django versions and python 2 (freezing them on another branch so they're accessible), so any other suggestions are more than welcome.

Thanks!

@HassenPy
Copy link
Owner

HassenPy commented Mar 1, 2018

hey @iocohen, can you please add any traceback to the errors you're getting?

@jfw
Copy link

jfw commented Jun 11, 2018

I'm also having issues with it in py3.6, w/ Django 1.11.13, here's a traceback:

Traceback (most recent call last):            
  File "/home/jfw/.virtualenvs/phoneslate/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner                                                               
    response = get_response(request)          
  File "/home/jfw/.virtualenvs/phoneslate/lib/python3.6/site-packages/django/utils/deprecation.py", line 140, in __call__                                                                 
    response = self.get_response(request)     
  File "/home/jfw/.virtualenvs/phoneslate/lib/python3.6/site-packages/django/core/handlers/exception.py", line 43, in inner                                                               
    response = response_for_exception(request, exc)                                          
  File "/home/jfw/.virtualenvs/phoneslate/lib/python3.6/site-packages/django/core/handlers/exception.py", line 83, in response_for_exception                                              
    response = debug.technical_500_response(request, *sys.exc_info(), status_code=400)       
TypeError: runpdb() got an unexpected keyword argument 'status_code'                         
Exception occured: <class 'TypeError'>, runpdb() got an unexpected keyword argument 'status_code'                                                                                         
> /home/jfw/.virtualenvs/phoneslate/lib/python3.6/site-packages/django/core/handlers/exception.py(83)response_for_exception()                                                             
     82         if settings.DEBUG:            
---> 83             response = debug.technical_500_response(request, *sys.exc_info(), status_code=400)                                                                                    
     84         else:  

Looks like the method you're replacing w/ runpdb allows for a status_code kwarg: https://github.com/django/django/blob/e8531cc89c878b6a8867498dab266917fef2bff4/django/views/debug.py#L84

@gh640
Copy link
Contributor

gh640 commented Jun 12, 2018

As @jfw told, the error @jfw met seems to be caused when unexpected status_code is passed to runpdb.

def runpdb(request, exc_type, exc_value, tb):
import sys
try:
import ipdb
except ImportError:
import pdb as ipdb
p = ipdb
print('Exception occured: {}, {}'.format(exc_type, exc_value), file=sys.stderr)
p.post_mortem(tb)
debug.technical_500_response = runpdb

The replaced function technical_500_response in Django core was changed in the following commit:

django/django@dbbcfca#diff-0c275b0ae46e69a41401fe13da9b1b39L68

Changing the runpdb should solve the issue.

gh640 added a commit to gh640/django-pdb that referenced this issue Jun 12, 2018
stuaxo added a commit to stuaxo/django-pdb that referenced this issue Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants