Giter Club home page Giter Club logo

Comments (8)

gdevenyi avatar gdevenyi commented on September 26, 2024

Output with debugging enabled:

# ses_report -d -c
DEBUG:sasutils.ses:ses_get_snic_nickname: executing: ['sg_ses', '--page=snic', '-I0', '/dev/sg136']
DEBUG:sasutils.ses:ses_get_snic_nickname: sg_ses:   SMC946    R39                 1C
DEBUG:sasutils.ses:ses_get_snic_nickname: sg_ses: Subenclosure nickname status diagnostic page:
DEBUG:sasutils.ses:ses_get_snic_nickname: sg_ses:   number of secondary subenclosures: 0
DEBUG:sasutils.ses:ses_get_snic_nickname: sg_ses:   generation code: 0x0
DEBUG:sasutils.ses:ses_get_snic_nickname: sg_ses:    subenclosure identifier: 0
DEBUG:sasutils.ses:ses_get_snic_nickname: sg_ses:    nickname status: 0x0
DEBUG:sasutils.ses:ses_get_snic_nickname: sg_ses:    nickname additional status: 0x0
DEBUG:sasutils.ses:ses_get_snic_nickname: sg_ses:    nickname language code: 
DEBUG:sasutils.ses:ses_get_snic_nickname: sg_ses:    nickname: Eval Board Nickname Simulator   
DEBUG:sasutils.ses:ses_get_ed_metrics: executing: ['sg_ses', '--page=ed', '--join', '/dev/sg136']
Traceback (most recent call last):
  File "/usr/bin/ses_report", line 11, in <module>
    load_entry_point('sasutils==0.3.10', 'console_scripts', 'ses_report')()
  File "/usr/lib/python3/dist-packages/sasutils/cli/ses_report.py", line 120, in main
    ses_report()
  File "/usr/lib/python3/dist-packages/sasutils/cli/ses_report.py", line 96, in ses_report
    for edinfo in ses_get_ed_metrics(sg_dev.name):
  File "/usr/lib/python3/dist-packages/sasutils/ses.py", line 87, in ses_get_ed_metrics
    for element_type, descriptor, line in _ses_get_ed_line(sg_name):
  File "/usr/lib/python3/dist-packages/sasutils/ses.py", line 69, in _ses_get_ed_line
    for line in stdout.decode("utf-8").splitlines():
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 48894: invalid start byte

from sasutils.

gdevenyi avatar gdevenyi commented on September 26, 2024

I believe this snip from the output has UTF-8 weirdness in it

C94600H39A70017            T [3,0]  Element type: Enclosure
  Enclosure Status:
    Predicted failure=0, Disabled=0, Swap=0, status: OK
    Ident=0, Time until power cycle=0, Failure indication=0
    Warning indication=0, Requested power off duration=0
    Failure requested=0, Warning requested=0

The following is detected

Non-ASCII characters found (highlighted in red)
[Character #47856] 39A70017 �T� [3,0] Element t

When analyzing the redirected output using https://pages.cs.wisc.edu/~markm/ascii.html

from sasutils.

gdevenyi avatar gdevenyi commented on September 26, 2024

image

from sasutils.

thiell avatar thiell commented on September 26, 2024

Good catch @gdevenyi! Thanks for the report. We need to be more robust when processing such output. I'll have a look at it ASAP.

from sasutils.

gdevenyi avatar gdevenyi commented on September 26, 2024

Hi, it looks like in fact you're probably doing things right with regards to UTF-8, but the encoding might be invalid UTF-8 and the default for decoding errors is 'strict' which bails out.

I added errors='backslashreplace' (ref: https://docs.python.org/3/library/codecs.html#error-handlers ) and it could continue:

sasutils.ses_report.Eval.Enclosure.C94600H39A70017____________\x80T OK

from sasutils.

thiell avatar thiell commented on September 26, 2024

Hi @gdevenyi, do you think you could submit a PR to fix it? I like this idea. It requires Python 3.5+ but that seems okay with me.

from sasutils.

gdevenyi avatar gdevenyi commented on September 26, 2024

See #15

from sasutils.

thiell avatar thiell commented on September 26, 2024

Thanks!

from sasutils.

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.