Django

Code

Ticket #1762 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

tiny nit in core/management.py prevents import in python win ide

Reported by: ross.lazarus@gmail.com Assigned to: adrian
Milestone: Component: Core framework
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

I'm working on some django automation :-)

While working with a python IDE under windows, I noticed that I could not import the core.management module :-(

>>> from django.core import management
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "C:\Python24\lib\site-packages\django-0.91-py2.4.egg\django\core\management.py", line 49, in ?
    if (not sys.stdout.isatty()) or (sys.platform == 'win32'):
  File "C:\Python24\Lib\site-packages\pythonwin\pywin\mfc\object.py", line 18, in __getattr__
    return getattr(o, attr)
AttributeError: isatty

Easily fixed by wrapping that failed test in a try except at line 50 or so:

try:
    if (not sys.stdout.isatty()) or (sys.platform == 'win32'):
        disable_termcolors()
except:
        pass

Harmless enough I think?

Attachments

Change History

05/04/06 23:08:14 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [2845]) Fixed #1762 -- Fixed Windows error in django.core.management. Thanks, ross.lazarus@gmail.com


Add/Change #1762 (tiny nit in core/management.py prevents import in python win ide)




Change Properties
Action