Re: [Twisted-Python] Python SSH Server( twisted.conch) takes up high cpu usage when a large number of echo

2016-11-16 Thread Glyph Lefkowitz

> On Nov 14, 2016, at 6:58 PM, 陈健  wrote:
> 
>  hi:
> I write a SSH server with Twisted Conch. But encountered a difficult 
> problem. Assume that user A and user B log in to the twisted ssh server 
> through ssh command. Then user A tail or cat a large file (greater than 100M) 
> on the server, which will cause a lot of echoing through the twisted ssh 
> server, making python ssh process (twisted.conch ) cpu usage is very high 
> (greater than 95%, or even 100%), then the user B will be blocked, a long 
> time no response. Is there any way to sleep userA's session(0.5 seconds) when 
> find the user A has a large number of echo through the twisted ssh server and 
> not blocking the other connected users?
> 
> http://stackoverflow.com/questions/40601119/python-ssh-server-twisted-conch-takes-up-high-cpu-usage-when-a-large-number-of
>  
> 
> Best regards,
> 
> 
> 


Thanks for getting in touch!  I've put an answer on Stack Overflow; I hope 
others will have more input.

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


[Twisted-Python] twisted on Windows with python 3.5?

2016-11-16 Thread Jeffrey DeLeo
After seeing a talk by Glyph and Moshe last month, I have looked into
twisted. It seems like a natural fit for a current project. Thought to
use klein for the web application portion as well.

But - we are using Python 3.5, and one of our deliverable platforms is
Windows 7 (64 bit). Bad idea? Things to watch out for?

I have been able to build twisted on Windows with Python 3.5, no cygwin. Simple
examples I tried run. Some klein examples run (some don't).

Greatly appreciated:

  + comments from anyone doing something similar

  + pointers to Windows status - what's available, what to avoid

  + amusing or snarky comments ;)

thanks in advance!


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


Re: [Twisted-Python] twisted on Windows with python 3.5?

2016-11-16 Thread Craig Rodrigues
Hi,

Over the past 4-5 months or so, I have been doing some major heavy lifting
to port large parts of Twisted to Python 3.
One of the biggest hurdles I overcame was to port the Twisted IOCP reactor
to Python 3.  I got that to work.

So, I think things are in good shape.  However, getting feedback from
actual users like yourself would be very valuable.  That will allow us
to squash any remaining bugs and corner cases.

In terms of status, I invite you to look at the Windows Python 3.5 build
and test status on Appveyor:

https://ci.appveyor.com/project/adiroiban/twisted/history

Not specific to Windows, I reported the latest Python 3 status on Linux
here:

http://twistedmatrix.com/pipermail/twisted-python/2016-November/030869.html

--
Craig


On Wed, Nov 16, 2016 at 10:24 AM, Jeffrey DeLeo 
wrote:

> After seeing a talk by Glyph and Moshe last month, I have looked into
> twisted. It seems like a natural fit for a current project. Thought to
> use klein for the web application portion as well.
>
> But - we are using Python 3.5, and one of our deliverable platforms is
> Windows 7 (64 bit). Bad idea? Things to watch out for?
>
> I have been able to build twisted on Windows with Python 3.5, no cygwin.
> Simple
> examples I tried run. Some klein examples run (some don't).
>
> Greatly appreciated:
>
>   + comments from anyone doing something similar
>
>   + pointers to Windows status - what's available, what to avoid
>
>   + amusing or snarky comments ;)
>
> thanks in advance!
>
>
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] twisted on Windows with python 3.5?

2016-11-16 Thread Glyph Lefkowitz

> On Nov 16, 2016, at 10:24, Jeffrey DeLeo  wrote:
> 
> After seeing a talk by Glyph and Moshe last month, I have looked into
> twisted. It seems like a natural fit for a current project. Thought to
> use klein for the web application portion as well.
> 
> But - we are using Python 3.5, and one of our deliverable platforms is
> Windows 7 (64 bit). Bad idea? Things to watch out for?
> 
> I have been able to build twisted on Windows with Python 3.5, no cygwin. 
> Simple
> examples I tried run. Some klein examples run (some don't).
> 
> Greatly appreciated:
> 
>  + comments from anyone doing something similar
> 
>  + pointers to Windows status - what's available, what to avoid
> 
>  + amusing or snarky comments ;)
> 
> thanks in advance!

I'm not currently deploying on Windows 7 anywhere in production, but:

a) We have a windows 7/2.7 builder which we try to keep passing; it is a 
supported platform: 
https://buildbot.twistedmatrix.com/builders/windows7-64-py2.7 
.  While, 
technically speaking, 3.5+win7 is not a supported platform, we do also test 
with 3.5 on other versions of Windows, so if there's a problem we'd be 
surprised.

b) I say this because some open source / Python projects don't, but: we take 
Windows support seriously. If you report issues and submit patches, we will 
definitely try to investigate and or integrate them.  If there's demand from 
users to support it, we can set up a win7+py3.5 builder as well, and support it 
if it's green.

So while I can't promise everything will work perfectly out of the box, it's 
definitely supposed to :-).

-g

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


[Twisted-Python] pooled smtp connection

2016-11-16 Thread Roshan Cherian
Hi All,

I am looking at sendMail in twisted.mail.smtp, however this to my
understanding doesn't maintain a connection pool to a smtp host and port.
The ESMTPSenderFactory is initialized using the from and to addresses as
well.

Is there a way I can create a connection pool for the smtp connection and
send mail?

thanks for your help.

Thanks,
-Roshan
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Twisted 16.6.0rc1 Release Candidate Announcement

