Giter Club home page Giter Club logo

mtr-packet-python's People

Contributors

matt-kimball avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mtr-packet-python's Issues

Modernizing `asyncio` usage in examples

Would this be something you'd accept as a PR?

For example making changes like:

  • flipping loop.run_until_complete() to asyncio.run()
  • using the new taskgroups from 3.11
  • swapping .ensure_future() with the newer asyncio.create_task() where you'd prefer to not use task groups.

Super dope lib btw ๐Ÿ˜Ž

Lookin forward to using it in a serious project ๐Ÿ„๐Ÿผ

invalid-argument

hi,

you're Getting started code example ends with invalid-argument :

ProbeResult(success=False, result='invalid-argument', time_ms=None, responder=None, mpls=[])

do I need privileges (root) to use mtrpacket ?

regards, lacsaP.

Tests hang with Python 3.11

Upon updating of Arch Linux's Python from 3.10 to 3.11, I found that mtrpacket's tests hang:

$ ./test.sh
.

I have tried to add some debug outputs and located that the hang is near:

        out_queue.put_nowait('reply ip-6 ::1 round-trip-time 1000')
        result = await mtr.probe('ip6-localhost', ip_version=6)
        command = await in_queue.get()

I have tried to replace ip6-localhost with just localhost and it passes here, but hangs again after await self.send_probes(mtr, in_queue, out_queue).

Any ideas how to proceed here?

'ip_version' keyword argument to MtrPacket.probe causes 'unexpected keyword argument'

Attempting to specify the IP version using the 'ip_version' keyword argument to MtrPacket.probe fails due to problems in the _package_args method which has special handling for the argument at lines 516-518 however later at lines 546-547 the mangled argument keyname is checked against a list that doesn't include 'ip-version' (lines 530-533). One of two things needs to happen for 'ip_version' to work as expected:

  1. At or after lines 516-518 the argument key 'ip_version' should be removed from the 'args' hash with a 'pop' or 'del'.
  2. Add 'ip-version' to the valid arguments in line 532.

I don't know what side effects these options might have, so I cannot suggest which is preferrible.

/bin/sh: mtr-packet: command not found

Hi,

I'm unable to ping.py example. I tried editing my PATH to include the install directory but its still not working.

mtr-packet-python]# python3 ping.py google.com
/bin/sh: mtr-packet: command not found
Traceback (most recent call last):
File "ping.py", line 37, in
loop.run_until_complete(probe_coroutine)
File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "ping.py", line 13, in probe
async with mtrpacket.MtrPacket() as mtr:
File "/home/mtr-packet-python/mtrpacket/init.py", line 138, in aenter
await self.open()
File "/home/mtr-packet-python/mtrpacket/init.py", line 313, in open
if not await self.check_support('send-probe'):
File "/home/mtr-packet-python/mtrpacket/init.py", line 367, in check_support
(_, args) = await self._command('check-support', check_args)
File "/home/mtr-packet-python/mtrpacket/init.py", line 275, in _command
return await future
mtrpacket.ProcessError: failure to communicate with subprocess "mtr-packet" (is it installed and in the PATH?)

Some system info:

[root@net-tools03 mtr-packet-python]# pip3 list | grep mtrpacket
mtrpacket 1.0.0
[root@net-tools03 mtr-packet-python]# echo $PATH
/home/mtr-packet-python/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[root@net-tools03 mtr-packet-python]# ls -ltrh
total 28K
-rw-r--r-- 1 root root 1.1K Jun 17 09:21 LICENSE
-rw-r--r-- 1 root root 12K Jun 17 09:21 README.md
drwxr-xr-x 2 root root 75 Jun 17 09:21 examples
-rwxr-xr-x 1 root root 56 Jun 17 09:21 test.sh
drwxr-xr-x 2 root root 39 Jun 17 09:21 test
-rw-r--r-- 1 root root 695 Jun 17 09:21 setup.py
drwxr-xr-x 2 root root 90 Jun 17 09:22 mtrpacket.egg-info
drwxr-xr-x 4 root root 43 Jun 17 09:22 build
drwxr-xr-x 2 root root 39 Jun 17 09:22 dist
-rwxr-xr-x 1 root root 1.1K Jun 17 09:51 ping.py
drwxr-xr-x 3 root root 44 Jun 17 09:51 mtrpacket

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.