[ANN] managesieve 0.6

2018-06-27 Thread Hartmut Goebel
I'm pleased to announce managesieve 0.6, a ManageSieve client library for
remotely managing Sieve scripts, including an user application (the
interactive 'sieveshell').

:Homepage: https://managesieve.readthedocs.io/
Development: https://gitlab.com/htgoebel/managesieve
:Author:   Hartmut Goebel 
:License for `managesieve`: Python Software Foundation License
:License for 'sieveshell' and test suite: GNU Public Licence v3 (GPLv3)

:Quick Installation:
    pip install -U managesieve

:Tarballs:  https://pypi.org/project/managesieve/#files


What is managesieve?
-

A ManageSieve client library for remotely managing Sieve scripts,
including an
user application (the interactive 'sieveshell').

Sieve scripts allow users to filter incoming email on the mail server.
The ManageSieve protocol allows managing Sieve scripts on a remote
mail server. These servers are commonly sealed so users cannot log
into them, yet users must be able to update their scripts on them.
This is what for the "ManageSieve" protocol is. For more information
about the ManageSieve protocol see `RFC 5804
`_.

This module allows accessing a Sieve-Server for managing Sieve scripts
there. It is accompanied by a simple yet functional user application
'sieveshell'.


What's new in version 0.6
---

* Add support for Python 3. Minimum required Python version is now
  Python 2.7.
* Homepage is now hosted at https://managesieve.readthedocs.io/
* Development hosted at https://gitlab.com/htgoebel/managesieve
* Documentation is extended and includes API documentation.

:sieveshell:
   - Security fix: No longer leak environment variable SIEVE_PASSWORD
 when displaying usage help.
   - Per default enforce secure transport. Suggested by Jan Zerebecki.
   - Add possibility to use username/password from the .netrc file.
 The order is: command line options -> environment variables ->
 .netrc file -> ask user. Thanks to Grégoire Détrez.

:managesieve:
   - Fail if TLS is requested, but server doesn't support TLS.
 Suggested by Jan Zerebecki.

:project:
   - Rework and enhance test-suite. Thanks to Matěj Cepl for nudging
 to proper pytest integration.
   - Lots if internal cleanup.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel  | [email protected]   |
| www.crazy-compilers.com | compilers which you thought are impossible |

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Where's the junk coming from?

2018-06-27 Thread Avon
On 06/27/18, Cameron Simpson pondered and said...
 
 CS> On 25Jun2018 18:37, Mark Lawrence  wrote:
 CS> >More of the flaming things, this time name@1261/38.remove-ij1-this.  Any 
 CS> >as I don't understand this stuff?
 CS> 
 CS> Looks like a FIDONET gateway leaking somehow. I've made an enquiry to a
 CS> possible source for the message, we'll see what transpires.
 CS> 
 CS> Cheers,
 CS> Cameron Simpson 

Hey Cameron,

Apologies for this. I have contacted the Fido system connected to the gateway
I run into news.bbs.nz and have asked them to urgently sort / check what's
up. If I don't get any joy from them within the next 24 hours I will delink
them so as to negate further probs.

My hunch is a BBS (yes they still exist :)) is taking a gated feed of this
newsgroup and is linked to more than one gateway so stuff is looping... not
good.

Stand by caller... we're working on this now.

Best, Paul
newsmaster [at] news dot bbs dot nz

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: syntax difference

2018-06-27 Thread Peter J. Holzer
On 2018-06-27 11:11:37 +1200, Gregory Ewing wrote:
> Bart wrote:
> >x = set(range(10_000_000))
> > 
> > This used up 460MB of RAM (the original 100M I tried exhausted the memory).
> > 
> > The advantage of Pascal-style sets is that that same set will occupy
> > only 1.25MB, as it is a bit-map.
> 
> That's true, but they're also extremely limited compared to
> the things you can do with Python sets. They're really two
> quite different things, designed for different use cases.
> 
> Compact sets of integers are possible in Python, but not
> as a built-in type. This suggests that they're not needed
> much

Also, when such sets are needed, a simple array of bits may not be
sufficient. For example, sets may be sparse, or they may have almost all
except a few bits set. In these cases a tree or RLE representation is
much smaller and faster. There are a number of such implementations
(Judy Arrays and Roaring Bitmaps come to mind[1]). Each has its
advantages and limitations, so its probably better to leave the choice
to the author.

hp

