Coder Social home page Coder Social logo

invalid thread id about pyshark HOT 11 CLOSED

kiminewt avatar kiminewt commented on August 22, 2024
invalid thread id

from pyshark.

Comments (11)

KimiNewt avatar KimiNewt commented on August 22, 2024

Does this happen each time or just occasionally?

from pyshark.

jescoupe avatar jescoupe commented on August 22, 2024

Each time.

from pyshark.

KimiNewt avatar KimiNewt commented on August 22, 2024

This doesn't happen to me on Windows or Ubuntu. I'm assuming you're on OSX?
It's obviously something wrong with the recipe of InterruptibleThread. I'll try checking it out.

from pyshark.

jescoupe avatar jescoupe commented on August 22, 2024

Yep, OS X - thanks!

from pyshark.

chavaone avatar chavaone commented on August 22, 2024

I have the same problem on Fedora 19 with Python 2.7.5.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyshark/capture/live_capture.py", line 44, in sniff
    sniff_thread.raise_exc(StopIteration)
  File "pyshark/utils.py", line 81, in raise_exc
    _async_raise(self._get_my_tid(), exctype)
  File "pyshark/utils.py", line 28, in _async_raise
    raise ValueError("invalid thread id")
ValueError: invalid thread id

from pyshark.

KimiNewt avatar KimiNewt commented on August 22, 2024

Sorry for the incredibly long delay, but I changed the implementation a tad-- it still works properly on my systems and I think it may solve it for yours. Can you check?

from pyshark.

chavaone avatar chavaone commented on August 22, 2024

In the meanwhile I have upgrade my fedora to fedora 20 and I'm not able to reproduce the error :S I got this traceback that is probable due to other error...

Python 2.7.5 (default, Feb 19 2014, 13:47:28) 
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyshark
>>> capture = pyshark.LiveCapture(interface='wlp3s0')
>>> capture.sniff(timeout=50)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 764, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/site-packages/pyshark-0.2.2- py2.7.egg/pyshark/capture/live_capture.py", line 57, in _sniff_in_thread
    proc = self._get_tshark_process(packet_count)
  File "/usr/lib/python2.7/site-packages/pyshark-0.2.2-py2.7.egg/pyshark/capture/capture.py", line 97, in _get_tshark_process
    parameters = [get_tshark_path(), '-T', 'pdml'] + self.get_parameters(packet_count=packet_count) + extra_params
  File "/usr/lib/python2.7/site-packages/pyshark-0.2.2-py2.7.egg/pyshark/tshark/tshark.py", line 20, in get_tshark_path
    config = get_config()
  File "/usr/lib/python2.7/site-packages/pyshark-0.2.2-py2.7.egg/pyshark/config.py", line 8, in get_config
    return py.iniconfig.IniConfig(CONFIG_PATH)
  File "/usr/lib/python2.7/site-packages/py-1.4.20-py2.7.egg/py/_iniconfig.py", line 50, in __init__
    f = open(self.path)
IOError: [Errno 2] No such file or directory: '/usr/lib/python2.7/site-packages/pyshark-0.2.2-py2.7.egg/pyshark/config.ini'

I hope that could be useful...

from pyshark.

KimiNewt avatar KimiNewt commented on August 22, 2024

I'm assuming you're running the latest revision? Did you try rerunning setup.py install?

from pyshark.

jescoupe avatar jescoupe commented on August 22, 2024

I'm getting the same error after the update:

Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import pyshark
capture = pyshark.LiveCapture(interface='en0')
capture.sniff(timeout=10)
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyshark-0.2.2-py2.7.egg/pyshark/capture/live_capture.py", line 42, in sniff
sniff_thread.raise_exc(StopIteration)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyshark-0.2.2-py2.7.egg/pyshark/utils.py", line 84, in raise_exc
_async_raise(self._get_my_tid(), exctype)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyshark-0.2.2-py2.7.egg/pyshark/utils.py", line 28, in _async_raise
raise ValueError("invalid thread id")
ValueError: invalid thread id

from pyshark.

KimiNewt avatar KimiNewt commented on August 22, 2024

Can you try it again after jeffito's fix?

from pyshark.

KimiNewt avatar KimiNewt commented on August 22, 2024

Since we no longer use threads, I doubt this occurs anymore.

from pyshark.

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.