Re: [Twisted-Python] Error using "python -m twisted.conch.stdio" command in command prompt

2021-07-19 Thread Glyph


> On Jul 18, 2021, at 11:39 PM, Melanie Molifie  wrote:
> 
> Hi guys
> 
> I'm new to twisted and would appreciate some beginner guidance.
> 
Hi Melanie!  Welcome to the community. I hope we can get you set up better.

> I'm trying to use the "python -m twisted.conch.stdio" command in command 
> prompt but it does not work and gives the following error:
> 
> C:\WINDOWS\system32>python -m twisted.conch 
> C:\Users\Melanie\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe:
>  No module named twisted.conch.main; 'twisted.conch' is a package and cannot 
> be directly executed
> 
In this example you're doing `python -m twisted.conch`, not `python -m 
twisted.conch.stdio`, which will not work anywhere.
Unfortunately, the Conch standard-IO library (and therefore the conch terminal 
client, and twisted.conch.stdio) doesn't work on Windows and never has: 
https://twistedmatrix.com/trac/ticket/2157 
.  However, you may be able to get 
it up and running with the Windows Subsystem for Linux, which I believe will 
present a Linux-like interface since as far as the application knows it's 
running on Linux: https://docs.microsoft.com/en-us/windows/wsl/about 

> I'm hoping that this will solve the rest of the error messages I'm having. I 
> want to eventually be ably to run :
> 
> >>> from twisted.names import client
> >>> client.getHostByName('www.example.com ')
> 
> >>> _
> 
> 
> >>> client.lookupMailExchange('twistedmatrix.com ')
> 
> >>> _
>   type=MX class=IN ttl=1s auth=False>], [], [])>
Is the goal here specifically to do this with Conch, or would doing it with 
Jupyter Notebook (using something like 
https://twitter.com/glyph/status/1417360623818575876 
 which I found while 
researching a response to this email!) be sufficient?

Or, for that matter, could you just write a little program?  A sample Python 
script that runs the reactor is probably easier to set up than a 
reactor-enabled REPL, particularly on Windows.  (There are various options for 
a reactor-enabled REPL, it's definitely doable, but it might be a bit rough as 
a first step; as you're discovering.)

> The aim is to get the deferred responses as shown in previous code, but all I 
> get is:
> 
> >>> from twisted.names import client
> >>> client.getHostByName('www.example.com ')
> 
> >>> _
> 
> >>> client.lookupMailExchange('twistedmatrix.com ')
> 
> >>> _
> 
The reason you're getting this with a normal Python interactive interpreter is 
that the event loop which actually performs the I/O (does the DNS queries, in 
this case) isn't running at all, so the Deferreds are created, but never 
resolved.

> Please help. I'm trying to send this to the twisted mailing group. If I'm 
> wrong please nudge me in the right direction.
> 
This is as good a place as any :).

> Thanks in advance.
> 
> M
> 
> On Mon, Jul 19, 2021 at 12:43 AM Richard van der Hoff  > wrote:
> On 16/07/2021 20:27, Glyph wrote:
> >
> >> One particular problem I came across was the type annotation on 
> >> inlineCallbacks. I've filed 
> >> https://twistedmatrix.com/trac/ticket/10231 
> >>  about it - would 
> >> appreciate thoughts.
> >>
> > This definitely looks wrong; there should be a TypeVar in there.  Adi, 
> > I'd go so far as to say that this should be a release blocker, 
> > although the change should be fairly minimal.
> >
> > Richard, could you please make a proper PR for this to get CI kicked 
> > off and make sure the new annotation doesn't cause any failures?
> Done, in the form of https://github.com/twisted/twisted/pull/1632 
> .
> 
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com 
> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python 
> 
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] Error using "python -m twisted.conch.stdio" command in command prompt

2021-07-19 Thread Melanie Molifie
Hi guys

I'm new to twisted and would appreciate some beginner guidance.

I'm trying to use the "python -m twisted.conch.stdio" command in command
prompt but it does not work and gives the following error:

C:\WINDOWS\system32>python -m twisted.conch
C:\Users\Melanie\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe:
No module named twisted.conch.*main*; 'twisted.conch' is a package and
cannot be directly executed

*I'm hoping that this will solve the rest of the error messages I'm having.
I want to eventually be ably to run :*

>>> from twisted.names import client
>>> client.getHostByName('www.example.com')

>>> _


>>> client.lookupMailExchange('twistedmatrix.com')

>>> _
], [], [])>

*The aim is to get the deferred responses as shown in previous code, but
all I get is:*

>>> from twisted.names import client
>>> client.getHostByName('www.example.com')

>>> _

>>> client.lookupMailExchange('twistedmatrix.com')

>>> _


Please help. I'm trying to send this to the twisted mailing group. If I'm
wrong please nudge me in the right direction.

Thanks in advance.

M

On Mon, Jul 19, 2021 at 12:43 AM Richard van der Hoff 
wrote:

> On 16/07/2021 20:27, Glyph wrote:
> >
> >> One particular problem I came across was the type annotation on
> >> inlineCallbacks. I've filed
> >> https://twistedmatrix.com/trac/ticket/10231 about it - would
> >> appreciate thoughts.
> >>
> > This definitely looks wrong; there should be a TypeVar in there.  Adi,
> > I'd go so far as to say that this should be a release blocker,
> > although the change should be fairly minimal.
> >
> > Richard, could you please make a proper PR for this to get CI kicked
> > off and make sure the new annotation doesn't cause any failures?
> Done, in the form of https://github.com/twisted/twisted/pull/1632.
>
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python