[1] Judy is a C library. Roaring bitmaps are a data structure which has
been implemented in several languages. I haven't checked whether
there are packages on pypi. Shouldn't be too hard to implement if
one needs it.

-- 
   _  | Peter J. Holzer| we build much bigger, better disasters now
|_|_) || because we have much more sophisticated
| |   | [email protected] | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson 


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: syntax difference

2018-06-27 Thread Bart

On 27/06/2018 12:42, Peter J. Holzer wrote:

On 2018-06-27 11:11:37 +1200, Gregory Ewing wrote:

Bart wrote:

x = set(range(10_000_000))

This used up 460MB of RAM (the original 100M I tried exhausted the memory).

The advantage of Pascal-style sets is that that same set will occupy
only 1.25MB, as it is a bit-map.


That's true, but they're also extremely limited compared to
the things you can do with Python sets. They're really two
quite different things, designed for different use cases.

Compact sets of integers are possible in Python, but not
as a built-in type. This suggests that they're not needed
much


Also, when such sets are needed, a simple array of bits may not be
sufficient. For example, sets may be sparse, or they may have almost all
except a few bits set. In these cases a tree or RLE representation is
much smaller and faster. There are a number of such implementations
(Judy Arrays and Roaring Bitmaps come to mind[1]). Each has its
advantages and limitations, so its probably better to leave the choice
to the author.


From roaringbitmap.org:

"Bitsets, also called bitmaps, are commonly used as fast data 
structures. Unfortunately, they can use too much memory. To compensate, 
we often use compressed bitmaps."


So from one extreme to another: from the 300-400 bits per element used 
by Python's set type, to some presumably tiny fraction of a bit [on 
average] used in this scheme, as 1 bit per element is too much.


Is there no place at all for an ordinary, straightforward, uncompressed 
bit-set where each element takes exactly one bit? It does seem as though 
Python users have an aversion to simplicity and efficiency.


FWIW when I was working with actual image bitmaps, they were nearly 
always uncompressed when in memory. 1-bit-per-pixel images, for mono 
images or masks, would pack 8 pixels per byte. Compression would only be 
used for storage or transmission.


And the same with all the set types I've used.

However there is a slight difference with the concept of a 'set' as I 
used it, and as it was used in Pascal, compared with Python's set: there 
was the notion of the overall size of the set: the total number of 
elements, whether each was '1' or '0'.


So a set type that represented all ASCII codes would have a size of 128 
elements, indexed 0 to 127. So such a set initialised to ['A'..'Z'] and 
then inverted would give the set [0..64,91..127].


--
bart
--
https://mail.python.org/mailman/listinfo/python-list


ANN: OB - framework to program bots

2018-06-27 Thread Bart Thate
Hello comp.lang.python,

I am Bart Thate, a 50 year old programming schizofrenic.

I like to annouce version 4 of OB, a pure python3 package you can use to 
program bots.

OB has a “no-clause MIT license” that should be the most liberal license you 
can get at the year 2018.

I am looking for feedback on my new bot. https://pypi.org/project/ob/ 
http://ob.readthedocs.io/en/latest/

thnx !

Bart - [email protected]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python for beginners or not? [was Re: syntax difference]

2018-06-27 Thread Neil Cerutti
On 2018-06-25, Alister  wrote:
> for i in range(len(list)): is a python anti-pattern it is almost a 100%
> guarantee that you are doing something wrong*
>
> *as with all rules of thumb there is probably at least 1
> exception that the python experts will now point out.

When you need look-ahead or similar inspection of more than the
current item. An alternative is a custom generator or iterator
that provides the window you need.

-- 
Neil Cerutti

-- 
https://mail.python.org/mailman/listinfo/python-list


Should nested classes in an Enum be Enum members?

2018-06-27 Thread Ethan Furman

[Note:  there is a similar thread on Python-Ideas, if you would like to respond 
there.]

Consider the following Enum definition:

  class Color(Enum):
  RED = 1
  GREEN = 2
  BLUE = 3
  @property
  def lower(self):
  return self.name.lower()
  def spam(self):
  return "I like %s eggs and spam!" % self.lower
  class SomeClass:
  pass

Which of the above Color attributes are enums, and which aren't?


.


.


.

Answer:

  - RED, GREEN, and BLUE are members

  - lower and spam() are not

  - SomeClass /is/ a member (but not its instances)


Question:

  Should `SomeClass` be an enum member?  When would it be useful to have an 
embedded class in an Enum be an enum member?


