Re: PEP8 and 4 spaces

2014-07-04 Thread Gregory Ewing

Steven D'Aprano wrote:


That's exactly the problem with tabs - whatever you think your code
looks like with tabs, other people will see quite different picture.


Why do you consider this a problem?


It's a problem if you try to use tabs for lining things
up in a tabular fashion in your source code.

The solution is not to use tabs for that -- only use
tabs for indentation, and use spaces for everything
else. Or, as PEP 8 suggests, don't try to line things
up in the first place.

I know it's ironic that tabs are no good for tabulation.
But it's unavoidable in a plain text format that doesn't
carry any metadata about how to interpret the tabs.

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


eGenix at the EuroPython Conference 2014

2014-07-04 Thread eGenix Team: M.-A. Lemburg


eGenix.com at the EuroPython Conference 2014

 July 21-27 2014
 Berlin, Germany



The EuroPython Conference (https://ep2014.europython.eu/) is the one
of the premier conferences for Python users and developers in
Europe. It is the second largest gathering of Python enthusiast around
the world. This year it is being held from July 21-27 in Berlin,
Germany.

This announcement is also available on our web-site for online reading:
http://www.egenix.com/company/news/EuroPython-Conference-2014.html


MEET UP WITH EGENIX AT EUROPYTHON

eGenix was one of the founding members of the EuroPython conference
team and played a major role in organizing the first EuroPython
conference in the year 2002.

Since then we have attended every EuroPython conference to meet up
face-to-face with the many people we know from the Python community
and the many people that we don't yet know from the community -- if
you are interested in meeting with us, please drop us a note so that
we can arrange a meeting at i...@egenix.com.


EGENIX TALKS AT EUROPYTHON

At this year's EuroPython, Marc-André Lemburg, CEO of eGenix, will be
giving a talk providing some insights into our experience with
large-scale database applications written in Python.

Advanced Database Programming with Python
-

Getting the best out of your database.

The Python DB-API 2.0 (http://www.python.org/dev/peps/pep-0249/)
provides a direct interface to many popular database backends. It
makes interaction with relational database very straight forward
and allows tapping into the full set of features these databases
provide.

The talk will cover advanced database topics which are relevant in
production environments such as locks, distributed transactions
and transaction isolation.

Friday, 11:30 CEST, Room C01

https://ep2014.europython.eu/en/schedule/sessions/104/

Enjoy,
-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jul 04 2014)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...   http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/

2014-07-21: EuroPython 2014, Berlin, Germany ...   17 days to go

: Try our mxODBC.Connect Python Database Interface for free ! ::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PEP8 and 4 spaces

2014-07-04 Thread Marko Rauhamaa
wxjmfa...@gmail.com:

> Le vendredi 4 juillet 2014 08:35:04 UTC+2, Gregory Ewing a écrit :
>> The truly broken tools IMO are things like mail handlers that shrink
>> away in terror when they see a tab and remove it altogether. There's
>> no excuse for that, as far as I can see.
>
> Yes, and you can extend this to the editors, which deliberately
> missusing the tabulation rules by inserting something else, eg. spaces
> (U+0020, 'SPACE').

A worthy flame war with top-class trolling mixed in. How could I stay
out?

My esteemed editor never "misuses the tabulation rules" as I have
instructed it to never insert TAB characters in files:

   (custom-set-variables
'(indent-tabs-mode nil))



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


flask sql cann't insert Variable in VALUES

2014-07-04 Thread Frank Liou
I try to insert username in to my table

it show

Internal Server Error
The server encountered an internal error and was unable to complete your 
request. Either the server is overloaded or there is an error in the 
application.

it maybe mean no request

i try to change username to '123123'

then it works

what's problem with this?



@app.route('/user/',methods=['GET','POST'])
def hello(username):
if request.method=='POST':
save_friends(username)
return username


def save_friends(username):
conn = engine.connect()
conn.execute("INSERT INTO friends(name) VALUES(username)")
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: flask sql cann't insert Variable in VALUES

2014-07-04 Thread Chris Angelico
On Fri, Jul 4, 2014 at 8:15 PM, Frank Liou  wrote:
> I try to insert username in to my table
>
> it show
>
> Internal Server Error
> The server encountered an internal error and was unable to complete your 
> request. Either the server is overloaded or there is an error in the 
> application.
>
> ...
> def save_friends(username):
> conn = engine.connect()
> conn.execute("INSERT INTO friends(name) VALUES(username)")

There are two things that you need to understand here, and rather than
give you the answers, I'm going to point you toward what you should
know. The first one is that your result page simply tells you that
there was an error; you need to look in the server logs to find the
actual text of the error. Get to know those logs; they'll collect all
sorts of errors for you. And the second is about the nature of SQL and
Python. Have a look at the basic documentation on parameterized
queries, and *be sure you understand it*. There is a lot more at stake
here than you might realize, so I'm not simply going to explain what's
wrong here; you absolutely must comprehend parameterized queries.

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


Re: fixing an horrific formatted csv file.

2014-07-04 Thread flebber
On Friday, 4 July 2014 14:12:15 UTC+10, flebber  wrote:
> I have taken the code and gone a little further, but I need to be able to 
> protect myself against commas and single quotes in names.
> 
> 
> 
> How is it the best to do this?
> 
> 
> 
> so in my file I had on line 44 this trainer name.
> 
> 
> 
> "Michael, Wayne & John Hawkes" 
> 
> 
> 
> and in line 95 this horse name.
> 
> Inz'n'out
> 
> 
> 
> this throws of my capturing correct item 9. How do I protect against this?
> 
> 
> 
> Here is current code.
> 
> 
> 
> import re
> 
> from sys import argv
> 
> SCRIPT, FILENAME = argv
> 
> 
> 
> 
> 
> def out_file_name(file_name):
> 
> """take an input file and keep the name with appended _clean"""
> 
> file_parts = file_name.split(".",)
> 
> output_file = file_parts[0] + '_clean.' + file_parts[1]
> 
> return output_file
> 
> 
> 
> 
> 
> def race_table(text_file):
> 
> """utility to reorganise poorly made csv entry"""
> 
> input_table = [[item.strip(' "') for item in record.split(',')]
> 
>for record in text_file.splitlines()]
> 
> # At this point look at input_table to find the record indices
> 
> output_table = []
> 
> for record in input_table:
> 
> if record[0] == 'Meeting':
> 
> meeting = record[3]
> 
> elif record[0] == 'Race':
> 
> date = record[13]
> 
> race = record[1]
> 
> elif record[0] == 'Horse':
> 
> number = record[1]
> 
> name = record[2]
> 
> results = record[9]
> 
> res_split = re.split('[- ]', results)
> 
> starts = res_split[0]
> 
> wins = res_split[1]
> 
> seconds = res_split[2]
> 
> thirds = res_split[3]
> 
> prizemoney = res_split[4]
> 
> trainer = record[4]
> 
> location = record[5]
> 
> print(name, wins, seconds)
> 
> output_table.append((meeting, date, race, number, name,
> 
>  starts, wins, seconds, thirds, prizemoney,
> 
>  trainer, location))
> 
> return output_table
> 
> 
> 
> MY_FILE = out_file_name(FILENAME)
> 
> 
> 
> # with open(FILENAME, 'r') as f_in, open(MY_FILE, 'w') as f_out:
> 
> # for line in race_table(f_in.readline()):
> 
> # new_row = line
> 
> with open(FILENAME, 'r') as f_in, open(MY_FILE, 'w') as f_out:
> 
> CONTENT = f_in.read()
> 
> # print(content)
> 
> FILE_CONTENTS = race_table(CONTENT)
> 
> # print new_name
> 
> f_out.write(str(FILE_CONTENTS))
> 
> 
> 
> 
> 
> if __name__ == '__main__':
> 
> pass

So I found this on stack overflow

In [2]: import string

In [3]: identity = string.maketrans("", "")

In [4]: x = ['+5556', '-1539', '-99', '+1500']

In [5]: x = [s.translate(identity, "+-") for s in x]

In [6]: x
Out[6]: ['5556', '1539', '99', '1500']

but it fails in my file, due to I believe mine being a list of list. Is there 
an easy way to iterate the sublists without flattening?

Current code.

input_table = [[item.strip(' "') for item in record.split(',')]
   for record in text_file.splitlines()]
# At this point look at input_table to find the record indices
identity = string.maketrans("", "")
print(input_table)
input_table = [s.translate(identity, ",'") for s
   in input_table]

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


Re: PEP8 and 4 spaces

2014-07-04 Thread Chris “Kwpolska” Warrick
On Thu, Jul 3, 2014 at 7:31 PM, Tobiah  wrote:
> Anyway, I gave up the 80 char line length long
> ago, having little feeling for some dolt on
> a Weiss terminal that for some reason needs to
> edit my code.

And yet, you did not give up an even more insane line length limit, in
e-mail.  The longest line in your original message is a measly 57
characters long.  The median line length is 46 characters.  Which is
pretty insane, and ultra-hard to read.  You can do more in e-mail.

> Each line of characters MUST be no more than 998 characters, and
> SHOULD be no more than 78 characters, excluding the CRLF.

That's the standard, [RFC 5322][]; the exact same quote appeared back
in [RFC 2822][].  However, many places actually want you to use a bit
less; common values include 70 or 72.  But still, it is MUCH more
roomy and readable than the value you use.

Here are the line lengths in the original message:

[47, 45, 45, 46, 46, 47, 45, 5, 46, 43, 46, 47, 47, 49, 31, 57, 52,
 34, 42, 23]

[RFC 5322]: http://tools.ietf.org/html/rfc5322#section-2.1.1
[RFC 2822]: http://tools.ietf.org/html/rfc2822#section-2.1.1

-- 
Chris “Kwpolska” Warrick 
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: fixing an horrific formatted csv file.

2014-07-04 Thread flebber
On Friday, 4 July 2014 16:19:09 UTC+10, Gregory Ewing  wrote:
> flebber wrote:
> 
> > so in my file I had on line 44 this trainer name.
> 
> > 
> 
> > "Michael, Wayne & John Hawkes"
> 
> > 
> 
> > and in line 95 this horse name. Inz'n'out
> 
> > 
> 
> > this throws of my capturing correct item 9. How do I protect against this?
> 
> 
> 
> Use python's csv module to read the file. Don't try to
> 
> do it yourself; the rules for handling embedded commas
> 
> and quotes in csv are quite complicated. As long as
> 
> the file is a well-formed csv file, the csv module
> 
> should parse fields like that correctly.
> 
> 
> 
> -- 
> 
> Greg

True Greg worked easier

def race_table(text_file):
"""utility to reorganise poorly made csv entry"""
# input_table = [[item.strip(' "') for item in record.split(',')]
#for record in text_file.splitlines()]
# At this point look at input_table to find the record indices
# identity = string.maketrans("", "")
# print(input_table)
# input_table = [s.translate(identity, ",'") for s
#in input_table]
output_table = []
for record in text_file:
if record[0] == 'Meeting':
meeting = record[3]
elif record[0] == 'Race':
date = record[13]
race = record[1]
elif record[0] == 'Horse':
number = record[1]
name = record[2]
results = record[9]
res_split = re.split('[- ]', results)
starts = res_split[0]
wins = res_split[1]
seconds = res_split[2]
thirds = res_split[3]
try:
prizemoney = res_split[4]
finally:
prizemoney = 0
trainer = record[4]
location = record[5]
print(name, wins, seconds)
output_table.append((meeting, date, race, number, name,
 starts, wins, seconds, thirds, prizemoney,
 trainer, location))
return output_table

MY_FILE = out_file_name(FILENAME)

# with open(FILENAME, 'r') as f_in, open(MY_FILE, 'w') as f_out:
# for line in race_table(f_in.readline()):
# new_row = line
with open(FILENAME, 'r') as f_in, open(MY_FILE, 'w') as f_out:
CONTENT = csv.reader(f_in)
# print(content)
FILE_CONTENTS = race_table(CONTENT)
# print new_name
f_out.write(str(FILE_CONTENTS))


if __name__ == '__main__':
pass

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


Re: Is pip being automatically installed for Python 3.4.0?

2014-07-04 Thread Conrad Taylor
On Wednesday, July 2, 2014 9:59:46 PM UTC-7, Ned Deily wrote:
> In article ,
> 
>  Conrad Taylor  wrote:
> 
> > Hi, shouldn't pip be automatically installed for Python 3.4.0 release?  I 
> 
> > have read through the release and the PEP 453.  Thus, can someone confirm 
> 
> > whether or not this is the case?  BTW, I have installed Python 3.4.0 using 
> 
> > MacPorts.
> 
> 
> 
> Like many other third-party package managers, MacPorts has chosen to 
> 
> continue to distribute pip as a separate item.  To install it and the 
> 
> MacPorts Python 3.4:
> 
> 
> 
> sudo port install py34-pip
> 

Yes, I have come to the same solution prior to the original post but I wanted 
to try the functionality in PEP 453 being that I would like to prepare 
instructions for others.

> 
> 
> -- 
> 
>  Ned Deily,
> 
>  n...@acm.org

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


Re: TextBlob on Windows

2014-07-04 Thread selvaperumal . p
On Saturday, 24 May 2014 04:45:14 UTC+5:30, subhaba...@gmail.com  wrote:
> Dear Group,
> 
> 
> 
> It seems there is a nice language processing library named TextBlob, like 
> NLTK. 
> 
> But I am being unable to install it on my Windows(MS-Windows 7 machine. I am 
> using Python 2.7
> 
> 
> 
> If anyone of the esteemed members may kindly suggest me the solution.
> 
> 
> 
> I tried the note in following URL
> 
> http://stackoverflow.com/questions/20562768/trouble-installing-textblob-for-python
> 
> 
> 
> but did not help much.
> 
> 
> 
> Thanking in Advance,
> 
> Regards,
> 
> Subhabrata Banerjee.

hi mam i too having the same problem.
If you got any solution for the problem please let me know
I am in dire need of the package to be used in python.
please!
-- 
https://mail.python.org/mailman/listinfo/python-list


Why is regexp not working?

2014-07-04 Thread Florian Lindner
Hello,

I have that piece of code:

def _split_block(self, block):
cre = [re.compile(r, flags = re.MULTILINE) for r in self.regexps]
block = "".join(block)
print(block)
print("---")
for regexp in cre:
match = regexp.match(block)
for grp in regexp.groupindex:
data = match.group(grp) if match else None
self.data[grp].append(data)


block is a list of strings, terminated by \n. self.regexps:


self.regexps = [r"it (?P\d+) .* dt complete yes | 
write-iteration-checkpoint |",
r"it (?P\d+) read ahead"


If I run my program it looks like that:


it 1 ahadf dt complete yes | write-iteration-checkpoint |
Timestep completed

---
it 1 read ahead
it 2 ahgsaf dt complete yes | write-iteration-checkpoint |
Timestep completed

---
it 4 read ahead
it 3 dfdsag dt complete yes | write-iteration-checkpoint |
Timestep completed

---
it 9 read ahead
it 4 dsfdd dt complete yes | write-iteration-checkpoint |
Timestep completed

---
it 16 read ahead
---
{'it_read_ahead': [None, '1', '4', '9', '16'], 'coupling_iterations': ['1', 
None, None, None, None]}

it_read_ahead is always matched when it should (all blocks but the first). 
But why is the regexp containing coupling_iterations only matched in the 
first block?

I tried different combinations using re.match vs. re.search and with or 
without re.MULTILINE.

Thanks!
Florian

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


Re: fixing an horrific formatted csv file.

2014-07-04 Thread F.R.

On 07/04/2014 12:28 PM, flebber wrote:

On Friday, 4 July 2014 14:12:15 UTC+10, flebber  wrote:

I have taken the code and gone a little further, but I need to be able to 
protect myself against commas and single quotes in names.



How is it the best to do this?



so in my file I had on line 44 this trainer name.



"Michael, Wayne & John Hawkes"



and in line 95 this horse name.

Inz'n'out



this throws of my capturing correct item 9. How do I protect against this?



Here is current code.



import re

from sys import argv

SCRIPT, FILENAME = argv





def out_file_name(file_name):

 """take an input file and keep the name with appended _clean"""

 file_parts = file_name.split(".",)

 output_file = file_parts[0] + '_clean.' + file_parts[1]

 return output_file





def race_table(text_file):

 """utility to reorganise poorly made csv entry"""

 input_table = [[item.strip(' "') for item in record.split(',')]

for record in text_file.splitlines()]

 # At this point look at input_table to find the record indices

 output_table = []

 for record in input_table:

 if record[0] == 'Meeting':

 meeting = record[3]

 elif record[0] == 'Race':

 date = record[13]

 race = record[1]

 elif record[0] == 'Horse':

 number = record[1]

 name = record[2]

 results = record[9]

 res_split = re.split('[- ]', results)

 starts = res_split[0]

 wins = res_split[1]

 seconds = res_split[2]

 thirds = res_split[3]

 prizemoney = res_split[4]

 trainer = record[4]

 location = record[5]

 print(name, wins, seconds)

 output_table.append((meeting, date, race, number, name,

  starts, wins, seconds, thirds, prizemoney,

  trainer, location))

 return output_table



MY_FILE = out_file_name(FILENAME)



# with open(FILENAME, 'r') as f_in, open(MY_FILE, 'w') as f_out:

# for line in race_table(f_in.readline()):

# new_row = line

with open(FILENAME, 'r') as f_in, open(MY_FILE, 'w') as f_out:

 CONTENT = f_in.read()

 # print(content)

 FILE_CONTENTS = race_table(CONTENT)

 # print new_name

 f_out.write(str(FILE_CONTENTS))





if __name__ == '__main__':

 pass

So I found this on stack overflow

In [2]: import string

In [3]: identity = string.maketrans("", "")

In [4]: x = ['+5556', '-1539', '-99', '+1500']

In [5]: x = [s.translate(identity, "+-") for s in x]

In [6]: x
Out[6]: ['5556', '1539', '99', '1500']

but it fails in my file, due to I believe mine being a list of list. Is there 
an easy way to iterate the sublists without flattening?

Current code.

 input_table = [[item.strip(' "') for item in record.split(',')]
for record in text_file.splitlines()]
 # At this point look at input_table to find the record indices
 identity = string.maketrans("", "")
 print(input_table)
 input_table = [s.translate(identity, ",'") for s
in input_table]

Sayth


Take Gregory's advice and use the csv module. Don't reinvent a csv 
parser. My "csv" splitter was the simplest approach possible, which I 
tend to use with undocumented formats, tweaking for unexpected features 
as they come along.


Frederic


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


capturing SNMP trap events

2014-07-04 Thread loial
I want to monitor printers for events such as the completion of printing. 
If the printer initiates an SNMP trap event when the job has finished printing, 
how can I capture this?

Presumably I need some sort of deamon to listen for these trap messages. I have 
looked at pySNMP but am not sure if this can be used to capture SNMP trap 
events from the printer.

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


Re: PEP8 and 4 spaces

2014-07-04 Thread Roy Smith
In article ,
 Gregory Ewing  wrote:

> As long as *all* your tools follow that convention, everything
> is fine. The problems arise when you mix in tools that use
> different conventions.

The problem is, tools always get mixed.  I use emacs.  The next guy uses 
vi.  Somebody else uses Sublime.  The list goes on and on.  You will 
never control what tools other people use.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PEP8 and 4 spaces

2014-07-04 Thread Mihamina Rakotomandimby

On 07/04/2014 04:47 PM, Roy Smith wrote:

As long as*all*  your tools follow that convention, everything
>is fine. The problems arise when you mix in tools that use
>different conventions.

The problem is, tools always get mixed.  I use emacs.  The next guy uses
vi.  Somebody else uses Sublime.  The list goes on and on.  You will
never control what tools other people use.


This may be the subject of a PEP: "What tool will you use" :-)
--
https://mail.python.org/mailman/listinfo/python-list


Re: PEP8 and 4 spaces

2014-07-04 Thread Grant Edwards
On 2014-07-03, Emile van Sebille  wrote:
> On 7/3/2014 2:23 PM, Tobiah wrote:
>> I think your suggestion of having GIT handle the transformations
>> is the way we'll go.  nothing to quibble or worry about.  Well put
>> spaces in the repository since it still seems to be the community's
>> preference and I'll convert to tabs with GIT on the fly.  Problem
>> solved.
>
> Just watch out for mixed tabs and spaces in the same file -- a tab 
> counts as eight spaces and can be used interchangeably in python2.

Definitely. Indenting with tabs vs. spaces is mostly personal
preference (though spaces are better!). But, mixing the two is right
out, and should be stomped on hard.

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


Re: PEP8 and 4 spaces

2014-07-04 Thread Marko Rauhamaa
Grant Edwards :

> Definitely. Indenting with tabs vs. spaces is mostly personal
> preference (though spaces are better!). But, mixing the two is right
> out, and should be stomped on hard.

Often one person writes the code and another person fixes bugs in it or
adds features to it. So if one uses tabs and the other refrains from
using them, you'll get the mixed style you abhor.

Even if we accepted that to be bad style, there's nothing on the screen
that would warn against such usage: the lines seemingly align perfectly,
and the code runs as expected.


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


Re: PEP8 and 4 spaces

2014-07-04 Thread Mark Lawrence

On 04/07/2014 15:28, Grant Edwards wrote:

On 2014-07-03, Emile van Sebille  wrote:

On 7/3/2014 2:23 PM, Tobiah wrote:

I think your suggestion of having GIT handle the transformations
is the way we'll go.  nothing to quibble or worry about.  Well put
spaces in the repository since it still seems to be the community's
preference and I'll convert to tabs with GIT on the fly.  Problem
solved.


Just watch out for mixed tabs and spaces in the same file -- a tab
counts as eight spaces and can be used interchangeably in python2.


Definitely. Indenting with tabs vs. spaces is mostly personal
preference (though spaces are better!). But, mixing the two is right
out, and should be stomped on hard.



Yet another reason to switch to Python 3.

--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


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


Re: PEP8 and 4 spaces

2014-07-04 Thread Chris Angelico
On Sat, Jul 5, 2014 at 12:54 AM, Marko Rauhamaa  wrote:
> Grant Edwards :
>
>> Definitely. Indenting with tabs vs. spaces is mostly personal
>> preference (though spaces are better!). But, mixing the two is right
>> out, and should be stomped on hard.
>
> Often one person writes the code and another person fixes bugs in it or
> adds features to it. So if one uses tabs and the other refrains from
> using them, you'll get the mixed style you abhor.
>
> Even if we accepted that to be bad style, there's nothing on the screen
> that would warn against such usage: the lines seemingly align perfectly,
> and the code runs as expected.

That depends on your editor. SciTE, for instance, will give a warning
any time indentation changes wrongly; if you mix tabs and spaces,
there'll be error markers at the beginning of each change (so if
there's one line with eight spaces amid a sea of tabs, that line and
the one below it will be marked).

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


Re: PEP8 and 4 spaces

2014-07-04 Thread Mark Lawrence

On 04/07/2014 15:54, Marko Rauhamaa wrote:

Grant Edwards :


Definitely. Indenting with tabs vs. spaces is mostly personal
preference (though spaces are better!). But, mixing the two is right
out, and should be stomped on hard.


Often one person writes the code and another person fixes bugs in it or
adds features to it. So if one uses tabs and the other refrains from
using them, you'll get the mixed style you abhor.

Even if we accepted that to be bad style, there's nothing on the screen
that would warn against such usage: the lines seemingly align perfectly,
and the code runs as expected.

Marko



Only for the very old fashioned Python 2, the modern Python 3 has booted 
mixed tabs and spaces into touch.


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


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


Re: PEP8 and 4 spaces

2014-07-04 Thread Mark Lawrence

On 04/07/2014 14:59, Mihamina Rakotomandimby wrote:

On 07/04/2014 04:47 PM, Roy Smith wrote:

As long as*all*  your tools follow that convention, everything
>is fine. The problems arise when you mix in tools that use
>different conventions.

The problem is, tools always get mixed.  I use emacs.  The next guy uses
vi.  Somebody else uses Sublime.  The list goes on and on.  You will
never control what tools other people use.


This may be the subject of a PEP: "What tool will you use" :-)


I'll nominate our resident unicode expert to write the PEP as he's also 
an expert on tools.  Consider his superb use of the greatly loved google 
groups for example.  Sadly I understand that he has yet to master the 
intricacies of pip, but I'm sure that'll come with practice, or has he 
given up?


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


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


Re: PEP8 and 4 spaces

2014-07-04 Thread Marko Rauhamaa
Mark Lawrence :

> Only for the very old fashioned Python 2, the modern Python 3 has
> booted mixed tabs and spaces into touch.

Since Python 3 (alas!) got into the business of booting, it should have
booted tabs altogether.


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


Re: PEP8 and 4 spaces

2014-07-04 Thread George Silva
Isn't this an old discussion? Just configure your editor properly. In my
team we all use spaces, but I'll be damned if I need to type 12 spaces in a
row. I'll just configured Sublime to insert spaces instead of tabs. Problem
solved.


On Fri, Jul 4, 2014 at 12:12 PM, Mark Lawrence 
wrote:

> On 04/07/2014 14:59, Mihamina Rakotomandimby wrote:
>
>> On 07/04/2014 04:47 PM, Roy Smith wrote:
>>
>>> As long as*all*  your tools follow that convention, everything
 >is fine. The problems arise when you mix in tools that use
 >different conventions.

>>> The problem is, tools always get mixed.  I use emacs.  The next guy uses
>>> vi.  Somebody else uses Sublime.  The list goes on and on.  You will
>>> never control what tools other people use.
>>>
>>
>> This may be the subject of a PEP: "What tool will you use" :-)
>>
>
> I'll nominate our resident unicode expert to write the PEP as he's also an
> expert on tools.  Consider his superb use of the greatly loved google
> groups for example.  Sadly I understand that he has yet to master the
> intricacies of pip, but I'm sure that'll come with practice, or has he
> given up?
>
>
> --
> My fellow Pythonistas, ask not what our language can do for you, ask what
> you can do for our language.
>
> Mark Lawrence
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
George R. C. Silva
SIGMA Consultoria

