Giter Club home page Giter Club logo

Comments (13)

macervera avatar macervera commented on June 15, 2024 1

I have the same problem and solve it changing the variable RP_ENDPOINT.

First i put http://myserver:8080/ui/ (this don't work), the problem is that the service is waiting for a JSON and the server returns a html with a 404 errror, then fails with a ascii error.

I change to: http://myserver:8080 (this work)

I hope this help to you.

Regards,

from agent-python-robotframework.

evjlobanova avatar evjlobanova commented on June 15, 2024

@jevm unfortunately we do not have any contributors on python now. So maybe you want to contribute RP? Also we have a channel in our Slack chat with Python discussion, I suppose it can be useful https://reportportal.slack.com/messages/C9PMAA690

from agent-python-robotframework.

krasoffski avatar krasoffski commented on June 15, 2024

The root cause might be incorrect Unicode handling by listener.

The issue above says, that UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in position 0: ordinal not in range(128).

u'\u0101' is equivalent of ā

The issue appears (need traceback for better understanding) in following part of code:

def start_keyword(name, attributes):
    parent_type = "SUITE" if ParentTypes.is_empty() else ParentTypes.peek()
    kwd = Keyword(name=name, parent_type=parent_type, attributes=attributes)
    logging.debug("ReportPortal - Start Keyword: {0}".format(attributes))
RobotService.start_keyword(keyword=kwd)

Here is a example how to get similar error:

ch = u'\u0101'
"ReportPortal - Start Keyword: {0}".format(ch)

In this case fix is obvious, but I don't have ability to check.

from agent-python-robotframework.

jevm avatar jevm commented on June 15, 2024

@krasoffski @evjlobanova
Thank you for your responses, unfortunately, I am only a beginner with python. Maybe you could tell me what fix it could in this case, and what additional information I could provide? What is interesting, when I have this error, it goes not only for start keyword, but for every method, like end_keyword, end_suite, etc.

[ ERROR ] Calling method 'end_keyword' of listener 'reportportal_listener' failed: UnicodeEncodeError: 'ascii' codec can't encode character u'\u263a' in position 817: ordinal not in range(128) [ ERROR ] Calling method 'end_keyword' of listener 'reportportal_listener' failed: UnicodeEncodeError: 'ascii' codec can't encode character u'\u263a' in position 817: ordinal not in range(128) [ ERROR ] Calling method 'end_keyword' of listener 'reportportal_listener' failed: UnicodeEncodeError: 'ascii' codec can't encode character u'\u263a' in position 817: ordinal not in range(128) [ ERROR ] Calling method 'start_keyword' of listener 'reportportal_listener' failed: UnicodeEncodeError: 'ascii' codec can't encode character u'\u263a' in position 817: ordinal not in range(128) [ ERROR ] Calling method 'log_message' of listener 'reportportal_listener' failed: UnicodeEncodeError: 'ascii' codec can't encode character u'\u263a' in position 817: ordinal not in range(128)

, it seems to be stuck and then the whole execution crashes in the end. I am running robot framework under windows7 machine with python portable 2.7.2.1. I have a thought to try it out with newest python 3 and see what happens then.

from agent-python-robotframework.

krasoffski avatar krasoffski commented on June 15, 2024

@jevm I will try to perform fix and share with you for testing, but only after Sunday. What do you think about this?
It is true

it goes not only for start keyword, but for every method
because each method contains such logging instruction, "ReportPortal - * Keyword: {0}".format(ch)

from agent-python-robotframework.

jevm avatar jevm commented on June 15, 2024

@krasoffski

Thank you very much, but will you be able to show me places in the code where it was fixed? The thing is, we are both trying this agent and the https://github.com/ailjushkin/robotframework-reportportal-ng/, so I would try fixing it as well as they should be similar.

from agent-python-robotframework.

krasoffski avatar krasoffski commented on June 15, 2024

@jevm
You can try to perform following steps (one modification per step and then check) for file: robotframework_reportportal/listener.py

  1. The first one is to add
    • Add from __future__ import unicode_literals
    • Specify encoding # -*- coding: utf8 -*-
  2. Comment out all lines like: logging.debug("ReportPortal - Start Launch: {0}".format(attributes)). I suspect that issue related to converting non-ascii char within format instructions.

from agent-python-robotframework.

jevm avatar jevm commented on June 15, 2024

@krasoffski

So my file beginning should look like

import logging

from .variables import Variables
from .model import Keyword, Test, Suite, LogMessage
from .service import RobotService
from __future__ import unicode_literals
# -*- coding: utf8 -*-

Is it correct?

As for the second step - do I understand this correctly that this funcionality is just a debug logging which isn't neccesary for a main functionality?

from agent-python-robotframework.

krasoffski avatar krasoffski commented on June 15, 2024

Two first lines of the file:

# -*- coding: utf8 -*-
from __future__ import unicode_literals

import logging

from .variables import Variables
from .model import Keyword, Test, Suite, LogMessage
from .service import RobotService

As for the second step - do I understand this correctly that this funcionality is just a debug logging which isn't neccesary for a main functionality?

It seems like yes.

from agent-python-robotframework.

jevm avatar jevm commented on June 15, 2024

@krasoffski the proposed solution with step 1 didn't help, I will try Python 3 and then try the second step if it won't be helpful

from agent-python-robotframework.

krasoffski avatar krasoffski commented on June 15, 2024

@jevm, Does the issue appear in the same function with step1?
I did not use RobatFramework for while, thus probably @ailjushkin might help with this.

@ailjushkin I suspect that root cause is converting non-ascill char to ascii performed by default in Python2 (like label, comments, keyword names, etc). If you familiar with RobatFramework for now, could you please take a look (if you have a time).

from agent-python-robotframework.

jevm avatar jevm commented on June 15, 2024

Yes, the same situation

[ ERROR ] Calling method 'start_keyword' of listener 'reportportal_listener' failed: UnicodeEncodeError: 'ascii' codec can't encode character u'\u263a' in position 817: ordinal not in range(128)

[ ERROR ] Calling method 'log_message' of listener 'reportportal_listener' failed: UnicodeEncodeError: 'ascii' codec can't encode character u'\u263a' in position 817: ordinal not in range(128)

[ ERROR ] Calling method 'end_keyword' of listener 'reportportal_listener' failed: UnicodeEncodeError: 'ascii' codec can't encode character u'\u263a' in position 817: ordinal not in range(128)

[ ERROR ] Calling method 'log_message' of listener 'reportportal_listener' failed: UnicodeEncodeError: 'ascii' codec can't encode character u'\u263a' in position 817: ordinal not in range(128)

from agent-python-robotframework.

jevm avatar jevm commented on June 15, 2024

@krasoffski I've registered a similar issue for @ailjushkin robotframework-reportportal-ng, as it is the same there.

from agent-python-robotframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.