The only example I have seen so far of nested classes in an Enum is when folks want to make an Enum of Enums, and the 
nested Enum should not itself be an enum member.  Since the counter-example already works I haven't seen any requests 
for it.  ;)


So I'm asking the community:  What real-world examples can you offer for either behavior?  Cases where nested classes 
should be enum members, and cases where nested classes should not be members.


Thanks!

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


thank you for inventing python

2018-06-27 Thread Kike Rocamora



Enviado desde Correo para Windows 10

-- 
https://mail.python.org/mailman/listinfo/python-list


configparser v/s file variables

2018-06-27 Thread Abdur-Rahmaan Janhangeer
what is more recommended and why? using configparser for settings or import
variables from file?

thanks,

Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: configparser v/s file variables

2018-06-27 Thread Grant Edwards
On 2018-06-27, Abdur-Rahmaan Janhangeer  wrote:
> what is more recommended and why? using configparser for settings or import
> variables from file?

Importing variables from a file is dangerous because it can execute
arbitrary code.  It should never be done with files provided by the
user.

Using configparser is far, far safer.

-- 
Grant Edwards   grant.b.edwardsYow! Psychoanalysis??
  at   I thought this was a nude
  gmail.comrap session!!!

-- 
https://mail.python.org/mailman/listinfo/python-list


OSError: [Errno 48] Address already in use

2018-06-27 Thread T Berger
Why am I getting this error? I'm not sure what additional information I need to 
supply, so please let me know.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OSError: [Errno 48] Address already in use

2018-06-27 Thread T Berger
On Wednesday, June 27, 2018 at 11:49:18 AM UTC-4, T Berger wrote:
> Why am I getting this error? I'm not sure what additional information I need 
> to supply, so please let me know.

I'm working on a Flask webapp. I know there is another google group 
specifically for Flask. Can you please provide the url.

Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: EXTERNAL: OSError: [Errno 48] Address already in use

2018-06-27 Thread Joaquin Henriquez
>Subject: EXTERNAL: OSError: [Errno 48] Address already in use

The best way to help if got you to put the relevant code here.

The error you are experiencing means that the Port you are trying to bind is 
already taken by another running process.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-06-27 Thread T Berger
On Wednesday, June 27, 2018 at 12:17:28 PM UTC-4, Joaquin Henriquez wrote:
> >Subject: EXTERNAL: OSError: [Errno 48] Address already in use
> 
> The best way to help if got you to put the relevant code here.

Last login: Wed Jun 27 12:45:08 on ttys000
192:~ TamaraB$ cd Desktop/Webapp/
192:Webapp TamaraB$ python3 vsearch4web.py
 * Serving Flask app "vsearch4web" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
Traceback (most recent call last):
  File "vsearch4web.py", line 18, in 
app.run(debug=True)
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/app.py",
 line 943, in run
run_simple(host, port, self, **options)
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/werkzeug/serving.py",
 line 795, in run_simple
s.bind(get_sockaddr(hostname, port, address_family))
OSError: [Errno 48] Address already in use
192:Webapp TamaraB$ 

> The error you are experiencing means that the Port you are trying to bind is 
> already taken by another running process.

Why would another process be running?

Thanks,

Tamara

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-06-27 Thread Marko Rauhamaa
Joaquin Henriquez :

>>Subject: EXTERNAL: OSError: [Errno 48] Address already in use
>
> The best way to help if got you to put the relevant code here.
>
> The error you are experiencing means that the Port you are trying to
> bind is already taken by another running process.

That error usually takes place when restarting a server. The server
exited with one or more TCP connections open, which left the connections
in a TIME-WAIT state for some minutes. When the server is restarted and
tries to bind its address again, the ghosts of the previous connections
prevent the socket from being bound.

The problem can be solved by turning on the SO_REUSEADDR flag of the
socket.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-06-27 Thread T Berger
Let me add this information to clarify the context in which I got this error 
48. It doesn't make sense to me, and it might not to you.

This morning, I opened my webapp (vsearch4web.py in the terminal code above) 
and noticed a whole bunch of code I had not typed. I also noticed something 
weird about the file path in the title bar (it seemed to be in my downloads 
folder). So I created a completely fresh file, retyped everything, and replaced 
the older one in the folder with this one.

THEN, I ran the program at my terminal, and got this error 48 in response.

Does any of this make sense?

Thanks,