http://www.consultoriasigma.com.br/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PEP8 and 4 spaces

2014-07-04 Thread Emile van Sebille

On 7/4/2014 7:57 AM, Mark Lawrence wrote:

On 04/07/2014 15:28, Grant Edwards wrote:

On 2014-07-03, Emile van Sebille  wrote:



Just watch out for mixed tabs and spaces in the same file -- a tab
counts as eight spaces and can be used interchangeably in python2.


Definitely. Indenting with tabs vs. spaces is mostly personal
preference (though spaces are better!). But, mixing the two is right
out, and should be stomped on hard.



Yet another reason to switch to Python 3.


For new projects, sure. But since the v1.5 days I've deployed the 
current python version a dozen times a year on various one-offs so that 
I'm sure I've got every python version deployed somewhere, and they just 
run, so why fix something that works. Or upgrade it when a three line 
fix addresses the issue.


Emile


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


Re: Why is regexp not working?

2014-07-04 Thread MRAB

On 2014-07-04 13:27, Florian Lindner wrote:

Hello,

I have that piece of code:

 def _split_block(self, block):
 cre = [re.compile(r, flags = re.MULTILINE) for r in self.regexps]
 block = "".join(block)
 print(block)
 print("---")
 for regexp in cre:
 match = regexp.match(block)
 for grp in regexp.groupindex:
 data = match.group(grp) if match else None
 self.data[grp].append(data)