2016-11-16 Thread Mark Williams
On Thu, Nov 10, 2016 at 07:56:52PM +1100, Amber "Hawkie" Brown wrote:
> - Python 3 support for Words' IRC support and twisted.protocols.sip among 
> some smaller modules,

I have opened a PR to revert this:

https://github.com/twisted/twisted/pull/593

A full explanation is here:

https://twistedmatrix.com/trac/ticket/6320#comment:16

In summary: a valid IRC message will cause a UnicodeDecodeError within
the event loop that a user cannot handle or avoid, and all length
checks on line sizes are wrong because they occur prior to encoding to
utf-8.

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


Re: [Twisted-Python] Twisted 16.6.0rc1 Release Candidate Announcement

2016-11-16 Thread Glyph Lefkowitz

> On Nov 16, 2016, at 11:15 PM, Mark Williams  wrote:
> 
> On Thu, Nov 10, 2016 at 07:56:52PM +1100, Amber "Hawkie" Brown wrote:
>> - Python 3 support for Words' IRC support and twisted.protocols.sip among 
>> some smaller modules,
> 
> I have opened a PR to revert this:
> 
> https://github.com/twisted/twisted/pull/593
> 
> A full explanation is here:
> 
> https://twistedmatrix.com/trac/ticket/6320#comment:16
> 
> In summary: a valid IRC message will cause a UnicodeDecodeError within
> the event loop that a user cannot handle or avoid, and all length
> checks on line sizes are wrong because they occur prior to encoding to
> utf-8.

Reverts should be commits that go straight to trunk and reopen tickets, per the 
current process.

However; is it really a regression to have py3 support for Words that just 
doesn't support other encodings yet?  It strikes me that this is just a bug, 
and that we should just fall back from UTF-8 to latin-1 in this scenario.  But 
adding that fallback is a small additional fix (perhaps one that should be 
slated for 16.6.0 if you want to make it).

-glyph


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


Re: [Twisted-Python] Twisted 16.6.0rc1 Release Candidate Announcement

2016-11-16 Thread Amber "Hawkie" Brown

> On 17 Nov. 2016, at 18:22, Glyph Lefkowitz  wrote:
> 
>> 
>> On Nov 16, 2016, at 11:15 PM, Mark Williams  wrote:
>> 
>> On Thu, Nov 10, 2016 at 07:56:52PM +1100, Amber "Hawkie" Brown wrote:
>>> - Python 3 support for Words' IRC support and twisted.protocols.sip among 
>>> some smaller modules,
>> 
>> I have opened a PR to revert this:
>> 
>> https://github.com/twisted/twisted/pull/593
>> 
>> A full explanation is here:
>> 
>> https://twistedmatrix.com/trac/ticket/6320#comment:16
>> 
>> In summary: a valid IRC message will cause a UnicodeDecodeError within
>> the event loop that a user cannot handle or avoid, and all length
>> checks on line sizes are wrong because they occur prior to encoding to
>> utf-8.
> 
> Reverts should be commits that go straight to trunk and reopen tickets, per 
> the current process.
> 
> However; is it really a regression to have py3 support for Words that just 
> doesn't support other encodings yet?  It strikes me that this is just a bug, 
> and that we should just fall back from UTF-8 to latin-1 in this scenario.  
> But adding that fallback is a small additional fix (perhaps one that should 
> be slated for 16.6.0 if you want to make it).
> 
> -glyph

Yeah, this is just a plain old bug. Bugs in new features (where a module being 
on Python 3 counts as one to me) aren't regressions; we sometimes fix them in 
pre if there's time/other stuff is getting fixed, but this one will just be a 
known bug until 16.7 in December.

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


Re: [Twisted-Python] Twisted 16.6.0rc1 Release Candidate Announcement

2016-11-16 Thread Amber "Hawkie" Brown

> On 17 Nov. 2016, at 18:50, Amber Hawkie Brown  
> wrote:
> 
>> 
>> On 17 Nov. 2016, at 18:22, Glyph Lefkowitz > > wrote:
>> 
>>> 
>>> On Nov 16, 2016, at 11:15 PM, Mark Williams >> > wrote:
>>> 
>>> On Thu, Nov 10, 2016 at 07:56:52PM +1100, Amber "Hawkie" Brown wrote:
 - Python 3 support for Words' IRC support and twisted.protocols.sip among 
 some smaller modules,
>>> 
>>> I have opened a PR to revert this:
>>> 
>>> https://github.com/twisted/twisted/pull/593 
>>> 
>>> 
>>> A full explanation is here:
>>> 
>>> https://twistedmatrix.com/trac/ticket/6320#comment:16
>>> 
>>> In summary: a valid IRC message will cause a UnicodeDecodeError within
>>> the event loop that a user cannot handle or avoid, and all length
>>> checks on line sizes are wrong because they occur prior to encoding to
>>> utf-8.
>> 
>> Reverts should be commits that go straight to trunk and reopen tickets, per 
>> the current process.
>> 
>> However; is it really a regression to have py3 support for Words that just 
>> doesn't support other encodings yet?  It strikes me that this is just a bug, 
>> and that we should just fall back from UTF-8 to latin-1 in this scenario.  
>> But adding that fallback is a small additional fix (perhaps one that should 
>> be slated for 16.6.0 if you want to make it).
>> 
>> -glyph
> 
> Yeah, this is just a plain old bug. Bugs in new features (where a module 
> being on Python 3 counts as one to me) aren't regressions; we sometimes fix 
> them in pre if there's time/other stuff is getting fixed, but this one will 
> just be a known bug until 16.7 in December.
> 
> - Amber

(or a 16.6.1)___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python