Tamara

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-06-27 Thread T Berger
On Wednesday, June 27, 2018 at 1:40:20 PM UTC-4, Marko Rauhamaa wrote:
> Joaquin Henriquez :
> 
> >>Subject: EXTERNAL: OSError: [Errno 48] Address already in use
> >
> > The best way to help if got you to put the relevant code here.
> >
> > The error you are experiencing means that the Port you are trying to
> > bind is already taken by another running process.
> 
> That error usually takes place when restarting a server. The server
> exited with one or more TCP connections open, which left the connections
> in a TIME-WAIT state for some minutes. When the server is restarted and
> tries to bind its address again, the ghosts of the previous connections
> prevent the socket from being bound.
> 
> The problem can be solved by turning on the SO_REUSEADDR flag of the
> socket.
> 
> 
> Marko

Hi Marko,

Can you please tell me how to "turn on the SO_REUSEADDR flag of the socket"?

Thanks, 

Tamara 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: configparser v/s file variables

2018-06-27 Thread Abdur-Rahmaan Janhangeer
and that closes it,

thanks !!!

Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ

Importing variables from a file is dangerous because it can execute
> arbitrary code.  It should never be done with files provided by the
> user.
>
> Using configparser is far, far safer.
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: configparser v/s file variables

2018-06-27 Thread Jim Lee



On 06/27/18 11:45, Abdur-Rahmaan Janhangeer wrote:

and that closes it,

thanks !!!

Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ

Importing variables from a file is dangerous because it can execute

arbitrary code.  It should never be done with files provided by the
user.

Using configparser is far, far safer.



  It seems a bit silly to me to worry about arbitrary code execution in 
an interpreted language like Python whose default runtime execution 
method is to parse the source code directly.  An attacker would be far 
more likely to simply modify the source to achieve his ends rather than 
try to inject a payload externally.


These days, "execute arbitrary code" implies a deliberate attack. Now, 
if you used input validation as an argument, I would agree that 
configparser is, if not safer, easier.


-Jim

--
https://mail.python.org/mailman/listinfo/python-list


Re: sigmoid function and derivative

2018-06-27 Thread Dan Stromberg
On Tue, Jun 26, 2018 at 8:26 PM, Sharan Basappa 
wrote:

> Folks,
>
> I know this is not a machine learning forum but I wanted to see if anyone
> can explain this to me.
>
> In artificial neural network, I can understand why sigmoid is used but I
> see that derivative of sigmoid output function is used. I am not able to
> understand why.
>
> For example:
> # convert output of sigmoid function to its derivative
> def sigmoid_output_to_derivative(output):
> return output*(1-output)
>

The derivative tells you what direction to go in, as you update your
coefficients. It's a slope of a curve.  Otherwise, you'd be steering blind.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: configparser v/s file variables

2018-06-27 Thread Rob Gaddi

On 06/27/2018 12:15 PM, Jim Lee wrote:



On 06/27/18 11:45, Abdur-Rahmaan Janhangeer wrote:

and that closes it,

thanks !!!

Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ

Importing variables from a file is dangerous because it can execute

arbitrary code.  It should never be done with files provided by the
user.

Using configparser is far, far safer.



   It seems a bit silly to me to worry about arbitrary code execution in 
an interpreted language like Python whose default runtime execution 
method is to parse the source code directly.  An attacker would be far 
more likely to simply modify the source to achieve his ends rather than 
try to inject a payload externally.


These days, "execute arbitrary code" implies a deliberate attack. Now, 
if you used input validation as an argument, I would agree that 
configparser is, if not safer, easier.


-Jim



Not at all.  Because if you're assuming a malicious user (who wasn't the 
one to install it), then you're assuming a multi-user environment.  In 
which case the malicious user wouldn't have modify access to the code, 
unless your program says "Hey, Mal E. Factor, why don't you run your 
arbitrary code in my environment?"


--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list


Re: configparser v/s file variables

2018-06-27 Thread Grant Edwards
On 2018-06-27, Jim Lee  wrote:

>  It seems a bit silly to me to worry about arbitrary code
> execution in an interpreted language like Python whose default
> runtime execution method is to parse the source code directly. 

Maybe it's not a deliberate attack.  Good application design is also
about preventing accidents.

> An attacker would be far more likely to simply modify the source to
> achieve his ends rather than try to inject a payload externally.

That's true if the user has write permission for the program itself.
That's not how applications are usually installed (at least not on the
OSes I use).

> These days, "execute arbitrary code" implies a deliberate attack.

Perhaps I should have phrased it differently: I didn't mean to
restrict my comments to a deliberate attack.