block is a list of strings, terminated by \n. self.regexps:


self.regexps = [r"it (?P\d+) .* dt complete yes |
write-iteration-checkpoint |",
 r"it (?P\d+) read ahead"


If I run my program it looks like that:


it 1 ahadf dt complete yes | write-iteration-checkpoint |
Timestep completed

---
it 1 read ahead
it 2 ahgsaf dt complete yes | write-iteration-checkpoint |
Timestep completed

---
it 4 read ahead
it 3 dfdsag dt complete yes | write-iteration-checkpoint |
Timestep completed

---
it 9 read ahead
it 4 dsfdd dt complete yes | write-iteration-checkpoint |
Timestep completed

---
it 16 read ahead
---
{'it_read_ahead': [None, '1', '4', '9', '16'], 'coupling_iterations': ['1',
None, None, None, None]}

it_read_ahead is always matched when it should (all blocks but the first).
But why is the regexp containing coupling_iterations only matched in the
first block?

I tried different combinations using re.match vs. re.search and with or
without re.MULTILINE.


The character '|' is a metacharacter that separates alternatives. For
example, the regex 'a|b' will match 'a' or b'.

Your regexes end with '|', which means that they will match an empty
string at the start of the target string.

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


Re: PEP8 and 4 spaces

2014-07-04 Thread Mark Lawrence

On 04/07/2014 16:57, Emile van Sebille wrote:

On 7/4/2014 7:57 AM, Mark Lawrence wrote:

On 04/07/2014 15:28, Grant Edwards wrote:

On 2014-07-03, Emile van Sebille  wrote:



Just watch out for mixed tabs and spaces in the same file -- a tab
counts as eight spaces and can be used interchangeably in python2.


Definitely. Indenting with tabs vs. spaces is mostly personal
preference (though spaces are better!). But, mixing the two is right
out, and should be stomped on hard.



Yet another reason to switch to Python 3.


For new projects, sure. But since the v1.5 days I've deployed the
current python version a dozen times a year on various one-offs so that
I'm sure I've got every python version deployed somewhere, and they just
run, so why fix something that works. Or upgrade it when a three line
fix addresses the issue.

Emile



Surely the issue of mixing tabs and spaces is much more important than 
working systems? :)


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


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


