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

dict_item indexing issue in Python 3.5 #21

Open
vyassu opened this issue Apr 7, 2017 · 9 comments
Open

dict_item indexing issue in Python 3.5 #21

vyassu opened this issue Apr 7, 2017 · 9 comments

Comments

@vyassu
Copy link

vyassu commented Apr 7, 2017

Hi

I am encountering below mentioned exception only while running Pystun on Python 3.5. The issue can be resolved if you cast the output of line 91,95 in init.py as a list. Please let me know once the fix is part of the main release stream.

nat_type, external_ip, external_port = stun.get_ip_info(stun_host=(stun_details[0]), stun_port=int(stun_details[1]))
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\stun_init_.py", line 253, in get_ip_info
stun_host=stun_host, stun_port=stun_port)
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\stun_init_.py", line 186, in get_nat_type
initialize()
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\stun_init
.py", line 93, in _initialize
dictValToAttr.update({items[i][1]: items[i][0]})
TypeError: 'dict_items' object does not support indexing

[20170407 16:03:15.022] WARNING:Could not find pyasn1 and pyasn1_modules. SSL certificate COULD NOT BE VERIFIED.
stun_host=stun_host, stun_port=stun_port)
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\stun_init_.py", line 186, in get_nat_type
initialize()
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\stun_init
.py", line 96, in _initialize
dictValToMsgType.update({items[i][1]: items[i][0]})
TypeError: 'dict_items' object does not support indexing

@jfdelgad
Copy link

jfdelgad commented May 7, 2018

Same issue here, using Python 3.6

@jmurrayufo
Copy link

Same issue under 3.7

@kodeine
Copy link

kodeine commented Feb 21, 2019

same issue here

@smed79
Copy link

smed79 commented Mar 13, 2019

Python 3.7.2

$ pystun
Traceback (most recent call last):
  File "/usr/bin/pystun", line 11, in <module>
    load_entry_point('pystun==0.1.0', 'console_scripts', 'pystun')()
  File "/usr/lib/python3.7/site-packages/stun/cli.py", line 55, in main
    stun_port=options.stun_port
  File "/usr/lib/python3.7/site-packages/stun/__init__.py", line 253, in get_ip_info
    stun_host=stun_host, stun_port=stun_port)
  File "/usr/lib/python3.7/site-packages/stun/__init__.py", line 186, in get_nat_type
    _initialize()
  File "/usr/lib/python3.7/site-packages/stun/__init__.py", line 93, in _initialize
    dictValToAttr.update({items[i][1]: items[i][0]})
TypeError: 'dict_items' object does not support indexing

@5vbz3r0
Copy link

5vbz3r0 commented Apr 21, 2019

Same issue in Python 3.7.3

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    stun.get_ip_info()
  File "C:\Tools\Python37\lib\site-packages\stun\__init__.py", line 253, in get_ip_info
    stun_host=stun_host, stun_port=stun_port)
  File "C:\Tools\Python37\lib\site-packages\stun\__init__.py", line 186, in get_nat_type
    _initialize()
  File "C:\Tools\Python37\lib\site-packages\stun\__init__.py", line 93, in _initialize
    dictValToAttr.update({items[i][1]: items[i][0]})
TypeError: 'dict_items' object is not subscriptable

@a7md0
Copy link

a7md0 commented Jun 4, 2019

I have forked the project, and apply a fix. Have not tested that yet
https://github.com/a7md0/pystun

nevelis pushed a commit to nevelis/pystun that referenced this issue Oct 4, 2019
@Noob-A
Copy link

Noob-A commented Feb 21, 2022

python 3.8, same

@Noob-A
Copy link

Noob-A commented Mar 11, 2022

bruh, this lib is dead

@sujaldev
Copy link

I think pystun3 still works, also why does github keep sending me notifications regarding this issue I don't think I ever interacted in this thread

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

9 participants