> Now, if you used input validation as an argument, I would agree that
> configparser is, if not safer, easier.

And it doesn't require that the end user have any knowlege of Python
syntax or sematics.

-- 
Grant Edwards   grant.b.edwardsYow! ... I want FORTY-TWO
  at   TRYNEL FLOATATION SYSTEMS
  gmail.cominstalled within SIX AND A
   HALF HOURS!!!

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OSError: [Errno 48] Address already in use

2018-06-27 Thread Jim Lee



On 06/27/18 08:49, T Berger wrote:

Why am I getting this error? I'm not sure what additional information I need to 
supply, so please let me know.


You asked this question two weeks ago and got several answers.  Here is 
one of them:



On 06/15/18 10:17, Percival John Hackworth wrote:

On 15-Jun-2018, T Berger wrote
(in article<[email protected]>):


I’m trying to build a webapp with flask. I installed flask, created a
webapp in IDLE, but when I tried testing it at my terminal, I got a huge
error message. This is the app:

[snip]
line 467, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 48] Address already in use
192:Webapp TamaraB$

What went wrong?


The last message in the error message "Address already in use" means that
there's a web server using the port already running on your machine. If
you're on a Mac, you already have a local web server running on your machine.
You may or may not have specifically set that up. I intentionally setup the
development version of my web site on my system for testing.

To find out what network ports are in use on your system, you can use
command-line tools to display what processes are listening to what ports. If
none of this makes sense to you, read more on Linux networking, web
programming, and system administration before you attempt to dive into
building a web application with python.

It's like you opened the hood of your car and pointed to a cap marked "710"
and are asking us "what's that?" It's actually where you pour the "OIL" when
you need to top it off.

Good luck.

--
https://mail.python.org/mailman/listinfo/python-list


Re: configparser v/s file variables

2018-06-27 Thread Abdur-Rahmaan Janhangeer
i think variables also in the case of

PORT = 12345

Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ

And it doesn't require that the end user have any knowlege of Python
> syntax or sematics.
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Something new which all programmers world wide will appreciate

2018-06-27 Thread Rob Gaddi

On 06/27/2018 02:14 PM, [email protected] wrote:

Now I don't like the French much ! LOL.

But this time they have invented something which will fill programmers with 
tears of joy ! =D

http://www.euronews.com/2018/06/27/pizza-making-robot

Hopefully this will lead to cheaper and delicious pizzas in the future ! ;) =D

Bye,
   Skybuck.



Or, you know, someone didn't bother putting limit checks in and a time 
out of 20 the thing gets lost and starts putting the sauce directly on 
the customer.


--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list


Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-06-27 Thread Cameron Simpson

On 27Jun2018 10:44, Tamara Berger  wrote:

On Wednesday, June 27, 2018 at 1:40:20 PM UTC-4, Marko Rauhamaa wrote:

Joaquin Henriquez :

>>Subject: EXTERNAL: OSError: [Errno 48] Address already in use
> The best way to help if got you to put the relevant code here.
>
> The error you are experiencing means that the Port you are trying to
> bind is already taken by another running process.

That error usually takes place when restarting a server. The server
exited with one or more TCP connections open, which left the connections
in a TIME-WAIT state for some minutes. When the server is restarted and
tries to bind its address again, the ghosts of the previous connections
prevent the socket from being bound.

The problem can be solved by turning on the SO_REUSEADDR flag of the
socket.


Can you please tell me how to "turn on the SO_REUSEADDR flag of the socket"?


There's an example at the very bottom of the documentation for the "socket" 
module:


 https://docs.python.org/3/library/socket.html

However, Flash likely creates the server socket for you; I don't know how to 
tell it to set the SO_REUSEADDR option, though the flask documentation might.


You can check the status of the system with the netstat(8) command:

 netstat -an

lists all the system sockets and connections running on your machine. There 
will be many, so if you know the port you're using you can narrow it does with 
a grep:


 netstat -an | grep 8000

if you were using port 8000.

This also points the way to a workaround: since you're running the script 
yourself on an ad hoc basis, change ports! Maybe provide the listening port on 
the command line, and just bump it by one when this happens.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: configparser v/s file variables

2018-06-27 Thread Steven D'Aprano
On Wed, 27 Jun 2018 12:15:23 -0700, Jim Lee wrote:

>    It seems a bit silly to me to worry about arbitrary code execution
>    in
> an interpreted language like Python whose default runtime execution
> method is to parse the source code directly.  An attacker would be far
> more likely to simply modify the source to achieve his ends rather than
> try to inject a payload externally.

Spoken like a single user on a single-user machine who has administrator 
privileges and can write to anything anywhere.



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-06-27 Thread Dan Stromberg
On Wed, Jun 27, 2018 at 10:44 AM, T Berger  wrote:

> On Wednesday, June 27, 2018 at 1:40:20 PM UTC-4, Marko Rauhamaa wrote:
> > Joaquin Henriquez :
> >
> > >>Subject: EXTERNAL: OSError: [Errno 48] Address already in use
> > >
> > > The best way to help if got you to put the relevant code here.
> > >
> > > The error you are experiencing means that the Port you are trying to
> > > bind is already taken by another running process.
> >
> > That error usually takes place when restarting a server. The server
> > exited with one or more TCP connections open, which left the connections
> > in a TIME-WAIT state for some minutes. When the server is restarted and
> > tries to bind its address again, the ghosts of the previous connections
> > prevent the socket from being bound.
> >
> > The problem can be solved by turning on the SO_REUSEADDR flag of the
> > socket.
> >
> >
> > Marko
>
> Hi Marko,
>
> Can you please tell me how to "turn on the SO_REUSEADDR flag of the
> socket"?
>

Here's a small script that might serve as an example:
http://stromberg.dnsalias.org/svn/max-tcp-window/trunk/max-tcp-window

BTW, it's a security feature you're turning off. If you're on a multiuser
box, it prevents a second user from stealing lingering connections from a
first user on the same port.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: configparser v/s file variables

2018-06-27 Thread Jim Lee



On 06/27/18 15:19, Steven D'Aprano wrote:

On Wed, 27 Jun 2018 12:15:23 -0700, Jim Lee wrote:


    It seems a bit silly to me to worry about arbitrary code execution
    in
an interpreted language like Python whose default runtime execution
method is to parse the source code directly.  An attacker would be far
more likely to simply modify the source to achieve his ends rather than
try to inject a payload externally.

Spoken like a single user on a single-user machine who has administrator
privileges and can write to anything anywhere.



...which is exactly the case I was trying to illustrate.  Another is the 
elevation of privileges (in a multi-user environment)  due to any of a 
number of methods.  The point is that the source code exists in the 
execution environment, and once one gains access to that code, one 
doesn't *need* anything else.


-Jim


-Jim

--
https://mail.python.org/mailman/listinfo/python-list


Python 3.7.0 is now available! (and so is 3.6.6)

2018-06-27 Thread Ned Deily
On behalf of the Python development community and the Python 3.7 release
team, we are pleased to announce the availability of Python 3.7.0.
Python 3.7.0 is the newest feature release of the Python language, and
it contains many new features and optimizations. You can find Python
3.7.0 here:

https://www.python.org/downloads/release/python-370/

Most third-party distributors of Python should be making 3.7.0 packages
available soon.

See the "What’s New In Python 3.7" document
(https://docs.python.org/3.7/whatsnew/3.7.html) for more information
about features included in the 3.7 series. Detailed information about
the changes made in 3.7.0 can be found in its change log. Maintenance
releases for the 3.7 series will follow at regular intervals starting in
July of 2018.

We hope you enjoy Python 3.7!

P.S. We are also happy to announce the availability of Python 3.6.6, the
next maintenance release of Python 3.6:

https://www.python.org/downloads/release/python-366/

Thanks to all of the many volunteers who help make Python Development
and these releases possible! Please consider supporting our efforts by
volunteering yourself or through organization contributions to the
Python Software Foundation.

https://www.python.org/psf/

--
  Ned Deily
  [email protected] -- []

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-06-27 Thread T Berger
Hi Guys,

Thanks for all the suggestions. I found the problem. I had saved my program in 
IDLE and quit out of the shell, and then tried to run the program in Terminal. 
Previously, restarting the shell was enough to break the connection with the 
port. This time, I guess, it wasn't. So after thinking about your suggestions, 
I bypassed IDLE and went directly to Terminal, and the program worked.

Tamara
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-06-27 Thread Marko Rauhamaa
Dan Stromberg :
>> > The problem can be solved by turning on the SO_REUSEADDR flag of
>> > the socket.
> BTW, it's a security feature you're turning off. If you're on a
> multiuser box, it prevents a second user from stealing lingering
> connections from a first user on the same port.

Can you provide a brief proof of concept?


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list