Fix an issue with stdout redirection on Windows, and remove code added in a failed attempt to resolve a Windows regression test issue.
parent
4dcd3e31d8
commit
546161ab1a
|
@ -31,6 +31,12 @@ if 'SERVER_MODE' in globals():
|
|||
else:
|
||||
builtins.SERVER_MODE = None
|
||||
|
||||
# Set null device file path to stdout, stdin, stderr if they are None
|
||||
for _name in ('stdin', 'stdout', 'stderr'):
|
||||
if getattr(sys, _name) is None:
|
||||
setattr(sys, _name, open(os.devnull,
|
||||
'r' if _name == 'stdin' else 'w'))
|
||||
|
||||
import config
|
||||
from pgadmin import create_app
|
||||
from pgadmin.utils import u, fs_encoding, file_quote
|
||||
|
|
|
@ -248,7 +248,7 @@ def create_app(app_name=None):
|
|||
logger.addHandler(fh)
|
||||
|
||||
# Console logging
|
||||
ch = logging.StreamHandler(sys.stdout.reconfigure(encoding='utf-8'))
|
||||
ch = logging.StreamHandler()
|
||||
ch.setLevel(config.CONSOLE_LOG_LEVEL)
|
||||
ch.setFormatter(logging.Formatter(config.CONSOLE_LOG_FORMAT))
|
||||
app.logger.addHandler(ch)
|
||||
|
|
Loading…
Reference in New Issue