Re: PEP8 and 4 spaces

2014-07-04 Thread Maciej Dziardziel
> Surely the issue of mixing tabs and spaces is much more important than 
> 
> working systems? :)


Python 3 considers tabs as an error and refuses to work.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PEP8 and 4 spaces

2014-07-04 Thread Roy Smith
In article ,
 George Silva  wrote:

> Isn't this an old discussion? Just configure your editor properly. In my
> team we all use spaces, but I'll be damned if I need to type 12 spaces in a
> row. I'll just configured Sublime to insert spaces instead of tabs. Problem
> solved.

On emacs, I used auto-indent mode.  I hit tab, and it automatically 
inserts the correct number of spaces (where "correct" is 
language-specific; for Python, it uses the pep-8 rules).  It also does 
syntax highlighting, parenthesis and quote matching, keyword 
recognition, etc.

I assume any sane editor has similar functionality.  I see my coworkers 
using vim, sublime, eclipse, and X-code.  They all appear to do these 
things, and I would thus classify any of them as sane editors.  I'm sure 
there are others.  If the tool you're (in the generic sense of "you") 
using doesn't have this type of basic language support, you should 
reconsider your choice of tool.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PEP8 and 4 spaces

2014-07-04 Thread Steven D'Aprano
On Fri, 04 Jul 2014 09:19:24 -0700, Maciej Dziardziel wrote:

>> Surely the issue of mixing tabs and spaces is much more important than
>> working systems? :)
> 
> 
> Python 3 considers tabs as an error and refuses to work.


Incorrect.


[steve@ando ~]$ python3
Python 3.3.0rc3 (default, Sep 27 2012, 18:44:58)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux
Type "help", "copyright", "credits" or "license" for more information.
=== startup script executed ===
py> code = """
... def func():
... \treturn 23
...
... print( func() + 1000 )
... """
py>
py> exec(code)
1023



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


Re: PEP8 and 4 spaces

2014-07-04 Thread George Silva
> I assume any sane editor has similar functionality.  I see my coworkers
> using vim, sublime, eclipse, and X-code.  They all appear to do these
> things, and I would thus classify any of them as sane editors.  I'm sure
> there are others.  If the tool you're (in the generic sense of "you")
> using doesn't have this type of basic language support, you should
> reconsider your choice of tool


Could not agree more :D
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: general module auditing

2014-07-04 Thread Irmen de Jong
On 4-7-2014 1:09, Rita wrote:
> 
> here is what I am doing now,
> 
> egrep 'from|import' *.py | wc -l which is giving me that. But this does not
> give me the number of times the particular module gets called. I was
> thinking of adding a logging feature to all of my modules so every time
> they get called it will be written to a log file with corresponding host
> and username. Is there an easy way to do that?


