Re: WP-A: A New URL Shortener

2016-03-15 Thread Chris Angelico
On Wed, Mar 16, 2016 at 3:27 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> There are many places where there are limits (hard or soft) on message >> lengths. Some of us still use MUDs and 80-character line limits. >> Business cards or other printed media need

[issue26571] turtle regression in 3.5

2016-03-15 Thread Ellison Marks
New submission from Ellison Marks: I noticed some odd behaviour when running some turtle code I wrote using python 3.5. A simplified example: >>> from turtle import Turtle >>> t = Turtle() >>> t.getscreen().bye() # or manually close the turtle window >>> t2 = Turtle() Traceback (most recent

Re: WP-A: A New URL Shortener

2016-03-15 Thread Gregory Ewing
Chris Angelico wrote: There are many places where there are limits (hard or soft) on message lengths. Some of us still use MUDs and 80-character line limits. Business cards or other printed media need to be transcribed by hand. Dictation of URLs becomes virtually impossible when they're

[issue19914] help([object]) returns "Not enough memory." on standard Python types, object and object functions

2016-03-15 Thread Eryk Sun
Eryk Sun added the comment: For posterity for anyone that finds this old issue, I investigated this problem in the debugger in Windows 7. It turns out that more.com (the pager used by Python's help) calls MultiByteToWideChar [1] with dwFlags passed as MB_PRECOMPOSED (1), which is forbidden

[issue26570] comma-separated cookies with expires header do not parse properly

2016-03-15 Thread Ilya Kreymer
New submission from Ilya Kreymer: This is a peculiar regression in 3.5 where a comma-separated cookie following an expires field is considered invalid: Ex: which results in a silent error/empty cookie in 3.5.1 Python 3.5.1 (default, Dec 26 2015, 18:11:22) [GCC 4.2.1 Compatible Apple LLVM

Re: Case Statements

2016-03-15 Thread Mark Lawrence
On 16/03/2016 01:55, jj0gen0i...@gmail.com wrote: You have apparently mistaken me for someone who's worried. I don't use Python, I was just curious as to why a construct that is found, not only to be useful in 95% of other languages, but is generally considered more flexible and readable than

Re: Case Statements

2016-03-15 Thread Mario R. Osorio
On Tuesday, March 15, 2016 at 9:55:27 PM UTC-4, jj0ge...@gmail.com wrote: > You have apparently mistaken me for someone who's worried. I don't use > Python, I was just curious as to why a construct that is found, not only to > be useful in 95% of other languages, but is generally considered

Re: WP-A: A New URL Shortener

2016-03-15 Thread Rick Johnson
On Tuesday, March 15, 2016 at 7:23:12 PM UTC-5, Thomas 'PointedEars' Lahn wrote: (Note: i had to rearrange your paragraph to accommodate a more intuitive response. I apologize for this, but i'm confident i was able to maintain your original intent) > You are giving bad advice to a junior

Re: WP-A: A New URL Shortener

2016-03-15 Thread Gene Heskett
On Tuesday 15 March 2016 22:46:44 Thomas 'PointedEars' Lahn wrote: > Gene Heskett wrote: > > On Tuesday 15 March 2016 19:55:52 Chris Angelico wrote: > >> On Wed, Mar 16, 2016 at 10:38 AM, Thomas 'PointedEars' Lahn > >> > >> > And as for second-level domains, consider for example “t.c” > >> >

Re: Readability counts, was Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-15 Thread Rustom Mody
On Tuesday, March 15, 2016 at 11:05:32 PM UTC+5:30, Peter Otten wrote: > Indeed. It's still better than > > "This is %s a fruit" % (x in x_list and "" or "not") > > The bug is intentional; the fix is of course > > "This is %s a fruit" % (x in x_list and "most likely" or "probably not") > > ;)

Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Gene Heskett wrote: > On Tuesday 15 March 2016 19:55:52 Chris Angelico wrote: >> On Wed, Mar 16, 2016 at 10:38 AM, Thomas 'PointedEars' Lahn >> > And as for second-level domains, consider for example “t.c” instead >> > of “twitter.com” as part of the short URI. >> That'll work only for the ones

Re: WP-A: A New URL Shortener

2016-03-15 Thread Gene Heskett
On Tuesday 15 March 2016 19:55:52 Chris Angelico wrote: > On Wed, Mar 16, 2016 at 10:38 AM, Thomas 'PointedEars' Lahn > > wrote: > > Chris Angelico wrote: > >> On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn > >> > >> wrote: > >>> […] I cannot

Re: Case Statements

2016-03-15 Thread jj0gen0info
You have apparently mistaken me for someone who's worried. I don't use Python, I was just curious as to why a construct that is found, not only to be useful in 95% of other languages, but is generally considered more flexible and readable than the if-elif, was missing in Python. (your link

Re: Case Statements

2016-03-15 Thread Mark Lawrence
On 16/03/2016 00:51, BartC wrote: On 15/03/2016 23:47, jj0gen0i...@gmail.com wrote: Thanks for the informative post. I've read it and disagree with the rational, it places Python in a decided minority of the major languages. And this proposal (3103) was by the guy who invented the language!

Re: Case Statements

2016-03-15 Thread BartC
On 15/03/2016 23:47, jj0gen0i...@gmail.com wrote: Thanks for the informative post. I've read it and disagree with the rational, it places Python in a decided minority of the major languages. And this proposal (3103) was by the guy who invented the language! Good thing he didn't have

Re: Descriptors vs Property

2016-03-15 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > Please ignore 'PointedEars', Please ignore Mark Lawrence unless he has something on-topic to say. How does that feel, Mark? > every month or so for some weird reason The reason being obviously that the people to whose postings I happen to post a follow-up to do not

Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Wed, Mar 16, 2016 at 10:38 AM, Thomas 'PointedEars' Lahn > wrote: >> Chris Angelico wrote: >>> On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn >>> wrote: […] I cannot be sure because I have not thought this

[issue18320] python installation is broken if prefix is overridden on an install target

2016-03-15 Thread Ned Deily
Ned Deily added the comment: Allowing prefix to be overridden after configure-time is certainly not the most critical shortcoming of the Python build system and it is possible someone is relying on that behavior. Since no one, including me, seems very interested at this point in trying to

Re: Encapsulation in Python

2016-03-15 Thread BartC
On 15/03/2016 21:02, Christian Gollwitzer wrote: Am 14.03.16 um 23:40 schrieb BartC: On 14/03/2016 22:20, Mark Lawrence wrote: > The RUE kept stating that he was an expert in unicode, but never once > provided a single shred of evidence to support his claim. Until I see > substantiated

Re: WP-A: A New URL Shortener

2016-03-15 Thread Chris Angelico
On Wed, Mar 16, 2016 at 11:31 AM, Erik wrote: > >> I often like to make a small >> change when I reimplement, though - something that I thought was >> ill-designed in the original, > > > OK, so maybe the idea for Vinicius (if he's still reading) to pursue is that > it

Re: WP-A: A New URL Shortener

2016-03-15 Thread Erik
Hi Chris, On 15/03/16 23:48, Chris Angelico wrote: I agree, it's a risk. Any indirection adds that. So the benefit has to be weighed against this inherent cost. True, so it's not URL shorteners that I disagree with on principle, it's the _inappropriate_ use of URL shorteners ;) If one uses

Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Rick Johnson wrote: > On Tuesday, March 15, 2016 at 5:54:46 PM UTC-5, Thomas 'PointedEars' Lahn > wrote: >> Vinicius Mesel wrote: >> > I'm a 16 year old Python Programmer that wanted to do >> > something different. But, like we know, ideas are quite >> > difficult to find. So I decided to develop

Re: Missing something about timezones

2016-03-15 Thread Peter Pearson
On Mon, 14 Mar 2016 10:19:23 -0500, Skip Montanaro wrote: > Is this correct (today, with Daylight Savings in effect)? > import pytz i.timezone > 'America/Chicago' pytz.timezone(i.timezone) > ot > datetime.datetime(2016, 3, 14, 9, 30, tzinfo= 'America/New_York' EDT-1 day,

Re: Case Statements

2016-03-15 Thread Mark Lawrence
On 15/03/2016 23:47, jj0gen0i...@gmail.com wrote: Thanks for the informative post. I've read it and disagree with the rational, it places Python in a decided minority of the major languages. https://en.wikipedia.org/wiki/Conditional_(computer_programming)#Case_and_switch_statements See

Re: WP-A: A New URL Shortener

2016-03-15 Thread Chris Angelico
On Wed, Mar 16, 2016 at 10:38 AM, Thomas 'PointedEars' Lahn wrote: > Chris Angelico wrote: > >> On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn >> wrote: > >>> […] I cannot be sure because I have not thought this through, but with >

Re: WP-A: A New URL Shortener

2016-03-15 Thread Chris Angelico
On Wed, Mar 16, 2016 at 10:40 AM, Erik wrote: > Hi Chris, > > On 15/03/16 23:16, Chris Angelico wrote: >> >> So URL shorteners are invaluable tools. > > > Perhaps, and in the specific - transient - use-cases you describe that's > fine. The problem I have with them is

[issue26562] Large Involuntary context switches during oom-killer

2016-03-15 Thread Damian Myerscough
Damian Myerscough added the comment: Thanks for the feedback, I will continue to dig into this. I know processes go crazy sometimes when OOM killer kicks off, I just wanted to rule out a Python bug or if anyone in the community has seen this before. Thanks --

Re: Case Statements

2016-03-15 Thread jj0gen0info
Thanks for the informative post. I've read it and disagree with the rational, it places Python in a decided minority of the major languages. https://en.wikipedia.org/wiki/Conditional_(computer_programming)#Case_and_switch_statements See section "Choice system cross reference" Thanks again

Re: WP-A: A New URL Shortener

2016-03-15 Thread Erik
Hi Chris, On 15/03/16 23:16, Chris Angelico wrote: So URL shorteners are invaluable tools. Perhaps, and in the specific - transient - use-cases you describe that's fine. The problem I have with them is that they are a level of indirection controlled by a third party. If the source (let's

Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn > wrote: Attribution *line*, _not_ attribution novel. >> […] I cannot be sure because I have not thought this through, but with ^^^

Re: WP-A: A New URL Shortener

2016-03-15 Thread Rick Johnson
On Tuesday, March 15, 2016 at 5:54:46 PM UTC-5, Thomas 'PointedEars' Lahn wrote: > Vinicius Mesel wrote: > > I'm a 16 year old Python Programmer that wanted to do > > something different. But, like we know, ideas are quite > > difficult to find. So I decided to develop a URL > > Shortener to help

[issue18320] python installation is broken if prefix is overridden on an install target

2016-03-15 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

Re: WP-A: A New URL Shortener

2016-03-15 Thread Chris Angelico
On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn wrote: > Vinicius Mesel wrote: > >> I'm a 16 year old Python Programmer that wanted to do something different. >> But, like we know, ideas are quite difficult to find. >> So I decided to develop a URL Shortener to help

Re: WP-A: A New URL Shortener

2016-03-15 Thread Erik
On 15/03/16 22:53, Thomas 'PointedEars' Lahn wrote: A few less bytes there do not count. You mean "Fewer bytes there do not count". E. (But on the whole, yes, I do agree with your position in this instance. Kudos to Vinicius for doing something productive with his time though - I'm sure a

Re: Case Statements

2016-03-15 Thread Mark Lawrence
On 15/03/2016 20:46, jj0gen0i...@gmail.com wrote: Given that "Case Statements" are more compact and less redundant than a sequence of if-elif statements, and usually can contain embedded match lists: Is there any chance future versions of Python will adopt a case structure? Something like

[issue25597] unittest.mock does not wrap dunder methods (__getitem__ etc)

2016-03-15 Thread Robert Collins
Robert Collins added the comment: I think this is a valid mock bug; it likely needs some thoughtful exhaustive testing, and obviously support added for it. -- stage: -> test needed title: unittest.mock does not wrap dict objects correctly -> unittest.mock does not wrap dunder methods

[issue25894] unittest subTest failure causes result to be omitted from listing

2016-03-15 Thread Robert Collins
Robert Collins added the comment: The basic model is this: - a test can have a single outcome [yes, the api is ambiguous, but there it is] - subtests let you identify multiple variations of a single test (note the id tweak etc) and *may* be reported differently We certainly must not report

[issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: Hum, test_doctest, test_zipfile and test_pyclbr fail if test is converted to a package (if Lib/test/__init__.py is removed). Attached patch fixes test_zipfile. I created the issue #26569 for test_pyclbr failure. -- Added file:

[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() doens't support packages

2016-03-15 Thread STINNER Victor
New submission from STINNER Victor: While working on the issue #26295 which converts the test module to a package, I noticed that pyclbr doesn't work with packages: test_pyclbr fails when test becomes a package. Attached patch fixes pyclbr._readmodule(): * Replace

[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support packages

2016-03-15 Thread STINNER Victor
Changes by STINNER Victor : -- title: pyclbr.readmodule() and pyclbr.readmodule_ex() doens't support packages -> pyclbr.readmodule() and pyclbr.readmodule_ex() don't support packages ___ Python tracker

Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Vinicius Mesel wrote: > I'm a 16 year old Python Programmer that wanted to do something different. > But, like we know, ideas are quite difficult to find. > So I decided to develop a URL Shortener to help the Python community out > and share my coding knowledge, and today the project was launched

[issue26564] Malloc debug hooks: display memory block traceback on error

2016-03-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 769dfcb701ee by Victor Stinner in branch 'default': Issue #26564: Fix test_capi https://hg.python.org/cpython/rev/769dfcb701ee -- ___ Python tracker

[issue26538] regrtest: setup_tests() must not replace module.__path__ (_NamespacePath) with a simple list // importlib & abspath

2016-03-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 96b73b649b15 by Victor Stinner in branch 'default': regrtest: Fix module.__path__ https://hg.python.org/cpython/rev/96b73b649b15 -- nosy: +python-dev ___ Python tracker

Re: Obfuscating Python code

2016-03-15 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Wed, Mar 16, 2016 at 5:59 AM, Thomas 'PointedEars' Lahn > wrote: >> That said, not distributing the source code of a program as well (or at >> least making it available to users in some way) strikes me as unpythonic >> since Python is at least Open

[issue26564] Malloc debug hooks: display memory block traceback on error

2016-03-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8215dae7ec3c by Victor Stinner in branch 'default': Oops, revert unwanted change used to create an example https://hg.python.org/cpython/rev/8215dae7ec3c -- ___ Python tracker

[issue26564] Malloc debug hooks: display memory block traceback on error

2016-03-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset cef6a32d805f by Victor Stinner in branch 'default': On memory error, dump the memory block traceback https://hg.python.org/cpython/rev/cef6a32d805f -- ___ Python tracker

Re: Encapsulation in Python

2016-03-15 Thread Christian Gollwitzer
Am 14.03.16 um 23:40 schrieb BartC: On 14/03/2016 22:20, Mark Lawrence wrote: > The RUE kept stating that he was an expert in unicode, but never once > provided a single shred of evidence to support his claim. Until I see > substantiated evidence from you I am going to state quite cleary

[issue26564] Malloc debug hooks: display memory block traceback on error

2016-03-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 18a19e62bac5 by Victor Stinner in branch 'default': Enhance and rewrite traceback dump C functions https://hg.python.org/cpython/rev/18a19e62bac5 New changeset fea3c6e9a38e by Victor Stinner in branch '3.5': _tracemalloc: store lineno as unsigned

WP-A: A New URL Shortener

2016-03-15 Thread Vinicius Mesel
Hey guys, I'm a 16 year old Python Programmer that wanted to do something different. But, like we know, ideas are quite difficult to find. So I decided to develop a URL Shortener to help the Python community out and share my coding knowledge, and today the project was launched with its first

Case Statements

2016-03-15 Thread jj0gen0info
Given that "Case Statements" are more compact and less redundant than a sequence of if-elif statements, and usually can contain embedded match lists: Is there any chance future versions of Python will adopt a case structure? Something like select x case in [1,2,3,5,7,9] print case

[issue18320] python installation is broken if prefix is overridden on an install target

2016-03-15 Thread Martin Panter
Martin Panter added the comment: I agree with Martin v. Löwis that this is not a real bug. Cosmicduck doesn’t seem aware of the “configure --prefix=. . .” option, but I don’t think it is right to add hacks to the makefile to prevent overriding variables. -- nosy: +martin.panter

Re: Obfuscating Python code

2016-03-15 Thread Chris Angelico
On Wed, Mar 16, 2016 at 5:59 AM, Thomas 'PointedEars' Lahn wrote: > That said, not distributing the source code of a program as well (or at > least making it available to users in some way) strikes me as unpythonic > since Python is at least Open Source software, and Python

[issue22359] Remove incorrect uses of recursive make

2016-03-15 Thread Xavier de Gaye
Xavier de Gaye added the comment: > But I am a bit worried at the new makefile syntax [ifeq directive and > $(findstring) function]. I suspect it is Gnu specific, and that Python tries > to support other versions of Make as well. Yes, they are both GNU extensions :( To avoid modifying

Re: Different sources of file

2016-03-15 Thread Wildman via Python-list
On Mon, 14 Mar 2016 20:56:44 +, Val Krem wrote: > #!/usr/bin/python On some Linux systems python is installed in /usr/local/bin. I would suggest using the hash-bang below. It will insure python will run no matter where it was installed. #!/usr/bin/env python -- GNU/Linux user #557453

[issue26568] Add a new warnings.showmsg() function taking a warnings.WarningMessage object

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: I'm not sure about the method names showmsg() and formatmsg(). Maybe: showwarnmsg() and formatwarnmsg()? First I used warnings.show() and warnings.format(), but "format()" is already the name of a builtin function. By the way, I would prefer to use

[issue24263] unittest cannot load module whose name starts with Unicode

2016-03-15 Thread Robert Collins
Robert Collins added the comment: sih4sing5hong5 - I think we do need a test in fact - it can be done using mocks, but right now I think the patch has a bug - it looks for isidentifier on $thing.py, but not on just $thing (which we need to do to handle packages, vs modules). --

Re: OTish Wells Fargo sucks

2016-03-15 Thread Rick Johnson
On Tuesday, March 15, 2016 at 1:23:58 PM UTC-5, MRAB wrote: > Failure is not inevitable. Inevitable? No. Highly probable? Yes. (This message sponsored by: The Magic Eight Ball) -- https://mail.python.org/mailman/listinfo/python-list

Re: OTish Wells Fargo sucks

2016-03-15 Thread Rick Johnson
On Tuesday, March 15, 2016 at 9:38:16 AM UTC-5, Grant Edwards wrote: > How difficult a web site is to use is proportional to the > size of organization that owns it and how much money they > spent developing it. I would also add: "The quality of the engineers who design and implement it". This is

Re: Obfuscating Python code

2016-03-15 Thread Thomas 'PointedEars' Lahn
Ben Finney wrote: > Swanand Pashankar writes: >> Embedding a Python file in C code works, but it exposes your Python >> script. Didn't find any free fool-proof way to obfuscate Python code >> either. > > What exactly is it you want to prevent? Why do you think

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread BartC
On 15/03/2016 14:58, BartC wrote: On 15/03/2016 11:52, BartC wrote: On 15/03/2016 01:55, Steven D'Aprano wrote: switch obj: case "Hello", None: ... case [1, 2, 3]: ... case 23.01, 15+2j, Fraction(10, 11): ... case 100**100, {}: ... and more. This is not negotiable:

Re: Python Advanced Help

2016-03-15 Thread Thomas 'PointedEars' Lahn
Luke Charlton wrote: > Okay, So basically I created a python script around 1 year ago to grab an > explain_plan from a Greenplum system (Normal SQL) and change it around and > explain each step/section, the thing is, I've came back to the python code > and I don't understand anything of what it's

Re: OTish Wells Fargo sucks

2016-03-15 Thread MRAB
On 2016-03-15 14:37, Grant Edwards wrote: On 2016-03-14, Seymore4Head wrote: Wells Fargo online will not allow you to change a payee's address. You have to delete the account and re enter it. Wells Fargo is a pretty large company with a lot of money to spend.

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread Rick Johnson
On Tuesday, March 15, 2016 at 7:21:02 AM UTC-5, Chris Angelico wrote: > I'm sure implementing Python is a lot more fun than reimplementing > Windows APIs! There's not much on this earth, that is worse than Windows APIs. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Advanced Help

2016-03-15 Thread Peter Otten
Luke Charlton wrote: > Okay, So basically I created a python script around 1 year ago to grab an > explain_plan from a Greenplum system (Normal SQL) and change it around and > explain each step/section, the thing is, I've came back to the python code > and I don't understand anything of what it's

Re: Readability counts, was Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-15 Thread Peter Otten
Rustom Mody wrote: > On Tuesday, March 15, 2016 at 2:00:25 PM UTC+5:30, Peter Otten wrote: >> Rustom Mody wrote: >> >> > Others have answered some parts >> if x in x_list: >> > ... print("That is a fruit.") >> > ... else: >> > ... print("That is not a fruit.") >> > ... >> > >> >

Re: Fetch Gmail Archieved messages

2016-03-15 Thread Rick Johnson
On Tuesday, March 15, 2016 at 5:48:15 AM UTC-5, Arshpreet Singh wrote: > def inbox_week(): > import imaplib > EMAIL = 'myusern...@gmail.com' I admit that this is pedantic, but you should really use ADDRESS instead of EMAIL. ADDRESS more correctly complements PASSWORD. But in any event,

[issue26560] Error in assertion in wsgiref.handlers.BaseHandler.start_response

2016-03-15 Thread SilentGhost
Changes by SilentGhost : -- nosy: +pje type: -> behavior versions: +Python 3.6 ___ Python tracker ___

[issue26565] [ctypes] Add value attribute to non basic pointers.

2016-03-15 Thread SilentGhost
Changes by SilentGhost : -- nosy: +amaury.forgeotdarc, belopolsky, meador.inge versions: +Python 3.6 ___ Python tracker ___

[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: Attached patch should fix the issue. -- keywords: +patch Added file: http://bugs.python.org/file42174/PyGILState_Ensure.patch ___ Python tracker

[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: ptest.c: Portable example using Python API. -- Added file: http://bugs.python.org/file42173/ptest.c ___ Python tracker

[issue26102] access violation in PyErrFetch if tcur==null in PyGILState_Release

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: Good news: it looks like I fixed the Py_FatalError() bug in the issue #26558. Py_FatalError() can again be called with the GIL released. The bug was introduced in Python 3.0. Since your issue is a bug in your code and that Py_FatalError() was fixed, I close

[issue26558] Disable PyGILState_Check() when Py_NewInterpreter() is called and add more checks on the GIL

2016-03-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset b394fc71f92a by Victor Stinner in branch '3.5': Fix Py_FatalError() if called without the GIL https://hg.python.org/cpython/rev/b394fc71f92a New changeset c298c6d8b324 by Victor Stinner in branch '3.5': faulthandler: Test Py_FatalError() with GIL

[issue26558] Disable PyGILState_Check() when Py_NewInterpreter() is called and add more checks on the GIL

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: Ok, it looks like buildbots are happy. I close the issue. -- resolution: -> fixed status: open -> closed ___ Python tracker

Re: common mistakes in this simple program

2016-03-15 Thread Ganesh Pal
On Tue, Mar 1, 2016 at 2:41 AM, Martin A. Brown wrote: > Please read below. I will take a stab at explaining the gaps of > understanding you seem to have (others have tried already, but I'll > try, as well). > > I am going to give you four different functions which

Leo 5.2-b1 released

2016-03-15 Thread Edward K. Ream
Leo 5.2 b1 is now available on SourceForge . Leo is a PIM, an IDE and an outliner. *The highlights of Leo 5.2* - Easy install with PyInstaller packaging - c.cloneFindByPredicate - clone-find-marked commands - decorators

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread BartC
On 15/03/2016 11:52, BartC wrote: On 15/03/2016 01:55, Steven D'Aprano wrote: switch obj: case "Hello", None: ... case [1, 2, 3]: ... case 23.01, 15+2j, Fraction(10, 11): ... case 100**100, {}: ... and more. This is not negotiable: having a switch statement limited to

Re: OTish Wells Fargo sucks

2016-03-15 Thread Grant Edwards
On 2016-03-14, Seymore4Head wrote: > Wells Fargo online will not allow you to change a payee's address. You > have to delete the account and re enter it. Wells Fargo is a pretty large company with a lot of money to spend. How difficult a web site is to use is

[issue26564] Malloc debug hooks: display memory block traceback on error

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: I reviewed my own patch on Rietveld :-) -- ___ Python tracker ___ ___

[issue26568] Add a new warnings.showmsg() function taking a warnings.WarningMessage object

2016-03-15 Thread STINNER Victor
New submission from STINNER Victor: Currently, the warnings.showformat() function take between 4 and 6 parameters and it's not possible to add new parameters. warnings.showformat() calls warnings.formatwarnings() with 5 parameters. Again, it's not easy to pass new parameters. I would like to

[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: > Backward-compatibility problem: The C function PyErr_ResourceWarning() always > call warnings.showwarning() with the keyword parameter source. If an > application replaces the warnings.showwarning() function, it will probably > fail because it doesn't know

Re: Seekable files

2016-03-15 Thread Jon Ribbens
On 2016-03-15, Marko Rauhamaa wrote: > Jon Ribbens : >> On 2016-03-15, Marko Rauhamaa wrote: >>> I think it points to a big practical problem in the whole exception >>> paradigm. >> >> Well, no. That one individual language

Re: Seekable files

2016-03-15 Thread Marko Rauhamaa
Jon Ribbens : > On 2016-03-15, Marko Rauhamaa wrote: >> Having to specify the possible exceptions in Java is very painful and >> has complicated the introduction of closures to Java quite a bit. > > It is one of the extremely serious design errors

Re: Seekable files

2016-03-15 Thread Jon Ribbens
On 2016-03-15, Marko Rauhamaa wrote: > Jon Ribbens : >> I'd just do something like: >> >> try: >> fileobj.seek(where-i-want-to-seek-to) >> except (AttributeError, EnvironmentError): >> # file is not seekable > > Unlike Java, Python

[issue26040] Improve coverage and rigour of test.test_math

2016-03-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +christian.heimes, eric.smith, lemburg, serhiy.storchaka, stutzbach versions: +Python 3.5 ___ Python tracker

[issue26564] Malloc debug hooks: display memory block traceback on error

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: See also the issue #26567: "Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted". -- ___ Python tracker

[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-15 Thread STINNER Victor
Changes by STINNER Victor : -- title: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted -> ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is

[issue26567] Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-15 Thread STINNER Victor
New submission from STINNER Victor: Python emits ResourceWarning when an object using limited resource is destroyed without being explicitly closed: files, sockets, etc. The problem is that it's hard to find where the object comes from, since the warning can occur very late, in the garbage

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread Chris Angelico
On Tue, Mar 15, 2016 at 11:02 PM, BartC wrote: > Anyway, what I'm saying is, trying to implement a language is also a good > way of learning it, especially of finding out how it works. Same goes for a lot of things. Want to know how Windows ticks? Try reimplementing it - or read

Twisted 16.0 Released

2016-03-15 Thread Amber "Hawkie" Brown
On behalf of Twisted Matrix Laboratories, I am honoured to announce the release of Twisted 16.0! Twisted 16.0 brings some important changes, and some nice-to-haves as well. The major things are: - TLS endpoints have arrived! They're like the old `ssl:` endpoints, but support faster IPv4/IPv6

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread BartC
On 15/03/2016 09:20, alister wrote: Why would i do somthing so pointless? Name references are pointless? OK, you're the expert ... how does this grab you (it often catches newbies out) def test(x): a.append('oops') a=['a list'] test(a) print (a) Not any more. I sugest you may

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-15 Thread BartC
On 15/03/2016 01:55, Steven D'Aprano wrote: On Tue, 15 Mar 2016 04:53 am, BartC wrote: I get it. The author doesn't like switch statements! I don't think you do -- there's no "the author". It's a wiki. There's potentially *thousands* of "authors". The page you (might have) read is a

Python Advanced Help

2016-03-15 Thread Luke Charlton
Okay, So basically I created a python script around 1 year ago to grab an explain_plan from a Greenplum system (Normal SQL) and change it around and explain each step/section, the thing is, I've came back to the python code and I don't understand anything of what it's doing (the code

[issue24230] tempfile.mkdtemp() doesn't work with bytes paths

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: """ Today we're doing something like this: tmpdir = tempfile.mkdtemp('', 'hgtests.', d and d.decode('utf-8')).encode('utf-8') """ Don't do that. UTF-8 is not the right encoding. Use os.fsencode() and os.fsdecode(). Internally, Python uses

[issue24230] tempfile.mkdtemp() doesn't work with bytes paths

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: I don't understand the rationale to add new functions using bytes filenames. IMHO it's a bad practice to pass bytes filenames to write portable code. On Windows, bytes lead to strange bugs: os.listdir(bytes) gives you filenames which don't exist when a

[issue26562] Large Involuntary context switches during oom-killer

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: > When oom-killer is trigger IMHO this is your root problem. > When oom-killer is trigger I see a large number of involuntary context > switches ... The principle of *involuntarty* context switches is that the application is not responsible for them. > I

Re: Seekable files

2016-03-15 Thread Marko Rauhamaa
Jon Ribbens : > I'd just do something like: > > try: > fileobj.seek(where-i-want-to-seek-to) > except (AttributeError, EnvironmentError): > # file is not seekable Unlike Java, Python does not declare syntactically which exceptions the caller should

Re: Readability counts, was Re: Use of Lists, Tupples, or Sets in IF statement.

2016-03-15 Thread Rustom Mody
On Tuesday, March 15, 2016 at 2:00:25 PM UTC+5:30, Peter Otten wrote: > Rustom Mody wrote: > > > Others have answered some parts > if x in x_list: > > ... print("That is a fruit.") > > ... else: > > ... print("That is not a fruit.") > > ... > > > > However one can distribute the

Re: Simple exercise

2016-03-15 Thread Oscar Benjamin
On 14 March 2016 at 23:59, Steven D'Aprano wrote: > On Tue, 15 Mar 2016 02:06 am, Oscar Benjamin wrote: > >> On 14 March 2016 at 14:35, Rick Johnson >> wrote: >>> >>> I would strongly warn anyone against using the zip function >>> unless >> ...

Re: Seekable files

2016-03-15 Thread Jon Ribbens
On 2016-03-15, Steven D'Aprano wrote: > Suppose somebody passes me an open file handle. What's the right way to tell > if it is seekable in Python 2? > > I see that stdin has a seek and tell method, but they raise: > > py> sys.stdin.tell() > Traceback (most recent call last):

Fetch Gmail Archieved messages

2016-03-15 Thread Arshpreet Singh
Hi, I am using imaplib to fetch Gmail's Inbox Archived message but results are not that much accurate. Here is code+logic: def inbox_week(): import imaplib EMAIL = 'myusern...@gmail.com' PASSWORD = 'mypassword' mail = imaplib.IMAP4_SSL('imap.gmail.com') mail.login( EMAIL,

  1   2   >