Importing robot framwork as module results in error if building from command line on Windows
Issue #23
new
Noticed this when trying to develop a builder for robot framework. Note everything works fine scons is kicked off from inside emacs, this but only manifests if run from the console. Not sure if this is a robot bug or Parts/SCons bug.
Reproduction steps: Work on a windows platform Install robot framework (pip install robotframework) Create simple SConstruct with just 2 lines:
from parts import *
import robot
Run script (SCons all)
Expected output:
scons: Reading SConscript files ...
scons: done reading SConscript files.
Parts: Updating disk
Parts: Updating disk - Done
Parts: Loaded 0 Parts
scons: Building targets ...
scons: *** Do not know how to make File target `build::' (build::). Stop.
scons: building terminated because of errors.
Parts: Summary: 1 build failure detected during build
Node: "build::"
Actual output:
scons: Reading SConscript files ...
ArgumentError: argument 2: <type 'exceptions.TypeError'>: expected LP_CONSOLE_SCREEN_BUFFERINFO instance instead of pointer to _CONSOLE_SCREEN_BUFFER_INFO:
File "SConstruct", line 3:
import robot
File "Python27\lib\site-packages\robot\__init__.py", line 41:
from robot.rebot import rebot, rebot_cli
File "Python27\lib\site-packages\robot\rebot.py", line 40:
from robot.conf import RebotSettings
File "Python27\lib\site-packages\robot\conf\__init__.py", line 27:
from .settings import RobotSettings, RebotSettings
File "Python27\lib\site-packages\robot\conf\settings.py", line 22:
from robot.output import LOGGER, loggerhelper
File "Python27\lib\site-packages\robot\output\__init__.py", line 22:
from .output import Output
File "Python27\lib\site-packages\robot\output\output.py", line 16:
from . import pyloggingconf
File "Python27\lib\site-packages\robot\output\pyloggingconf.py", line 21:
from . import librarylogger
File "Python27\lib\site-packages\robot\output\librarylogger.py", line 28:
from .logger import LOGGER
File "Python27\lib\site-packages\robot\output\logger.py", line 220:
LOGGER = Logger()
File "Python27\lib\site-packages\robot\output\logger.py", line 50:
self.register_console_logger()
File "Python27\lib\site-packages\robot\output\logger.py", line 79:
logger = ConsoleOutput(type, width, colors, markers, stdout, stderr)
File "Python27\lib\site-packages\robot\output\console\__init__.py", line 27:
return VerboseOutput(width, colors, markers, stdout, stderr)
File "Python27\lib\site-packages\robot\output\console\verbose.py", line 28:
self._writer = VerboseWriter(width, colors, markers, stdout, stderr)
File "Python27\lib\site-packages\robot\output\console\verbose.py", line 78:
self._stdout = HighlightingStream(stdout or sys.__stdout__, colors)
File "Python27\lib\site-packages\robot\output\console\highlighting.py", line 36:
self._highlighter = self._get_highlighter(stream, colors)
File "Python27\lib\site-packages\robot\output\console\highlighting.py", line 48:
return highlighter(stream)
File "Python27\lib\site-packages\robot\output\console\highlighting.py", line 93:
return DosHighlighter(stream) if windll else NoHighlighting(stream)
File "Python27\lib\site-packages\robot\output\console\highlighting.py", line 139:
self._orig_colors = self._get_colors()
File "Python27\lib\site-packages\robot\output\console\highlighting.py", line 161:
ok = windll.kernel32.GetConsoleScreenBufferInfo(self._handle, byref(csbi))