Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1762 closed defect (fixed)

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

Reported by: ross.lazarus@… Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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?

Change History (1)

comment:1 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

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

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