Okay I've read up a bit on Python import hooks and came up with the following 
code.
It hooks into Python's import mechanim by putting a custom loader into 
sys.meta_path
that logs the time, the user, the machine and the name of the module being 
imported.
Theoretically you could load this as a startup module (sitecustomize.py?) and 
make it
log to a central location or something like that.

The code at the end of this message outputs the following on my machine:

$ python audit.py
Hello I'm about to import a module.
2014-07-04 19:01:12,321 [irmen@Neptune] importing /cgi
2014-07-04 19:01:12,323 [irmen@Neptune] importing /urlparse
2014-07-04 19:01:12,328 [irmen@Neptune] importing /mimetools
[... and some more modules...]
Bye.



Code follows:


import sys
import logging
import socket
import os
import getpass


def setup_import_logging():
class ContextFilter(logging.Filter):
def filter(self, record):
record.hostname = socket.gethostname()
if sys.version_info < (3, 0):
record.username = getpass.getuser()
else:
record.username = os.getlogin()
return True

# configure the logger, adapt as desired:
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s
[%(username)s@%(hostname)s] %(message)s")

class AuditingImporter(object):
log = logging.getLogger("auditingimporter")
log.setLevel(logging.DEBUG)
log.addFilter(ContextFilter())

def find_module(self, fullname, path):
return self.find_spec(fullname, path)

def find_spec(self, fullname, path, target=None):
self.log.debug("importing {path}/{fullname}".format(path=path or "",
fullname=fullname))
return None

sys.meta_path.insert(0, AuditingImporter())


setup_import_logging()

print("Hello I'm about to import a module.")

import cgi  # will generate a load of logging entries

print("Bye.")




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


Re: general module auditing

2014-07-04 Thread Irmen de Jong
On 4-7-2014 19:05, Irmen de Jong wrote:
> The code at the end of this message outputs the following on my machine:
[...]

hmm the formatting got screwed up a bit it seems.
Here's the same code: https://gist.github.com/irmen/c3d07118a8e1a00367f5


Irmen

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


Re: PEP8 and 4 spaces

2014-07-04 Thread Lie Ryan

On 04/07/14 07:55, Gregory Ewing wrote:

Steven D'Aprano wrote:


That's exactly the problem with tabs - whatever you think your code
looks like with tabs, other people will see quite different picture.


Why do you consider this a problem?


It's a problem if you try to use tabs for lining things
up in a tabular fashion in your source code.

The solution is not to use tabs for that -- only use
tabs for indentation, and use spaces for everything
else. Or, as PEP 8 suggests, don't try to line things
up in the first place.


PEP8 suggests using this style of method invocation:

obj.method(foo,
   bar,
   baz)

which is an effect impossible to do correctly with tabs alone. If you 
want to follow this style strictly, you end up having to either mix tabs 
and spaces, or just use spaces, or as I prefer it, avoid the issue 
altogether:


obj.method(
foo,
bar,
baz,
)

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


Re: PEP8 and 4 spaces

2014-07-04 Thread Simon Ward


