Re: I need some help interpreting this error

2021-02-17 Thread Terry Reedy
On 2/17/2021 10:40 AM, Chris Green wrote: I'm running this using Python 3.7 on a Linux system. Most of the time (i.e. for a couple of days now) the program has been satifactorily delivering mail messages, hundreds of them. However one mail message has provoked the following error:- chris@

Re: I need some help interpreting this error

2021-02-17 Thread 2QdxY4RzWzUUiLuE
On 2021-02-17 at 17:36:48 +, Chris Green wrote: > Stefan Ram wrote: > > Chris Green writes: > > >chris@cheddar$ tail mail.err > > >Traceback (most recent call last): > > > File "/home/chris/.mutt/bin/filter.py", line 95, in > > >if sbstrip in msghdr["subject"]: > > >

Re: I need some help interpreting this error

2021-02-17 Thread 2QdxY4RzWzUUiLuE
On 2021-02-17 at 16:52:55 +, Chris Green wrote: > Stefan Ram wrote: > > Chris Green writes: > > >But msghdr["subject"] is surely just a string isn't it? Why is it > > >complaining about something of type 'Header'? > > > > What would you do to debug-print the type of an object? > > > I

Re: I need some help interpreting this error

2021-02-17 Thread Chris Green
Stestagg wrote: > I don't particularly like to encourage this shotgun help request because, > as previous commenter suggests, debugging this yourself is best. > > Sometimes debugging is super hard, and especially so when uncommon > situations occur, but it's always far easier to debug things when

Re: I need some help interpreting this error

2021-02-17 Thread Stestagg
Some sources, in case they help: Message.get() calls policy.header_fetch_parse ( https://github.com/python/cpython/blob/cd80f430daa7dfe7feeb431ed34f88db5f64aa30/Lib/email/message.py#L471 ) Compat32.header_fetch_parse calls self._sanitize_header ( https://github.com/python/cpython/blob/cd80f430daa7

Re: I need some help interpreting this error

2021-02-17 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >chris@cheddar$ tail mail.err > >Traceback (most recent call last): > > File "/home/chris/.mutt/bin/filter.py", line 95, in > >if sbstrip in msghdr["subject"]: > >TypeError: argument of type 'Header' is not iterable > >But msghdr

Re: I need some help interpreting this error

2021-02-17 Thread Stestagg
I don't particularly like to encourage this shotgun help request because, as previous commenter suggests, debugging this yourself is best. Sometimes debugging is super hard, and especially so when uncommon situations occur, but it's always far easier to debug things when you have visibility into t

Re: I need some help interpreting this error

2021-02-17 Thread Chris Green
2qdxy4rzwzuui...@potatochowder.com wrote: > On 2021-02-17 at 16:42:03 +, > Chris Green wrote: > > > 2qdxy4rzwzuui...@potatochowder.com wrote: > > > On 2021-02-17 at 15:40:27 +, > > > Chris Green wrote: > > > > > > > I'm running this using Python 3.7 on a Linux system. > > > > > > > > M

Re: I need some help interpreting this error

2021-02-17 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >But msghdr["subject"] is surely just a string isn't it? Why is it > >complaining about something of type 'Header'? > > What would you do to debug-print the type of an object? > I don't know, what would I do? :-) Without knowing what provokes the

Re: I need some help interpreting this error

2021-02-17 Thread 2QdxY4RzWzUUiLuE
On 2021-02-17 at 16:42:03 +, Chris Green wrote: > 2qdxy4rzwzuui...@potatochowder.com wrote: > > On 2021-02-17 at 15:40:27 +, > > Chris Green wrote: > > > > > I'm running this using Python 3.7 on a Linux system. > > > > > > Most of the time (i.e. for a couple of days now) the program ha

Re: I need some help interpreting this error

2021-02-17 Thread Chris Green
2qdxy4rzwzuui...@potatochowder.com wrote: > On 2021-02-17 at 15:40:27 +, > Chris Green wrote: > > > I'm running this using Python 3.7 on a Linux system. > > > > Most of the time (i.e. for a couple of days now) the program has been > > satifactorily delivering mail messages, hundreds of them.

Re: I need some help interpreting this error

2021-02-17 Thread 2QdxY4RzWzUUiLuE
On 2021-02-17 at 15:40:27 +, Chris Green wrote: > I'm running this using Python 3.7 on a Linux system. > > Most of the time (i.e. for a couple of days now) the program has been > satifactorily delivering mail messages, hundreds of them. However one > mail message has provoked the following

I need some help interpreting this error

