Re: Sending an email with a binary attachment

2016-02-29 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 02/29/2016 11:13 AM, Chris Angelico wrote: > On Tue, Mar 1, 2016 at 4:08 AM, Peter Pearson > wrote: >> try: smtp.sendmail(message['From'], message['To'], >> message.as_string()) except: print "Message sending has

Re: Condition fullfilled to early but only "sometimes"

2016-02-29 Thread Ian Kelly
It's not at all clear what the problem is from your description. What is it that you expect the code to do? What is it doing instead that violates your expectation? Why are you asking for Javascript help on a Python mailing list? On Mon, Feb 29, 2016 at 10:40 PM,

[issue26457] Error in ipaddress.address_exclude function

2016-02-29 Thread Xiang Zhang
Xiang Zhang added the comment: I propose a patch simply add one to end so that the broadcast address network will appear in the result, which behaves the same as ipaddr.py. Corresponding tests are added. All tests are passed but I am afraid some logic may break. -- keywords: +patch

Re: Reason for not allowing import twice but allowing reload()

2016-02-29 Thread Terry Reedy
On 2/29/2016 8:22 AM, alien2u...@gmail.com wrote: Hello Rustom, F5 in Idle restarts the Python interpreter (that's what my impression is). More exactly, IDLE runs user code in a separate process from the one that runs the IDLE gui. Restarting means that the existing user process is

Re: Correct IDLE usage (was Reason for not allowing import twice but allowing reload())

2016-02-29 Thread Terry Reedy
On 2/29/2016 7:42 AM, Rustom Mody wrote: Is import needed at all when trying out in Idle? ... So it does appear that 1. import not necessary with(in) idle 2. However import and f5 (ie is run as main) are different May some idle experts elaborate on this? Whats the idle idiom of import-ing?

[issue26404] socketserver context manager

2016-02-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree and consider this is an argument for adding the context manager methods and using them with 'with' in the examples. -- ___ Python tracker

[issue26457] Error in ipaddress.address_exclude function

2016-02-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka stage: -> needs patch ___ Python tracker ___

[issue26462] Patch to enhance literal block language declaration

2016-02-29 Thread Georg Brandl
Georg Brandl added the comment: Thanks for the patch! Most "bash" blocks should be "console" (since the prompt is shown). "pycon" should not be needed, since it is detected automatically. -- ___ Python tracker

[issue26456] import _tkinter + TestForkInThread leaves zombie with stalled thread

2016-02-29 Thread Martin Panter
Martin Panter added the comment: Yes it looks like you might be right about those hanging buildbots. The occasional successes (e.g. ) seem to happen when test_thread runs before any of the TK, TCL,

Condition fullfilled to early but only "sometimes"

2016-02-29 Thread jonas . thornvall
I've been looking at the code for two days so i am a bit crosseyed. If anyone could help me set the condition so the loop catch the last pair/pairs, it is kind of weird that it succeed sometimes and break to early and report fail others. I would be very greatful if anyone can see why it break

[issue26462] Patch to enhance literal block language declaration

2016-02-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +georg.brandl, serhiy.storchaka stage: -> patch review versions: +Python 3.6 ___ Python tracker

Re: Everything good about Python except GUI IDE?

2016-02-29 Thread Chris Angelico
On Tue, Mar 1, 2016 at 1:33 PM, Terry Reedy wrote: > On 2/29/2016 3:20 AM, Chris Angelico wrote: > >> Incidentally, HTML+CSS is another excellent example of code being used >> to create a visual effect. While there *are* WYSIWYG HTML editors, I'm >> not familiar with any WYISWYG

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Mario R. Osorio
On Saturday, February 27, 2016 at 4:39:12 AM UTC-5, Steven D'Aprano wrote: > The author of Requests, Kenneth Reitz, discusses his recent recovery from a > MentalHealthError exception. > > http://www.kennethreitz.org/essays/mentalhealtherror-an-exception-occurred > > Although the connection to

[issue26457] Error in ipaddress.address_exclude function

2016-02-29 Thread Xiang Zhang
Xiang Zhang added the comment: In old ipaddr.py, IPv4Network('192.0.2.0/31').subnet() returns [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.1/32')], but ipaddress returns only [IPv4Network('192.0.2.0/32')]. It seems simply change end to end+1 in

[issue26463] asyncio-related (?) segmentation fault

2016-02-29 Thread Nicholas Chammas
Changes by Nicholas Chammas : Added file: http://bugs.python.org/file42052/stacktrace.txt ___ Python tracker ___

[issue26463] asyncio-related (?) segmentation fault

2016-02-29 Thread Nicholas Chammas
New submission from Nicholas Chammas: Python 3.5.1, OS X 10.11.3. I have an application that uses asyncio and Cryptography (via the AsyncSSH library). Cryptography has some parts written in C, I believe. I'm testing my application by sending a keyboard interrupt while 2 tasks are working. My

Re: Everything good about Python except GUI IDE?

2016-02-29 Thread Terry Reedy
On 2/29/2016 3:20 AM, Chris Angelico wrote: Incidentally, HTML+CSS is another excellent example of code being used to create a visual effect. While there *are* WYSIWYG HTML editors, I'm not familiar with any WYISWYG HTML+CSS editors, and I much more often see a fast-turnaround code editing

Re: Paramiko Help. Execute command to Interactive Shell which is opened by SSHClient()

2016-02-29 Thread reachparagm
Sagar, Have you worked on RobotFramework-sshlibrary. It seem to have very simple interface for both command processing/execution as well as interactive session to grep responses and decide the flow. Let me know if you face any issues. Can help you solve. -paragm On Thursday, August 8, 2013

[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2016-02-29 Thread STINNER Victor
Changes by STINNER Victor : -- title: ceval: Optimize list -> ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 ___ Python tracker

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Ethan Furman
On 02/29/2016 04:35 PM, Paul Rubin wrote: The story reminded me of "A Beautiful Mind" by Sylvia Nasar, about mathematician John Nash who suffered from mental illness in the 1970s-80's(?) but later recovered and won the Nobel Prize in economics. The book is excellent and I recommend it if you

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Paul Rubin
Ben Finney writes: >> "All that he had learned" meaning his delusions and psychoses? > Indeed. If a revelation is unconnected to reality, it's misleading to > say that one has “learned” it > When someone describes the ill effects their mental illness produced, I >

[issue26462] Patch to enhance literal block language declaration

2016-02-29 Thread Julien
New submission from Julien: Hi, As I don't like warnings, and sphinx-doc was verbose about "Could not parse literal_block as "python3". highlighting skipped.", I fixed most of them. Bonus: It's graphically better, as an example the XML block here:

[issue26280] ceval: Optimize list

2016-02-29 Thread Zach Byrne
Zach Byrne added the comment: The new patch "subscr2" removes the tuple block, and addresses Victor's comments. This one looks a little faster, down to 0.0215 usec for the same test. -- Added file: http://bugs.python.org/file42049/subscr2.patch ___

[issue26460] datetime.strptime without a year fails on Feb 29

2016-02-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: time.strptime() is "working" (not raising an exception) as it appears not to validate the day of the month when a year is not specified, yet the return value from either of these APIs is a date which has no concept of an ambiguous year. ## Via the

Re: common mistakes in this simple program

2016-02-29 Thread Ian Kelly
On Mon, Feb 29, 2016 at 4:14 PM, Cameron Simpson wrote: > Another remark here: if you're going to log, log the exception as well: > > logging.error("something went wrong: %s", e) > > Ian's example code is nice and simple to illustrate "log and then reraise" > but few things

[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-02-29 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Joel Goldstick
On Mon, Feb 29, 2016 at 6:29 PM, Mark Lawrence wrote: > On 29/02/2016 22:40, Larry Martell wrote: > >> On Mon, Feb 29, 2016 at 12:33 PM, Ben Finney >> wrote: >> >>> Rustom Mody writes: >>> >>> On Monday, February 29,

[issue26461] PyInterpreterState_Head(), PyThreadState_Next() etc can't be sanely used

2016-02-29 Thread STINNER Victor
STINNER Victor added the comment: fijal explained on IRC his use case: implement vmprof on Windows, a statistical profiler, using a C thread running in the Python process. The _PyThread_CurrentFrames() API requires to be called with the GIL hold which is not acceptable for his use case.

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Mark Lawrence
On 29/02/2016 22:40, Larry Martell wrote: On Mon, Feb 29, 2016 at 12:33 PM, Ben Finney wrote: Rustom Mody writes: On Monday, February 29, 2016 at 10:26:32 PM UTC+5:30, Ben Finney wrote: Ian Kelly writes: On Mon, Feb 29, 2016 at 9:21 AM,

[issue26461] PyInterpreterState_Head(), PyThreadState_Next() etc can't be sanely used

2016-02-29 Thread STINNER Victor
STINNER Victor added the comment: Are you asking to expose the lock? -- nosy: +haypo, pitrou, serhiy.storchaka ___ Python tracker ___

Re: common mistakes in this simple program

2016-02-29 Thread Rob Gaddi
Cameron Simpson wrote: > On 29Feb2016 10:45, Ian Kelly wrote: >>On Mon, Feb 29, 2016 at 10:26 AM, Ganesh Pal wrote: >>> On Mon, Feb 29, 2016 at 9:59 PM, Ian Kelly wrote: On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal

[issue26461] PyInterpreterState_Head(), PyThreadState_Next() etc can't be sanely used

2016-02-29 Thread Maciej Fijalkowski
New submission from Maciej Fijalkowski: All the internal uses of this API guard everything with HEAD_LOCK/HEAD_UNLOCK that's not exposed. It's not safe to traverse the whole API without holding those locks and those locks are static and module local -- messages: 261030 nosy: fijall

Re: common mistakes in this simple program

2016-02-29 Thread Cameron Simpson
On 29Feb2016 10:45, Ian Kelly wrote: On Mon, Feb 29, 2016 at 10:26 AM, Ganesh Pal wrote: On Mon, Feb 29, 2016 at 9:59 PM, Ian Kelly wrote: On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote: 1. usage

[issue26404] socketserver context manager

2016-02-29 Thread Martin Panter
Martin Panter added the comment: Server_close() was only documentated last year; see Issue 23254. For the examples that run until you interrupt them, the servers currently emit a resource warning (in addition to the KeyboardInterrupt traceback and the Python 2 bytes warnings): $ python

[issue26460] datetime.strptime without a year fails on Feb 29

2016-02-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Python's time.strptime() behavior is consistent with that of glibc 2.19 Gregory, I believe OP is complaining about the way datetime.datetime.strptime() behaves, not time.strptime() which is mentioned as (preferred?) alternative. See msg261015 in

[issue26460] datetime.strptime without a year fails on Feb 29

2016-02-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This is not no more bug than >>> from datetime import * >>> datetime.strptime('0228', '%m%d') datetime.datetime(1900, 2, 28, 0, 0) Naturally, as long as datetime.strptime('0228', '%m%d') is the same as datetime.strptime('19000228', '%Y%m%d'),

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Larry Martell
On Mon, Feb 29, 2016 at 12:33 PM, Ben Finney wrote: > Rustom Mody writes: > >> On Monday, February 29, 2016 at 10:26:32 PM UTC+5:30, Ben Finney wrote: >> > Ian Kelly writes: >> > >> > > On Mon, Feb 29, 2016 at 9:21 AM, Larry Martell wrote: >>

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Larry Martell
On Mon, Feb 29, 2016 at 11:56 AM, Ben Finney wrote: > Ian Kelly writes: > >> On Mon, Feb 29, 2016 at 9:21 AM, Larry Martell >> wrote: >> > I found this to be a very sad story. Sure, he had some issues, but I >> > don't

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Larry Martell
On Mon, Feb 29, 2016 at 11:47 AM, Ian Kelly wrote: > On Mon, Feb 29, 2016 at 9:21 AM, Larry Martell > wrote: >> On Sat, Feb 27, 2016 at 4:37 AM, Steven D'Aprano wrote: >>> The author of Requests, Kenneth Reitz, discusses his

[issue26407] csv.writer.writerows masks exceptions from __iter__

2016-02-29 Thread Ilja Everilä
Ilja Everilä added the comment: I'm starting to think my initial example code was too simplified and misled from the issue at hand. It very explicitly showed what happens when some class with __iter__ raises and is passed to csv_writerows. Even then: >>> from collections.abc import Iterable

[issue26176] EmailMessage example doesn't work

2016-02-29 Thread Maciej Szulik
Changes by Maciej Szulik : -- nosy: +maciej.szulik ___ Python tracker ___ ___

[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Ben Finney
Ben Finney added the comment: Serhiy Storchaka > mktemp is deprecated, and I think we will get rid of it when 2.7 will be out > of use. That's fine. This is not a request to retain ‘tempfile.mktemp’. I confused matters in my initial message, so your confusion is understandable on this

Request More Help With XBM Image

2016-02-29 Thread Wildman via Python-list
I want to take an image file, convert it to XBM format and display it. Thanks to Mr. Otten I can open and display the XBM image without any problems. The script first calls an external program for the image conversion then I can open and display it. Of course, I am left with the XBM file that

Re: Loop awareness

2016-02-29 Thread jonas . thornvall
Den måndag 29 februari 2016 kl. 21:32:51 UTC+1 skrev Ian: > On Mon, Feb 29, 2016 at 1:07 PM, wrote: > > This program creates a uniform linktree of x nodes, and it knows when it > > get stuck in a loop generating random values. > > > > Because the networks random

[issue26460] datetime.strptime without a year fails on Feb 29

2016-02-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: Python's time.strptime() behavior is consistent with that of glibc 2.19: === strptime_c.c === #define _XOPEN_SOURCE #include #include #include #include int main(void) { struct tm tm; char buf[255]; memset(, 0, sizeof(struct tm));

[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: mktemp is deprecated, and I think we will get rid of it when 2.7 will be out of use. Do you want to add new deprecated from the start function? > As far as appropriate location -- where else would you put it? May be in third-party module on PyPI? It doesn't

Re: common mistakes in this simple program

2016-02-29 Thread Martin A. Brown
Greetings Ganesh, >> You're falling into the trap of assuming that the only exception you >> can ever get is the one that you're planning for, and then handling. > >Ok sure ! This point is very important, so I'll reiterate it. I hope the poor horse lives. >> ALL exceptions as though they

[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Ethan Furman
Ethan Furman added the comment: I don't see the problem. Every Python platform that has `mktemp` has an implementation to generate the names, and that implementation can become the public face instead of `mktemp`. So no more of a burden than `mktemp` is; likewise for the "cognitive burden".

[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I see a problem. tempfile._get_candidate_names is implementation detail, and exposing it adds a burden for maintainers. It also adds cognitive burden for users of the tempfile module. And the idea itself looks doubtful and contradictory with the good

Re: Loop awareness

2016-02-29 Thread Ian Kelly
On Mon, Feb 29, 2016 at 1:07 PM, wrote: > This program creates a uniform linktree of x nodes, and it knows when it get > stuck in a loop generating random values. > > Because the networks random generated, only a subset of the permutations will > generate a uniform

[issue26456] import _tkinter + TestForkInThread leaves zombie with stalled thread

2016-02-29 Thread Zachary Ware
Zachary Ware added the comment: I suspect this may be what causes several of the 2.7 builders to fail. The ones that fail look like they complete successfully, but then sit with no output until buildbot kills them. For example:

[issue26407] csv.writer.writerows masks exceptions from __iter__

2016-02-29 Thread Ilja Everilä
Ilja Everilä added the comment: As a side note PyObject_GetIter actually raises a TypeError already for non-iterables (classes without __iter__ etc.), so csv_writerows duplicates the effort at the moment. -- ___ Python tracker

Re: common mistakes in this simple program

2016-02-29 Thread Marko Rauhamaa
sohcahto...@gmail.com: > Every time you say "try-expect", my head wants to explode. > > It is called a "try-except" block, because you're using the key words > "try" and "except" when you make one. Ah, I remember a Python-based test system idea where the "except" keyword meant "expect":

Re: common mistakes in this simple program

2016-02-29 Thread Joel Goldstick
On Mon, Feb 29, 2016 at 2:49 PM, Ganesh Pal wrote: > On Mar 1, 2016 12:06 AM, "Chris Angelico" wrote > > > > You're falling into the trap of assuming that the only exception you > > can ever get is the one that you're planning for, and then handling. > >

[issue26407] csv.writer.writerows masks exceptions from __iter__

2016-02-29 Thread Ilja Everilä
Ilja Everilä added the comment: I have 0 beef with it being the TypeError as long as the exception chain is kept intact, especially since PY3 makes it possible. With current behaviour heisenbugs would produce some serious hair pulling, until one figures out that it is actually the __iter__

Loop awareness

2016-02-29 Thread jonas . thornvall
This program creates a uniform linktree of x nodes, and it knows when it get stuck in a loop generating random values. Because the networks random generated, only a subset of the permutations will generate a uniform network most get stuck in loops generating random values. But the program keep

Re: common mistakes in this simple program

2016-02-29 Thread Ganesh Pal
On Mar 1, 2016 12:06 AM, "Chris Angelico" wrote > > You're falling into the trap of assuming that the only exception you > can ever get is the one that you're planning for, and then handling. Ok sure ! > ALL exceptions as though they were that one. Instead catch ONLY the >

Re: common mistakes in this simple program

2016-02-29 Thread sohcahtoa82
On Monday, February 29, 2016 at 10:21:57 AM UTC-8, Ganesh Pal wrote: > >> How do we reraise the exception in python , I have used raise not > >> sure how to reraise the exception > > > > raise with no arguments will reraise the exception currently being handled. > > > > except Exception: > >

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-29 Thread SilentGhost
Changes by SilentGhost : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Ethan Furman
Ethan Furman added the comment: > The request is for a “get the next path generated by a > ‘tempfile._get_candidate_names’ generator”, with an approved and > documented public API. I don't see any problem with this. Patches welcome. -- stage: -> needs patch

[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Ben Finney
Ben Finney added the comment: > I have read the thread on Python-list Thank you, and thanks for linking to that discussion. > and still don't understand the purpose of your idea. The purpose is to get a public API for making temporary filesystem paths with the same properties as are produced

Re: common mistakes in this simple program

2016-02-29 Thread Chris Angelico
On Tue, Mar 1, 2016 at 5:21 AM, Ganesh Pal wrote: > > In my case the exception is nothing but the error example if we plan > to run the command say #ifconfig -a and the command fails because of > a type ( say u ran #igconfig -a). > > we will the output as > > # Failed to

Re: Everything good about Python except GUI IDE?

2016-02-29 Thread Chris Angelico
On Tue, Mar 1, 2016 at 5:17 AM, Grant Edwards wrote: >> A lot of web sites these days load nothing but a script >> that goes and loads everything else, while you gaze at a splash >> screen. IMO that's unideal. > > :) > > "Unideal" is too kind -- I would described it as

Re: Sending an email with a binary attachment

2016-02-29 Thread Grant Edwards
On 2016-02-29, Peter Pearson wrote: > On Mon, 29 Feb 2016 02:10:00 -0600, Anthony Papillion wrote: > >> For some reason though, sending mail is failing every time. I've made >> sure that the password is correct (which seems to be the most usual >> error). >> >> Still, I

Re: common mistakes in this simple program

2016-02-29 Thread Ganesh Pal
>> How do we reraise the exception in python , I have used raise not >> sure how to reraise the exception > > raise with no arguments will reraise the exception currently being handled. > > except Exception: > logging.error("something went wrong") > raise Thanks Ian for taking time and

Re: Everything good about Python except GUI IDE?

2016-02-29 Thread Grant Edwards
On 2016-02-29, Chris Angelico wrote: > On Tue, Mar 1, 2016 at 2:43 AM, Grant Edwards wrote: >> On 2016-02-29, Chris Angelico wrote: >> >>> Abjuring JS may be a virtue (or at least, making it a non-critical >>> part of your web site),

[issue14157] time.strptime without a year fails on Feb 29

2016-02-29 Thread Sriram Rajagopalan
Sriram Rajagopalan added the comment: Opened issue 26460 for fixing the leap day bug in datetime.datetime.strptime() -- ___ Python tracker ___

[issue26460] datetime.strptime without a year fails on Feb 29

2016-02-29 Thread Sriram Rajagopalan
New submission from Sriram Rajagopalan: $ python Python 3.5.1 (default, Dec 7 2015, 12:58:09) [GCC 5.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> >>> >>> >>> import time >>> >>> time.strptime("Feb 29", "%b %d")

Re: usage of try except for review.

2016-02-29 Thread Ganesh Pal
> I have tried down the code to Read "I have tried down the code to " as I have trimmed down the code as below Ganesh -- https://mail.python.org/mailman/listinfo/python-list

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-02-29 Thread Michael Felt
Michael Felt added the comment: The following demonstrates the basics. cdll.LoadLibrary will load a .so file if it can be located (you will have to believe me as I forgot to include the test in this last batch) Further, when given the AIX format for loading a member of an archive (e.g.,

Re: usage of try except for review.

2016-02-29 Thread Ganesh Pal
> No, Dennis was correct. You should assume that "assert" can > potentially be replaced with "pass" and your program will continue to > work. Thanks Chris for clarifying Dennis point of view , >>try: >>if not run_cmd_and_verify(cmd, timeout=3600): > > Since your

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-02-29 Thread Michael Felt
Michael Felt added the comment: Oops: forgot the example output: root@x064:[/data/prj/aixtools/src]python -m ctypes.util libm.a(libm.so) libc.a(libc.so) libbz2.a(libbz2.so) libcrypto.a(libcrypto.so) libcrypt.a(libcrypt.so) -- ___ Python tracker

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Rustom Mody
On Monday, February 29, 2016 at 11:04:20 PM UTC+5:30, Ben Finney wrote: > Rustom Mody writes: > > > On Monday, February 29, 2016 at 10:26:32 PM UTC+5:30, Ben Finney wrote: > > > Ian Kelly writes: > > > > > > > On Mon, Feb 29, 2016 at 9:21 AM, Larry Martell wrote: > > > > > I found this to be a

Re: common mistakes in this simple program

2016-02-29 Thread Ian Kelly
On Mon, Feb 29, 2016 at 10:26 AM, Ganesh Pal wrote: > On Mon, Feb 29, 2016 at 9:59 PM, Ian Kelly wrote: >> On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote: >>> Iam on python 2.6 > >>> 1. usage of try- expect >> >> try-except

Re: usage of try except for review.

2016-02-29 Thread Chris Angelico
On Tue, Mar 1, 2016 at 4:34 AM, Ganesh Pal wrote: > On Mon, Feb 29, 2016 at 10:10 PM, Dennis Lee Bieber > wrote: > >> Ask yourself: Will my program still work if I remove all the assert >> statements. If the answer is "No", then you should not

Re: usage of try except for review.

2016-02-29 Thread Ganesh Pal
On Mon, Feb 29, 2016 at 10:10 PM, Dennis Lee Bieber wrote: > Ask yourself: Will my program still work if I remove all the assert > statements. If the answer is "No", then you should not be using an assert. You meant if the answer is "NO" then I should be using

Problem in creating list of lists

2016-02-29 Thread subhabangalore
I have few sentences, like, the film was nice. leonardo is great. it was academy award. Now I want them to be tagged with some standards which may look like, the DT film NN was AV nice ADJ leonardo NN is AV great ADJ it PRP was AV academy NN award NN I could do it but my goal is to see it

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Ben Finney
Rustom Mody writes: > On Monday, February 29, 2016 at 10:26:32 PM UTC+5:30, Ben Finney wrote: > > Ian Kelly writes: > > > > > On Mon, Feb 29, 2016 at 9:21 AM, Larry Martell wrote: > > > > I found this to be a very sad story. Sure, he had some issues, but I > > > > don't

Re: common mistakes in this simple program

2016-02-29 Thread Ganesh Pal
On Mon, Feb 29, 2016 at 9:59 PM, Ian Kelly wrote: > On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote: >> Iam on python 2.6 >> 1. usage of try- expect > > try-except in every single function is a code smell. You should only > be using it where you're

Re: Error in Tree Structure

2016-02-29 Thread subhabangalore
On Saturday, February 27, 2016 at 9:43:56 PM UTC+5:30, Rustom Mody wrote: > On Saturday, February 27, 2016 at 2:47:53 PM UTC+5:30, subhaba...@gmail.com > wrote: > > I was trying to implement the code, > > > > import nltk > > import nltk.tag, nltk.chunk, itertools > > def

Re: Sending an email with a binary attachment

2016-02-29 Thread Chris Angelico
On Tue, Mar 1, 2016 at 4:08 AM, Peter Pearson wrote: > try: > smtp.sendmail(message['From'], > message['To'], > message.as_string()) > except: > print "Message sending has failed" > sys.exit(1) > print "Message sending was successful"

Re: Sending an email with a binary attachment

2016-02-29 Thread Peter Pearson
On Mon, 29 Feb 2016 02:10:00 -0600, Anthony Papillion wrote: [snip] > > http://pastebin.com/sryj98wW To improve odds of your getting a response, let's get the code into this thread. Here it is, minus the #! preamble: from email.mime.text import MIMEText from email.mime.application import

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Rustom Mody
On Monday, February 29, 2016 at 10:26:32 PM UTC+5:30, Ben Finney wrote: > Ian Kelly writes: > > > On Mon, Feb 29, 2016 at 9:21 AM, Larry Martell wrote: > > > I found this to be a very sad story. Sure, he had some issues, but I > > > don't think they needed to drug him, and take all that he had

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Ben Finney
Ian Kelly writes: > On Mon, Feb 29, 2016 at 9:21 AM, Larry Martell > wrote: > > I found this to be a very sad story. Sure, he had some issues, but I > > don't think they needed to drug him, and take all that he had > > learned away from him and

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Ian Kelly
On Mon, Feb 29, 2016 at 9:21 AM, Larry Martell wrote: > On Sat, Feb 27, 2016 at 4:37 AM, Steven D'Aprano wrote: >> The author of Requests, Kenneth Reitz, discusses his recent recovery from a >> MentalHealthError exception. >> >>

Re: Dynamic object attribute creation

2016-02-29 Thread Ian Kelly
On Mon, Feb 29, 2016 at 9:06 AM, Random832 wrote: > On Mon, Feb 29, 2016, at 10:36, ast wrote: >> but why doesn't it work with built-in classes int, float, list ? >> >> L = [1, 8, 0] >> L.test = 'its a list !' >> >> (however lists are mutable, int, float ... are not) >

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Larry Martell
On Sat, Feb 27, 2016 at 4:37 AM, Steven D'Aprano wrote: > The author of Requests, Kenneth Reitz, discusses his recent recovery from a > MentalHealthError exception. > > http://www.kennethreitz.org/essays/mentalhealtherror-an-exception-occurred > > Although the connection to

Re: common mistakes in this simple program

2016-02-29 Thread Ian Kelly
On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote: > Iam on python 2.6 Python 2.6 has been unsupported since October 2013. Among other things, that means it is no longer receiving security updates like more recent versions. Unless you have an extremely strong reason for

[issue26459] Windows build instructions are very inaccurate

2016-02-29 Thread Steve Dower
Steve Dower added the comment: Agreed. The PCBuild/readme.txt file should clear up a few of those points, but the docs aren't exactly beginner friendly (and by that I mean beginning Windows users, not beginning C developers). We probably need someone to write a dedicated document for building

Xn project v002 is released

2016-02-29 Thread wij
Xn project tries to develop a more uniform language that can be used in almost anywhere. It can be used for general files (e.g. executables), general communication language, or even for an alive program that can grow. Xn project is licensed as Public Domain (Historical Fact Principle). Anyone

[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-02-29 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

Re: Everything good about Python except GUI IDE?

2016-02-29 Thread Chris Angelico
On Tue, Mar 1, 2016 at 2:43 AM, Grant Edwards wrote: > On 2016-02-29, Chris Angelico wrote: > >> Abjuring JS may be a virtue (or at least, making it a non-critical >> part of your web site), > > Except the marketing people who decide on the requirements

Re: Dynamic object attribute creation

2016-02-29 Thread Random832
On Mon, Feb 29, 2016, at 10:36, ast wrote: > but why doesn't it work with built-in classes int, float, list ? > > L = [1, 8, 0] > L.test = 'its a list !' > > (however lists are mutable, int, float ... are not) Because those classes do not have attribute dictionaries, in order to save space.

Re: Reason for not allowing import twice but allowing reload()

2016-02-29 Thread Chris Angelico
On Tue, Mar 1, 2016 at 2:33 AM, BartC wrote: >> I think the OP's talking more about the situation of having an active >> session (IDLE was mentioned), importing a local module (a .py file >> from the current directory), then editing the file and re-importing, >> which has no

EuroPython 2016: Regular ticket prices

2016-02-29 Thread M.-A. Lemburg
We will be switching to regular ticket prices very soon now: * Student: EUR 120.00 (only available for students) * Personal: EUR 360.00 (for people enjoying Python from home) * Business: EUR 580.00 (for people using Python to make a living) but still have a few early-bird tickets left. If

Re: Help

2016-02-29 Thread Grant Edwards
On 2016-02-29, Joel Goldstick wrote: > On Mon, Feb 29, 2016 at 7:53 AM, wrote: > >> Thanks. If a word appears more than once how would I bring back both >> locations? > > This is not generally a free coding service. Fortunately for you Tom,

EuroPython 2016: Regular ticket prices

2016-02-29 Thread M.-A. Lemburg
We will be switching to regular ticket prices very soon now: * Student: EUR 120.00 (only available for students) * Personal: EUR 360.00 (for people enjoying Python from home) * Business: EUR 580.00 (for people using Python to make a living) but still have a few early-bird tickets left. If

Re: Everything good about Python except GUI IDE?

2016-02-29 Thread Grant Edwards
On 2016-02-29, Chris Angelico wrote: > Abjuring JS may be a virtue (or at least, making it a non-critical > part of your web site), Except the marketing people who decide on the requirements will never, ever settle for what you can do with plain HTML/CSS. In my experience,

Dynamic object attribute creation

2016-02-29 Thread ast
Hello Object's attributes can be created dynamically, ie class MyClass: pass obj = MyClass() obj.test = 'foo' but why doesn't it work with built-in classes int, float, list ? L = [1, 8, 0] L.test = 'its a list !' (however lists are mutable, int, float ... are not) Traceback (most

Re: Reason for not allowing import twice but allowing reload()

2016-02-29 Thread BartC
On 29/02/2016 07:11, Chris Angelico wrote: On Mon, Feb 29, 2016 at 6:02 PM, Ian Kelly wrote: - if subsequent imports of same module in a session are not effective, why not simply flag those attempts as an error, rather than letting them go effect-less. Because there

  1   2   >