On 4 July 2014 15:54:50 BST, Marko Rauhamaa  wrote:
>Even if we accepted that to be bad style, there's nothing on the screen
>that would warn against such usage: the lines seemingly align
>perfectly,
>and the code runs as expected.

If using vim, set list and listchars, you get to highlight tabs and trailing 
spaces.

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


Re: PEP8 and 4 spaces

2014-07-04 Thread Roy Smith
In article ,
 Lie Ryan  wrote:

> PEP8 suggests using this style of method invocation:
> 
>  obj.method(foo,
> bar,
> baz)
> 
> which is an effect impossible to do correctly with tabs alone.

If course you can do it with tabs. Just make sure all your method names 
are 7 letters long :-)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PEP8 and 4 spaces

2014-07-04 Thread Mark Lawrence

On 04/07/2014 20:04, Roy Smith wrote:

In article ,
  Lie Ryan  wrote:


PEP8 suggests using this style of method invocation:

  obj.method(foo,
 bar,
 baz)

which is an effect impossible to do correctly with tabs alone.


If course you can do it with tabs. Just make sure all your method names
are 7 letters long :-)



When the homework gets handed in I guess the lecturer will know who's 
read this thread :)


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


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


This Python script cannot open by a editor?

2014-07-04 Thread rxjwg98
Hi,

I am learning a Python Tool from web: 
http://www.ohwr.org/projects/hdl-make/wiki/Quick-start-new

I download the program to Ubuntu 12.04. I find that in the folder it is shown as
hdlmake-v1.0, 37.8 KB Python Script. I remember that script file can be loaded
to an editor to read its content. But, when I open it by double click, it is
shown as like binary file in GEDIT. 

What is the reason of this?

A general Python file has .py extension, and can be edited. Is it right?

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


Re: This Python script cannot open by a editor?

