#21546 closed Cleanup/optimization (fixed)

ValueError when tracing runserver.

Reported by: loic84 Owned by: aaugustin
Component: Core (Management commands) Version: master
Severity: Normal Keywords:
Cc: aaugustin Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

python -m trace --trace project/manage.py runserver trips on NOFILES_KERN = int(subprocess.check_output(command).strip()) from autoreload.py.

Full traceback:

Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/trace.py", line 819, in <module>
    main()
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/trace.py", line 807, in main
    t.runctx(code, globs, globs)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/trace.py", line 513, in runctx
    exec cmd in globals, locals
  File "project/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/loic/Dev/django/django/core/management/__init__.py", line 416, in execute_from_command_line
    utility.execute()
  File "/Users/loic/Dev/django/django/core/management/__init__.py", line 408, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/loic/Dev/django/django/core/management/__init__.py", line 288, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Users/loic/Dev/django/django/core/management/__init__.py", line 78, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/loic/Dev/django/django/contrib/staticfiles/management/commands/runserver.py", line 4, in <module>
    from django.core.management.commands.runserver import Command as RunserverCommand
  File "/Users/loic/Dev/django/django/core/management/commands/runserver.py", line 13, in <module>
    from django.utils import autoreload
  File "/Users/loic/Dev/django/django/utils/autoreload.py", line 84, in <module>
    NOFILES_KERN = int(subprocess.check_output(command).strip())
ValueError: invalid literal for int() with base 10: 'subprocess.py(1242):                             _dup2(errwrite, 2)\n --- modulename: subprocess, funcname: _dup2\nsubprocess.py(1236):                                 if a == b:\nsubprocess.py(1238):   '

Change History (3)

comment:1 Changed 19 months ago by loic84

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I forgot to specify that this will only happen on systems that support kevent (BSD / OSX).

comment:2 Changed 19 months ago by aaugustin

  • Owner changed from nobody to aaugustin
  • Status changed from new to assigned

comment:3 Changed 19 months ago by Aymeric Augustin <aymeric.augustin@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In 4d738fcc3bad4e13c3667646a86f9a17603b7d23:

Fixed #21546 -- Strengthened kqueue detection.

Thanks Loic Bistuer.

Note: See TracTickets for help on using tickets.
Back to Top