Re: [Twisted-Python] Using twistd with -c option causes permission error

2018-08-29 Thread Jean-Paul Calderone
On Tue, Aug 28, 2018 at 5:54 AM Richard Shea  wrote:

>
> With Apache the process starts as root, reads the key and then makes the
> apache process run as a different, less powerful, user  but I can't see how
> you can do the equivalent for twistd ? Am I overlooking something ?
>
>
twistd has `--uid` and `--gid` options for switching to another user after
`privilegedStartService` runs.  However, I'm not sure how much help this
will be since there is a strong desire to replace twistd with twist and
twist does not have these features.  Perhaps someone who has been working
on twist can explain the preferred workflow using that tool.


>
> Thanks
>
> ___
> 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] T9217 / PR1052: Wheels, wheels, and more wheels

2018-08-29 Thread Kyle Altendorf

Hi All,

I am working on ticket #9217 / PR #1051 to add lots more wheel 
generation to the Twisted CI.  I decided to give the cibuildwheel 
package a try and it made this process almost too easy (well... sort of 
:] ).  I've got AppVeyor-Windows, Travis-Linux, and Circle-OSX all 
building a variety of wheels for the supported Python versions and bit 
depths.  Travis doesn't save artifacts 'easily' so I went ahead and 
doubled up on Linux on Circle for now, though it's having some Docker 
issues at the moment and hasn't been successful yet.  For some reason in 
this one case the project directory isn't getting mounted into the 
container as expected.


wheel links:
https://github.com/twisted/twisted/pull/1051#issuecomment-416743261 (and 
next comment)


Now that I've got the wheel builds happening I figured it'd be good to 
try them out on 'real' machines.  Turns out we get a failure on 
twisted.cred.test.test_strcred.SSHCheckerTests.test_isChecker for at 
least the two checks I've done so far (Windows and OSX).  I haven't done 
more than a cursory look at that yet, but it's on the list to understand 
and resolve.  More testing would of course be welcome.  Real world, just 
trial Twisted's own tests, whatever would be appreciated if you are 
interested.


failures with wheels:
https://github.com/twisted/twisted/pull/1051#issuecomment-416977723

Overall, it's a bit unclear what the intended use of the various CI 
hosts are for Twisted.  I hear that Travis OSX builds were really slow, 
but from what I can see Circle isn't doing any OSX (other than what I 
added).  There wasn't any artifact storage being used on Circle either.  
So, I'm not sure if there was a reason to use Circle that went away, 
or...  But, not having to hook Travis up to S3 or somesuch for storage 
is quite nice so Circle wins at least in that category.


Now that I've got something rough in place, are there any opinions about 
how this should work?  I don't know the present release workflow so I 
don't know if we'd want an automatic push to PyPI on tags (probably 
not), or just artifacts on the build server to grab manually (would need 
some S3 or such for Travis, or Circle for Linux builds as well).  
Anything else?  Do we want automated tests against the wheels?  
cibuildwheel does have a feature for that though I haven't done anything 
with it yet.


Anyways...  hello, thanks for Twisted, and I hope this work ends up 
saving some people some time.


Cheers,
-kyle

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


[Twisted-Python] Keeping logger from snatching stdout?

2018-08-29 Thread Jeff Grimmett
I'm working on a Flask project using the flask_twisted package from PyPI
and have encountered a mystery.  I don't *have* to solve it to move on, but
darn it, I can't let it go :)

https://pypi.org/project/Flask-Twisted/
https://github.com/cravler/flask-twisted/

So here's the breakdown: when use the standard logging module to output to
a logfile + stdout, everything is fine.  I do see some logging output from
Twisted as well (the web server part) but for the most part life is groovy.

I'm going to be integrating in a wxPython windows app to this (previously
it's been a shell app) and step 1 was to make my own stdout handler that
eventually would pipe all that stuff to a window in the wx app.  The first
step of THAT (step 1.a) was to replace all the logging stuff with print()
placeholders.

At that point, things got confusing, as now ALL of my print()s are being
handled by Twisted's logging handler.

I brought flask-twisted in local to my code so I could monkey around with
it. First thing I noticed was that it was using twisted.python.log. I
messed around with that - commented it out, and now I get no stdout output
at all.  Set the parameter setStdout to False, same thing.

The adapter code uses twisted.internet.reactor,  threads,
twisted.web.server.Site, twisted.web.wsgi.WSGIResource, and
twisted.web.resource.Resource, any one which might be responsible. I spent
yesterday evening digging around but haven't found anything yet.

Any guidance / ideas?

Regards,

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