2014-07-04 Thread jkn
Hi there
the script is 'actually' a python script compressed, with a short header 
(see the '#!/usr/bin/python' right at the front? I'm guessing that if you make 
it executable, and run it, then it will either create a .py file that you can 
edit, or just run the hdlmake function that you want.

This is not very well explained on the wiki page that you link to... you might 
also try downloading the alternative distributions on the download page.

HTH
jon N


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


Re: PEP8 and 4 spaces

2014-07-04 Thread Gregory Ewing

Lie Ryan wrote:

PEP8 suggests using this style of method invocation:

obj.method(foo,
   bar,
   baz)

which is an effect impossible to do correctly with tabs alone.


Yes, PEP 8 is self-contradictory in that regard.
I also happen to think that recommendation is insane
for other reasons as well, and cheerfully ignore it.

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


Re: PEP8 and 4 spaces

2014-07-04 Thread Gregory Ewing

Roy Smith wrote:
The problem is, tools always get mixed.  I use emacs.  The next guy uses 
vi.  Somebody else uses Sublime.  The list goes on and on.  You will 
never control what tools other people use.


Yes, but my point is that none of the tools are "broken",
they're just incompatible.

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


Re: PEP8 and 4 spaces

2014-07-04 Thread Tim Chase
On 2014-07-05 11:17, Gregory Ewing wrote:
> > PEP8 suggests using this style of method invocation:
> > 
> > obj.method(foo,
> >bar,
> >baz)
> > 
> > which is an effect impossible to do correctly with tabs alone.  
> 
> Yes, PEP 8 is self-contradictory in that regard.
> I also happen to think that recommendation is insane
> for other reasons as well, and cheerfully ignore it.

To be fair, in the same section[1] that example is given, it also
suggests

# More indentation included to distinguish this from the rest.
def long_function_name(
var_one, var_two, var_three,
var_four):
print(var_one)

# Hanging indents should add a level.
foo = long_function_name(
var_one, var_two,
var_three, var_four)

both of which can be done with arbitrary indentation without the need
to mix tabs+spaces or use a non-integer multiple of
indentation-spaces.  I just use these two in all instances and (as
you, Greg, advise), "cheerfully ignore [the first form]"


The only time I intentionally violate the "don't do these" section

"""
# Arguments on first line forbidden when not using vertical alignment.
foo = long_function_name(var_one, var_two,
var_three, var_four)
"""

is when defining options in optparse:

  parser.add_option("-v", "--verbose",
help="be prolix",
action="store_true",
dest="verbose",
default=False,
)

as I find that a little easier to read when I'm scanning large blocks
of parser.add_option(...) calls, having the option stick out to the
right.

-tkc

[1] http://legacy.python.org/dev/peps/pep-0008/#indentation




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


Re: This Python script cannot open by a editor?

2014-07-04 Thread Steven D'Aprano
On Fri, 04 Jul 2014 14:50:02 -0700, rxjwg98 wrote:

> Hi,
> 
> I am learning a Python Tool from web:
> http://www.ohwr.org/projects/hdl-make/wiki/Quick-start-new

Did you read that web page? It says:

To get the code you have two choices: you might clone the 
repository, which contains the most recent changes (more 
features, more bugs too...) or download a frozen version 
in a form of a "binary" file.


> I download the program to Ubuntu 12.04. I find that in the folder it is
> shown as hdlmake-v1.0, 37.8 KB Python Script. 

At the bash shell from inside that folder, run:

file hdlmake-v1.0


What does it say?



> I remember that script
> file can be loaded to an editor to read its content. But, when I open it
> by double click, it is shown as like binary file in GEDIT.
> 
> What is the reason of this?

Because it is a binary file.


> A general Python file has .py extension, and can be edited. Is it right?

Python *source code* normally has a .py extension, although it could have 
no extension at all.

Python *byte code* is a binary file, usually with a .pyc or .pyo 
extension. On Windows, sometimes you also get .pyw.

You can also get Python code inside a zip file, which may have a .zip 
extension. On Windows, you can get Python code frozen in a .exe file, and 
I believe on Mac you can get it frozen in a .app file.



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


Re: PEP8 and 4 spaces

2014-07-04 Thread Rick Johnson
On Thursday, July 3, 2014 12:31:04 PM UTC-5, Tobiah wrote:
> Coworker takes PEP8 as gospel and uses 4 spaces 

I'm saddened that every one of these little "tabs versus
spaces" arguments revolve more around selfishness and less
around an understanding of what a "tabs" and "spaces"
actually *are*, because, how can you solve a problem when
you're unable to understand the fundamental dicotomoy of
this relationship between "tabs" and "spaces"?

I believe the whole issue can be boiled down into: "Use the
correct tool for the job". And there in lies the rub, before
we can make the *choice*, we must comprehend the
*differences*.


 What is a "space"


Duh!


 What is a "tab"


We all know "tabs" are used to present text in tabular form
(aka: tables), however, tabs are much more than merely a
"concatenation-of-N-spaces". Not only do tabs allow a user
to control alignments via the mechanical process of pressing
the "tab key", tabs also allow a more powerful and precise
"hook" into the underlying mechinism of vertical alignments
via "rules" defined by the user.

AND THIS LAST POINT IS THE TRUE POWER OF "TABS"!

Yes, "tabs" are an extrapolation of "spaces", but they are
also more powerful than a "space" could ever be. If we
imagine "spaces" and "backspaces" to be like *addtion* and
*subtraction*, we can extrapolate that "tabs" and um, well,
"backtabs" to be like *multiplication* and *division* -- not
in a quantitve sense of course, but in an "exponentially
more powerful" sense. 


 Tabs or spaces?


And now we must answer the burning question. 

Not that my habits really matter but I myself use only
spaces and NEVER tabs, and i only use four spaces, never
more, never less,,, and i don't use spaces because i prefer
spaces over tabs, no, i use spaces because spaces are going
to render the same in all editors.

Strangly, I rather fancy the idea of using tabs in code,,,
which allow each viewer to view the code in his or her level
of indention,,, however, i cannot justify using a tab as a
replacement for a space. Tabs should be used for "tabular"
data (aka: speadsheets), and since code is NOT tabular data,
we would be wise to use the space char for indention.

from brain import logic
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PEP8 and 4 spaces

2014-07-04 Thread Rick Johnson
[A continuation of my last reply...]

Here is a recent situation that occurred to me that showcases
the tendency of humans to carelessly bind illogical terms to
common objects, thereby creating a inverse esoteric of
ubiquitous illogic, in this case, the term: "flash-light".


 Illuminating the illogical:


A friend and myself where working outside and as the light
began to fade he realized we needed a light source, so he
called out: 

"SOMEBODY GET ME A FLASH-LIGHT!"

As i was heading in to grab a "flashlight" i realized the
bombastic insanity of such a term. Why is a handheld light
called a flashlight? It does not flash, in fact, its main
purpose is to provide a consistent light source that is easy
to carry, whereas flashing would be quite annoying!

*And just then that mischievous little inner voice started
whispering in my ear, giving me "ideas", Muahahah!*

So i returned to my friend who was already quite annoyed
with his repair project, and started "flashing" the light on
and off. He quickly turned around and demanded: "What the
hell are you doing?", to which i replied, "You asked for a
flash-light, yes?"

Of course everyone knows that a flash light does not
"flash", so why do we continue to propagate such foolish
terms? Well, for the same reason language designers keep
giving us illogical terms like "function" and "class", but i
digress.

The point is we go around the world falsely believing we have
a strong grasp of the simple things, when in fact, a whole
world of illogic infects our understanding of even the most
basic aspects of our lives.

Of course, I'm anxiously await my friend to ask for a "drop
light" -- oh boy, that will be fun! >:^)
-- 
https://mail.python.org/mailman/listinfo/python-list


Your message to sqlite-users awaits moderator approval

2014-07-04 Thread sqlite-users-bounces
Your mail to 'sqlite-users' with the subject

hi

Is being held until the list moderator can review it for approval.

The reason it is being held:

Post by non-member to a members-only list

Either the message will get posted to the list, or you will receive
notification of the moderator's decision.  If you would like to cancel
this posting, please visit the following URL:


http://sqlite.org:8080/cgi-bin/mailman/confirm/sqlite-users/2d7d8debd5e7f2d664ffa70c079cc75008d59b73

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


Re: Your message to sqlite-users awaits moderator approval

2014-07-04 Thread Steve Hayes
On Sat, 05 Jul 2014 01:00:22 -0400, sqlite-users-boun...@sqlite.org wrote:

>Your mail to 'sqlite-users' with the subject
>
>hi
>
>Is being held until the list moderator can review it for approval.
>
>The reason it is being held:
>
>Post by non-member to a members-only list

So has someone tried to gate the comp.lang.python newsgroup to an Sqlite
mailing list without the list owner's permission?


-- 
Steve Hayes from Tshwane, South Africa
Web:  http://www.khanya.org.za/stevesig.htm
Blog: http://khanya.wordpress.com
E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Your message to sqlite-users awaits moderator approval

2014-07-04 Thread Chris Angelico
On Sat, Jul 5, 2014 at 4:19 PM, Steve Hayes  wrote:
> On Sat, 05 Jul 2014 01:00:22 -0400, sqlite-users-boun...@sqlite.org wrote:
>
>>Your mail to 'sqlite-users' with the subject
>>
>>hi
>>
>>Is being held until the list moderator can review it for approval.
>>
>>The reason it is being held:
>>
>>Post by non-member to a members-only list
>
> So has someone tried to gate the comp.lang.python newsgroup to an Sqlite
> mailing list without the list owner's permission?

More likely someone just posted a piece of spam with a forged From
address. If some piece of malware got access to somebody's address
book and started sending spam "from" one address to another address,
picked at random, it's entirely possible that it'd pick two list
addresses. At that point, the target list will get an email from an
address it doesn't recognize, and what you see above happens -
non-members aren't allowed to post to most lists (without a mod's
approval; I run a list for a local society's committee, and it's
normal for people to send something to the committee who aren't
members of it, so those posts go to the moderation queue), and the
post gets bounced.

When it first came in, I clicked on the link to cancel the post, but
someone beat me to it. :)

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