Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure when robot.api.logger.console #55

Open
KotlinIsland opened this issue Aug 29, 2023 · 4 comments
Open

Failure when robot.api.logger.console #55

KotlinIsland opened this issue Aug 29, 2023 · 4 comments
Labels
help wanted Extra attention is needed terminal cringe

Comments

@KotlinIsland
Copy link
Collaborator

KotlinIsland commented Aug 29, 2023

from robot.api import logger
def test_among():
    logger.console("I am console")

It actually does work:
image

pytest test.py                                                                                                                                                                                                                                                                                                                                                                                     19:34:36  
=============================================================================================================================================================================================================================== test session starts ===============================================================================================================================================================================================================================
platform win32 -- Python 3.11.3, pytest-7.4.0, pluggy-1.3.0
rootdir: C:\Users\AMONGUS\projects\python-test
plugins: robotframework-1.4.0
collected 1 item                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
==============================================================================
Python-Test
==============================================================================
Python-Test.Test                                                              
==============================================================================
test_among
test.py .FI am console
test_among                                                            | FAIL |                                                                                                                                                                                                                                                                                                                                                                                        [100%]        
OSError: [WinError 6] The handle is invalid
------------------------------------------------------------------------------
Python-Test.Test                                                      | FAIL |
1 test, 0 passed, 1 failed
==============================================================================
Python-Test                                                           | FAIL |
1 test, 0 passed, 1 failed
==============================================================================
Output:  C:\Users\AMONGUS\projects\python-test\output.xml
Log:     C:\Users\AMONGUS\projects\python-test\log.html
Report:  C:\Users\AMONGUS\projects\python-test\report.html


==================================================================================================================================================================================================================================== FAILURES ===================================================================================================================================================================================================================================== 
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________ test_among ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________ 

    def test_among():
>       logger.console("I am console")

test.py:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
..\..\AppData\Local\pypoetry\Cache\virtualenvs\demo-B_iquuwg-py3.11\Lib\site-packages\robot\api\logger.py:144: in console
    librarylogger.console(msg, newline, stream)
..\..\AppData\Local\pypoetry\Cache\virtualenvs\demo-B_iquuwg-py3.11\Lib\site-packages\robot\output\librarylogger.py:70: in console
    write_to_console(msg, newline, stream)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

msg = 'I am console\n', newline = True, stream = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>

    def write_to_console(msg, newline=True, stream='stdout'):
        msg = str(msg)
        if newline:
            msg += '\n'
        stream = sys.__stdout__ if stream.lower() != 'stderr' else sys.__stderr__
>       stream.write(console_encode(msg, stream=stream))
E       OSError: [WinError 6] The handle is invalid

..\..\AppData\Local\pypoetry\Cache\virtualenvs\demo-B_iquuwg-py3.11\Lib\site-packages\robot\output\loggerhelper.py:40: OSError
============================================================================================================================================================================================================================= short test summary info ============================================================================================================================================================================================================================= 
FAILED test.py::test_among - OSError: [WinError 6] The handle is invalid
================================================================================================================================================================================================================================ 1 failed in 0.19s ================================================================================================================================================================================================================================ 
@KotlinIsland KotlinIsland changed the title Fail when robot.api.logger.console Failure when robot.api.logger.console Aug 29, 2023
@DetachHead DetachHead added help wanted Extra attention is needed terminal cringe labels Aug 29, 2023
@KotlinIsland
Copy link
Collaborator Author

obsolete

@DetachHead
Copy link
Owner

this issue seems to be fixed now

@DetachHead
Copy link
Owner

actually its not

@DetachHead DetachHead reopened this May 20, 2024
@KotlinIsland
Copy link
Collaborator Author

Maybe capture=no should be default or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed terminal cringe
Projects
None yet
Development

No branches or pull requests

2 participants