Opened 11 years ago

Closed 11 years ago

#21546 closed Cleanup/optimization (fixed)

ValueError when tracing runserver.

Reported by: loic84 Owned by: Aymeric Augustin
Component: Core (Management commands) Version: dev
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

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 by loic84, 11 years ago

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

comment:2 by Aymeric Augustin, 11 years ago

Owner: changed from nobody to Aymeric Augustin
Status: newassigned

comment:3 by Aymeric Augustin <aymeric.augustin@…>, 11 years ago

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