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

Attribute Error #25

Closed
L1ghtn1ng opened this issue Jun 10, 2017 · 5 comments
Closed

Attribute Error #25

L1ghtn1ng opened this issue Jun 10, 2017 · 5 comments
Assignees

Comments

@L1ghtn1ng
Copy link

L1ghtn1ng commented Jun 10, 2017

  File "/usr/lib/python3.6/site-packages/pingparsing/_pingparsing.py", line 198,            in parse
    self.__parse_linux_ping(ping_message)
  File "/usr/lib/python3.6/site-packages/pingparsing/_pingparsing.py", line 266,            in __parse_linux_ping
    line_list = _to_unicode(ping_message).splitlines()
AttributeError: 'PingResult' object has no attribute 'splitlines'

Running 8.0 of pingparsing and getting the above error on archlinux with python 3.6

@thombashi
Copy link
Owner

Thank you for your report.

I guess you had passing ping method result to parse method like following:

def main():
    ping_parser = pingparsing.PingParsing()
    transmitter = pingparsing.PingTransmitter()
    transmitter.destination_host = "8.8.8.8"
    transmitter.waittime = 10
    result = transmitter.ping()
    ping_parser.parse(result)

I could reproduce the problem by this code.
In that case, you could easily fix the code.

def main():
    ping_parser = pingparsing.PingParsing()
    transmitter = pingparsing.PingTransmitter()
    transmitter.destination_host = "8.8.8.8"
    transmitter.waittime = 10
    result = transmitter.ping()
    ping_parser.parse(result.stdout)  # modified line

@thombashi thombashi self-assigned this Jun 11, 2017
@L1ghtn1ng
Copy link
Author

Think so will need to double check it when I get to work on Monday but it does from me testing your way does work and would be nice to have a changelog saying that there was a breaking change and how to fix it in release notes. Also your python version bage is broken in the readme and the the docs

@thombashi
Copy link
Owner

You're absolutely right.

I've change to accept for both ping_parser.parse(result) and ping_parser.parse(result.stdout) at pingparsing 0.8.2.
You do not need to change the source code if you upgrade the package.

your python version bage is broken in the readme and the the docs

Looks like pingparsing PyPI page (python version badge source) always corrupt when I publish the package from Travis CI, I'm not sure how to fix that right now.

@L1ghtn1ng
Copy link
Author

L1ghtn1ng commented Jun 13, 2017 via email

@thombashi
Copy link
Owner

Thank you for sharing.
I'm glad that works for you.

Then, I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants