[Twisted-Python] Twisted serialport

2016-03-09 Thread Chris West
I'm currently using the SerialPort connection type in twisted 15.5.0 with 
python 2.7.7 on a windows machine.

Twisted serial communications with the serial port fail when pyserial is 
upgraded from 2.7 to 3.0.1 and fails with the following error.

Traceback (most recent call last):
  File "C:\Anaconda\Scripts\fmv3dbg-script.py", line 9, in 
load_entry_point('fmv3tools==0.2.5', 'console_scripts', 'fmv3dbg')()
  File 
"C:\Anaconda\lib\site-packages\fmv3tools-0.2.5-py2.7.egg\fmv3tools\fmv3dbg.py", 
line 338, in main
server = create_system(args)
  File 
"C:\Anaconda\lib\site-packages\fmv3tools-0.2.5-py2.7.egg\fmv3tools\fmv3dbg.py", 
line 310, in create_system
server = SerialServer(com_port, outputs=outputs)
  File 
"C:\Anaconda\lib\site-packages\fmv3tools-0.2.5-py2.7.egg\fmv3tools\fmv3dbg.py", 
line 57, in __init__
FMv3SerialGateway.__init__(self, com_port, *args, **kwargs)
  File 
"C:\Anaconda\lib\site-packages\flatmesh-0.2.8-py2.7.egg\flatmesh\fmv3_datacoms.py",
 line 403, in __init
__
baudrate=baudrate)
  File 
"C:\Anaconda\lib\site-packages\twisted-15.5.0-py2.7-win32.egg\twisted\internet\_win32serialport.py",
 line 56, in __init__
self._finishPortSetup()
  File 
"C:\Anaconda\lib\site-packages\twisted-15.5.0-py2.7-win32.egg\twisted\internet\_win32serialport.py",
 line 65, in _finishPortSetup
flags, comstat = win32file.ClearCommError(self._serial.hComPort)
AttributeError: 'Serial' object has no attribute 'hComPort'

I've removed pyserial 3.0.1 from my system for the moment but I was wondering 
if there is a way to have both pyserial 2.7 and 3.0.1 on my system when using 
twisted?

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


Re: [Twisted-Python] Twisted serialport

2016-03-09 Thread Adi Roiban
On 9 March 2016 at 09:53, Chris West  wrote:

> I’m currently using the SerialPort connection type in twisted 15.5.0 with
> python 2.7.7 on a windows machine.
>
>
>
> Twisted serial communications with the serial port fail when pyserial is
> upgraded from 2.7 to 3.0.1 and fails with the following error.
>
>
>

Hi,

I think that this is a know issue.

Please see https://twistedmatrix.com/trac/ticket/8159

It would help if you could try the patch and report that all is ok for your
use case.

If not the same issue, please report a new ticket.

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


Re: [Twisted-Python] Build and installation problem

2016-03-09 Thread Angelo Conte
Thank you Glyph for your kind answer.
1) I've just tried and the same error appears, so it's not a Twisted
specific problem
2) environment variables don't contain nothing special; there is no CFLAGS
entry.

I've also searched if there were something wrong in compiler's search dirs,
but everything seems ok.

Angelo

2016-03-08 18:51 GMT+01:00 Glyph Lefkowitz :

>
> On Mar 7, 2016, at 11:31 PM, Angelo Conte  wrote:
>
> I can't find any reference to the folder
> .30/build/tmp-eglibc/sysroots/bpp3 on my system.
>
>
> It looks like your embedded system can't build python extension modules; I
> doubt the problem is specific to Twisted.
>
> 1. Have you built any other extension modules?  ("pip install
> cryptography", for example)
> 2. Do you have any interesting text in environment variables;
> particularly, CFLAGS?
>
> -glyph
>
> ___
> 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] Can't identify protocol

2016-03-09 Thread Glyph Lefkowitz

> On Mar 8, 2016, at 11:24 PM, Matilda Bernard  wrote:
> 
>"I've never seen this, personally, and my understanding of Twisted's 
> transport mechanism is that it would be impossible unless the reactor were 
> completely frozen for a very long period of time (4+ minutes, at least)."
> 
> How can I detect that state?

Is the server completely unresponsive for multiple minutes at a time?

> We're using OEL 6.5 and PyPy 2.6.0

You should upgrade to PyPy 4.0.1.  (Generally speaking you should always run 
the latest available PyPy, since they only really do bugfix and performance 
releases; they don't break compatibility)  I don't remember what version it was 
in, but somewhere in the 2.x series there was a nasty file descriptor leak 
whose symptoms might match what you're seeing.

-glyph

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


Re: [Twisted-Python] Build and installation problem

2016-03-09 Thread Glyph Lefkowitz

> On Mar 9, 2016, at 3:13 AM, Angelo Conte  wrote:
> 
> Thank you Glyph for your kind answer.
> 1) I've just tried and the same error appears, so it's not a Twisted specific 
> problem
> 2) environment variables don't contain nothing special; there is no CFLAGS 
> entry.
> 
> I've also searched if there were something wrong in compiler's search dirs, 
> but everything seems ok.

My guess is that Python is built incorrectly for this platform.

When you build Python, it remembers certain things about its build 
configuration and attempts to copy those things to the compile commands used to 
build extension modules.  It looks to me like that directory is detritus which 
somehow got glommed into the build configuration Python thinks it should use.

This is unfortunately about the end of my expertise in this area; you'd have 
better luck posting this to a list like 
https://www.python.org/community/sigs/current/distutils-sig/.

Thanks for using Twisted; I'm sorry it's being difficult to work with here.  
I'm interested in helping you get this resolved, and I'm also on distutils-sig, 
so if you ask there I can always provide additional details about how Twisted's 
C modules work if one of the more-knowledgeable people there needs more 
information; feel free to ask for my help in further investigation if you need 
it :-).

-glyph

P.S.: Since a lot of new people are posting (which is great!) I feel like I 
should take the opportunity to point out that the preferred style of reply on 
this list is  
followed by  - 
please refrain from .  
Thanks!

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


Re: [Twisted-Python] Can't identify protocol

2016-03-09 Thread Matilda Bernard
Thanks Glyph for the possible causes of this problem.


On Wed, Mar 9, 2016 at 12:07 PM, Glyph Lefkowitz 
wrote:

>
> On Mar 8, 2016, at 11:24 PM, Matilda Bernard  wrote:
>
>"I've never seen this, personally, and my understanding of Twisted's
> transport mechanism is that it would be impossible unless the reactor were
> completely frozen for a very long period of time (4+ minutes, at least)."
>
> How can I detect that state?
>
>
> Is the server completely unresponsive for multiple minutes at a time?
>
> We're using OEL 6.5 and PyPy 2.6.0
>
>
> You should upgrade to PyPy 4.0.1.  (Generally speaking you should always
> run the latest available PyPy, since they only really do bugfix and
> performance releases; they don't break compatibility)  I don't remember
> what version it was in, but somewhere in the 2.x series there was a nasty
> file descriptor leak whose symptoms *might* match what you're seeing.
>
> -glyph
>
>
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>


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


Re: [Twisted-Python] Can't identify protocol

2016-03-09 Thread Matilda Bernard
Will do.

On Wednesday, March 9, 2016, Glyph Lefkowitz 
wrote:

> On Mar 9, 2016, at 3:34 PM, Matilda Bernard  > wrote:
>
> Thanks Glyph for the possible causes of this problem.
>
>
> I'm definitely curious if you manage to reach a resolution; please follow
> up with the list if you discover more information.
>
> -glyph
>


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


Re: [Twisted-Python] Can't identify protocol

2016-03-09 Thread Glyph Lefkowitz
> On Mar 9, 2016, at 3:34 PM, Matilda Bernard  wrote:
> 
> Thanks Glyph for the possible causes of this problem. 

I'm definitely curious if you manage to reach a resolution; please follow up 
with the list if you discover more information.

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