Opened 6 years ago

Closed 6 years ago

#21546 closed Cleanup/optimization (fixed)

ValueError when tracing runserver.

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


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

Full traceback:

Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", 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/", 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/", line 819, in <module>
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", 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/", line 513, in runctx
    exec cmd in globals, locals
  File "project/", line 10, in <module>
  File "/Users/loic/Dev/django/django/core/management/", line 416, in execute_from_command_line
  File "/Users/loic/Dev/django/django/core/management/", line 408, in execute
  File "/Users/loic/Dev/django/django/core/management/", line 288, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Users/loic/Dev/django/django/core/management/", line 78, in load_command_class
    module = import_module('' % (app_name, name))
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/", line 37, in import_module
  File "/Users/loic/Dev/django/django/contrib/staticfiles/management/commands/", line 4, in <module>
    from import Command as RunserverCommand
  File "/Users/loic/Dev/django/django/core/management/commands/", line 13, in <module>
    from django.utils import autoreload
  File "/Users/loic/Dev/django/django/utils/", line 84, in <module>
    NOFILES_KERN = int(subprocess.check_output(command).strip())
ValueError: invalid literal for int() with base 10: '                             _dup2(errwrite, 2)\n --- modulename: subprocess, funcname: _dup2\                                 if a == b:\   '

Change History (3)

comment:1 Changed 6 years ago by loic84

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

comment:2 Changed 6 years ago by Aymeric Augustin

Owner: changed from nobody to Aymeric Augustin
Status: newassigned

comment:3 Changed 6 years ago by Aymeric Augustin <aymeric.augustin@…>

Resolution: fixed
Status: assignedclosed

In 4d738fcc3bad4e13c3667646a86f9a17603b7d23:

Fixed #21546 -- Strengthened kqueue detection.

Thanks Loic Bistuer.

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