2021-02-17 Thread Chris Green
I'm running this using Python 3.7 on a Linux system. Most of the time (i.e. for a couple of days now) the program has been satifactorily delivering mail messages, hundreds of them. However one mail message has provoked the following error:- chris@cheddar$ tail mail.err Traceback (most re

Re: Hi! i need some help with a program in python on Raspberry pi3.

2017-04-17 Thread breamoreboy
On Friday, April 14, 2017 at 3:27:29 PM UTC+1, Kasper wrote: > every time i run the program i get this messeage: > > Traceback (most recent call last): > File "smartmirror.py", line 159, in get_weather > temprature2 = "%S%S" % (str(int(weather_obj['currently']['temperature'])), > degree_sign

Re: Hi! i need some help with a program in python on Raspberry pi3.

2017-04-14 Thread Terry Reedy
On 4/14/2017 10:27 AM, Kasper wrote: every time i run the program i get this messeage: Traceback (most recent call last): File "smartmirror.py", line 159, in get_weather temprature2 = "%S%S" % (str(int(weather_obj['currently']['temperature'])), degree_sign) KeyError: 'currently' Error: 'cu

Re: Hi! i need some help with a program in python on Raspberry pi3.

2017-04-14 Thread Peter Otten
Kasper wrote: > every time i run the program i get this messeage: > > Traceback (most recent call last): > File "smartmirror.py", line 159, in get_weather > temprature2 = "%S%S" % (str(int(weather_obj['currently'] ['temperature'])), > degree_sign) > KeyError: 'currently' > Error: 'currently

Re: Hi! i need some help with a program in python on Raspberry pi3.

2017-04-14 Thread Steve D'Aprano
On Sat, 15 Apr 2017 12:27 am, Kasper wrote: > every time i run the program i get this messeage: > > Traceback (most recent call last): > File "smartmirror.py", line 159, in get_weather > temprature2 = "%S%S" % > (str(int(weather_obj['currently']['temperature'])), > degree_sign) > KeyErr

Hi! i need some help with a program in python on Raspberry pi3.

2017-04-14 Thread Kasper
every time i run the program i get this messeage: Traceback (most recent call last): File "smartmirror.py", line 159, in get_weather temprature2 = "%S%S" % (str(int(weather_obj['currently']['temperature'])), degree_sign) KeyError: 'currently' Error: 'currently'. Cannot get weather. How do i

Re: I need some help with a regexp please

2006-09-26 Thread Fredrik Lundh
Frederic Rentsch wrote: > If I may add another thought along the same line: regular expressions > seem to tend towards an art form, or an intellectual game. Many > discussions revolving around regular expressions convey the impression > that the challenge being pursued is finding a magic formul

Re: I need some help with a regexp please

2006-09-26 Thread codefire
> for dense guys like myself, regular expressions work best if you use > them as simple tokenizers, and they suck pretty badly if you're trying > to use them as parsers. :) Well, I'm with you on that one Fredrik! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: I need some help with a regexp please

2006-09-26 Thread codefire
> I still don't touch regular expressions... They may be fast, but to > me they are just as much line noise as PERL... I can usually code a > partial "parser" faster than try to figure out an RE. Yes, it seems to me that REs are a bit "hit and miss" - the only way to tell if you've got a RE "righ

Re: I need some help with a regexp please

2006-09-26 Thread Frederic Rentsch
Dennis Lee Bieber wrote: > On 25 Sep 2006 10:25:01 -0700, "codefire" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >> Yes, I didn't make it clear in my original post - the purpose of the >> code was to learn something about regexps (I only started coding Python >> last w

Re: I need some help with a regexp please

2006-09-25 Thread codefire
Yes, I didn't make it clear in my original post - the purpose of the code was to learn something about regexps (I only started coding Python last week). In terms of learning "a little more" the example was successful. However, creating a full email validator is way beyond me - the rules are far too

I need some help with a regexp please

2006-09-22 Thread Sorin Schwimmer
Hi,My $0.02:re.compile('^\w+([\.-]?\w+)[EMAIL PROTECTED]([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|intl|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$')I picked it up from the Net, and while it may be not perfect (you've got lots of reply's telling you why),it's good enough for me.Good luck,Sorin--

Re: I need some help with a regexp please

2006-09-22 Thread Ant
John Machin wrote: > Ant wrote: > > John Machin wrote: > > ... > > > A little more is unfortunately not enough. The best advice you got was > > > to use an existing e-mail address validator. > > > > We got bitten by this at the last place I worked - we were using a > > regex email validator (from

Re: I need some help with a regexp please

2006-09-22 Thread John Machin
Ant wrote: > John Machin wrote: > ... > > A little more is unfortunately not enough. The best advice you got was > > to use an existing e-mail address validator. > > We got bitten by this at the last place I worked - we were using a > regex email validator (from Microsoft IIRC), and we kept having

Re: Don't use regular expressions to "validate" email addresses (was: I need some help with a regexp please)

2006-09-22 Thread Ant
Ben Finney wrote: ... > The best advice I've seen when people ask "How do I validate whether > an email address is valid?" was "Try sending mail to it". There are advantages to the regex method. It is faster than sending an email and getting a positive or negative return code. The delay may not b

Re: I need some help with a regexp please

2006-09-22 Thread Ant
John Machin wrote: ... > A little more is unfortunately not enough. The best advice you got was > to use an existing e-mail address validator. We got bitten by this at the last place I worked - we were using a regex email validator (from Microsoft IIRC), and we kept having problems with specific

Don't use regular expressions to "validate" email addresses (was: I need some help with a regexp please)

2006-09-21 Thread Ben Finney
"John Machin" <[EMAIL PROTECTED]> writes: > A little more is unfortunately not enough. The best advice you got was > to use an existing e-mail address validator. The definition of a valid > e-mail address is complicated. You may care to check out "Mastering > Regular Expressions" by Jeffery Friedl

Re: I need some help with a regexp please

2006-09-21 Thread John Machin
codefire wrote: > Hi, > > thanks for the advice guys. > > Well took the kids swimming, watched some TV, read your hints and > within a few minutes had this: > > r = re.compile(r'[EMAIL PROTECTED]@\s]+\.\w+') > > This works for me. That is if you have an invalid email such as > tony..bATblah.com it

Re: I need some help with a regexp please

2006-09-21 Thread codefire
Hi, thanks for the advice guys. Well took the kids swimming, watched some TV, read your hints and within a few minutes had this: r = re.compile(r'[EMAIL PROTECTED]@\s]+\.\w+') This works for me. That is if you have an invalid email such as tony..bATblah.com it will reject it (note the double do

Re: I need some help with a regexp please

2006-09-21 Thread Steve Holden
codefire wrote: > Hi, > > I am trying to get a regexp to validate email addresses but can't get > it quite right. The problem is I can't quite find the regexp to deal > with ignoring the case [EMAIL PROTECTED], which is not valid. Here's > my attempt, neither of my regexps work quite how I want: >

Re: I need some help with a regexp please

2006-09-21 Thread Neil Cerutti
On 2006-09-21, codefire <[EMAIL PROTECTED]> wrote: > I am trying to get a regexp to validate email addresses but > can't get it quite right. The problem is I can't quite find the > regexp to deal with ignoring the case [EMAIL PROTECTED], > which is not valid. Here's my attempt, neither of my regexp

Re: I need some help with a regexp please

2006-09-21 Thread [EMAIL PROTECTED]
codefire wrote: > Hi, > > I am trying to get a regexp to validate email addresses but can't get > it quite right. The problem is I can't quite find the regexp to deal > with ignoring the case [EMAIL PROTECTED], which is not valid. Here's > my attempt, neither of my regexps work quite how I want: >

I need some help with a regexp please

2006-09-21 Thread codefire
Hi, I am trying to get a regexp to validate email addresses but can't get it quite right. The problem is I can't quite find the regexp to deal with ignoring the case [EMAIL PROTECTED], which is not valid. Here's my attempt, neither of my regexps work quite how I want: [code] import os import re

Re: I need some help

2006-07-12 Thread Jonathan Harris
Tim Heaney wrote: > Several different people have written modules to help you read (and > write) ID3 tags. On a related topic, I have a Perl module that reads MP4/AAC tags - http://search.cpan.org/~jhar/MP4-Info/ - that I'm considering porting to Python. But before I start, is anyone aware of an

Re: I need some help

2006-07-11 Thread Tim Heaney
"dammix" <[EMAIL PROTECTED]> writes: > > I'm completely a newbye, I've started studying python since 3 weeks and > now I need to write a small program that reads the id3 tags from the > mp3 contained inside a cd, and then print them into a simple text file, > I hope it's possible to do this, and I

I need some help

2006-07-11 Thread dammix
hello, I'm completely a newbye, I've started studying python since 3 weeks and now I need to write a small program that reads the id3 tags from the mp3 contained inside a cd, and then print them into a simple text file, I hope it's possible to do this, and I hope you can help me too. thanks alot a