Re: How to display PendingDeprecationWarning using dev. server?
Any ideas? Can anyone else try this and report back? Just insert the code below into a view function and start the dev. server with "python -Wall manage.py runserver". Thanks. On Feb 28, 5:28 pm, Brian Neal wrote: > I'm having trouble seeing PendingDeprecationWarning's on stderr when > using the dev server. > > To make sure I'm not crazy, I wrote a simple Python program that looks > like this: > > print "** WARNING **" > import warnings > warnings.warn( > "Testing the warnings module!", > PendingDeprecationWarning > ) > > And here are some sample runs: > > $ python warning.py > ** WARNING ** > $ python -Wall warning.py > ** WARNING ** > warning.py:5: PendingDeprecationWarning: Testing the warnings module! > PendingDeprecationWarning > > Now when I put that code in some view function in my Django app, I > always see the print statement output, but never the actual warning > message. I've tried starting the dev. server various ways, but none of > them seem to work: > > $python -Wall manage.py runserver > $python -Wd manage.py runserver > > I only seem to have this trouble with PendingDeprecationWarning. > UserWarning, for example, works as expected. > > What am I doing wrong? I am using Python 2.5.2 and Django SVN r12623. > Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: How to display PendingDeprecationWarning using dev. server?
On Mar 6, 2:28 am, Brian Neal wrote: > Any ideas? Can anyone else try this and report back? Just insert the > code below into a view function and start the dev. server with "python > -Wall manage.py runserver". Thanks. Hi, Just to confirm I tried it and can't see them either, on python 2.6. Don't know enough about them to shed any light on the subject, but it isn't just you! Peter -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: How to display PendingDeprecationWarning using dev. server?
On Fri, Mar 5, 2010 at 9:28 PM, Brian Neal wrote: > Any ideas? Can anyone else try this and report back? Just insert the > code below into a view function and start the dev. server with "python > -Wall manage.py runserver". Thanks. > This appears to be due to the way runserver reloads the process when monitoring for source code changes. If you specify --noreload on runserver I bet you will see the warnings. The behavior appears to be OS-specific: I can recreate what you describe on Ubuntu, but on Windows machine the warnings are printing properly. Karen > On Feb 28, 5:28 pm, Brian Neal wrote: > > I'm having trouble seeing PendingDeprecationWarning's on stderr when > > using the dev server. > > > > To make sure I'm not crazy, I wrote a simple Python program that looks > > like this: > > > > print "** WARNING **" > > import warnings > > warnings.warn( > > "Testing the warnings module!", > > PendingDeprecationWarning > > ) > > > > And here are some sample runs: > > > > $ python warning.py > > ** WARNING ** > > $ python -Wall warning.py > > ** WARNING ** > > warning.py:5: PendingDeprecationWarning: Testing the warnings module! > > PendingDeprecationWarning > > > > Now when I put that code in some view function in my Django app, I > > always see the print statement output, but never the actual warning > > message. I've tried starting the dev. server various ways, but none of > > them seem to work: > > > > $python -Wall manage.py runserver > > $python -Wd manage.py runserver > > > > I only seem to have this trouble with PendingDeprecationWarning. > > UserWarning, for example, works as expected. > > > > What am I doing wrong? I am using Python 2.5.2 and Django SVN r12623. > > Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: How to display PendingDeprecationWarning using dev. server?
On Mar 6, 10:29 am, Karen Tracey wrote: > This appears to be due to the way runserver reloads the process when > monitoring for source code changes. If you specify --noreload on runserver > I bet you will see the warnings. The behavior appears to be OS-specific: I > can recreate what you describe on Ubuntu, but on Windows machine the > warnings are printing properly. > > Karen > Thanks Karen. Yes, I'm using Ubuntu, and running with --noreload allows me to see the PendingDeprecationWarning. Is this worthy of a bug report? Regards, BN -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: How to display PendingDeprecationWarning using dev. server?
On Sat, Mar 6, 2010 at 11:53 AM, Brian Neal wrote: > Thanks Karen. Yes, I'm using Ubuntu, and running with --noreload > allows me to see the PendingDeprecationWarning. Is this worthy of a > bug report? > Sure. Just please don't put it in the 1.2 milestone; it's not a release blocker. Karen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.