jaraco / irc

Full-featured Python IRC library for Python.
MIT License
392 stars 87 forks source link

DCC example scripts fail #27

Closed jaraco closed 8 years ago

jaraco commented 8 years ago

dcc file transfer scripts don't work for me. (dccsend.py, dccreceive.py) When i try to use it, it is just waiting even for small files (1kb).


jaraco commented 8 years ago

I've started troubleshooting this. First thing I did was update the scripts to have nicer command-line handling (e42b79ce39ad). After that, I ran the send and receive scripts in separate windows:

.\scripts\dccreceive irc.freenode.net irclib_recv
.\scripts\dccsend.py irc.freenode.net irclib_send irclib_recv .\scripts\dccsend.py

However, when I did this, I got an error in the sender.

Traceback (most recent call last):
  File "C:\Users\jaraco\projects\irc\scripts\dccsend.py", line 90, in <module>
    main()
  File "C:\Users\jaraco\projects\irc\scripts\dccsend.py", line 87, in main
    c.start()
  File "C:\Program Files\Python33\lib\site-packages\irc-8.3.1-py3.3.egg\irc\client.py", line 1211, in start
  File "C:\Program Files\Python33\lib\site-packages\irc-8.3.1-py3.3.egg\irc\client.py", line 264, in process_forever
  File "C:\Program Files\Python33\lib\site-packages\irc-8.3.1-py3.3.egg\irc\client.py", line 245, in process_once
  File "C:\Program Files\Python33\lib\site-packages\irc-8.3.1-py3.3.egg\irc\client.py", line 210, in process_data
  File "C:\Program Files\Python33\lib\site-packages\irc-8.3.1-py3.3.egg\irc\client.py", line 1084, in process_data
  File "C:\Program Files\Python33\lib\site-packages\irc-8.3.1-py3.3.egg\irc\client.py", line 384, in _handle_event
  File "C:\Program Files\Python33\lib\site-packages\irc-8.3.1-py3.3.egg\irc\client.py", line 1174, in _dispatcher
  File "C:\Users\jaraco\projects\irc\scripts\dccsend.py", line 39, in on_dcc_connect
    self.send_chunk()
  File "C:\Users\jaraco\projects\irc\scripts\dccsend.py", line 62, in send_chunk

    self.dcc.send_bytes(data)
AttributeError: 'DCCConnection' object has no attribute 'send_bytes'

So I think I need to tackle that issue next.


Original comment by: Jason R. Coombs

jaraco commented 8 years ago

The issue with send_bytes being missing was due to a packaging error (the modules weren't being consistently imported).

In 681fdb9be7e8, I fixed an issue with sending binary files on Python 3. After that, I was able to do a full round-trip.

> python scripts/dccsend irc.freenode.net irclib_send irclib_recv scripts/dccsend.py
Sent file scripts/dccsend.py (2646 bytes).
> python scripts/dccreceive irc.freenode.net irclib_recv
Received file dccsend.py (2646 bytes).

Original comment by: Jason R. Coombs

jaraco commented 8 years ago

Please try again with 8.5.2. If you continue to have issues, run the scripts with "-l DEBUG" and report back with the output.


Original comment by: Jason R. Coombs