Giter Site home page Giter Site logo

Comments (5)

jaraco avatar jaraco commented on May 28, 2024

hmm. I wonder what is the correct syntax. Presumably, we can make dccsend and dccreceive work together, but I'd like also for them to work with other tools. Do you know what syntax other tools use for sending or receiving files with spaces? Is there perhaps a spec for it?


Original comment by: Jason R. Coombs

from irc.

jaraco avatar jaraco commented on May 28, 2024

I don't know if there is a spec but i think shlex module will be nice for splitting.

#!python

>>> import shlex
>>> shlex.split('something "D:\\filename with space" -c')
['something', 'D:\\filename with space', '-c']


Original comment by: Carabelli

from irc.

jaraco avatar jaraco commented on May 28, 2024

I agree that form is nicer for capturing file names with spaces, but it still doesn't help align the library with the protocol. One way you could test is to set up dccreceive.py to receive a file, but then use a publically-available IRC client to send a file, and see what content dccreceive gets.

I suspect there will need to be some escaping and unescaping, but it's not obvious to me without more investigation what that would be.


Original comment by: Jason R. Coombs

from irc.

jaraco avatar jaraco commented on May 28, 2024

I ran a test with HexChat as the sender, and I found that the incoming "args" were:
['SEND', '"Introducing', 'ASP.NET', 'vNext', '-', 'Scott', 'Hanselman.URL"', '3232235778', '56038', '240']. So it seems that at least one client uses quotes around a filename with spaces. In that case, using shlex should do the trick.


Original comment by: Jason R. Coombs

from irc.

jaraco avatar jaraco commented on May 28, 2024

Use list2cmdline and shlex to handle spaces in DCC files. Fixes #49.

→ <<cset 9e4fb0ce9223>>


Original comment by: Jason R. Coombs

from irc.

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.