[issue24849] Add __len__ to map, everything in itertools
flying sheep added the comment: The *iterable* itself may be reentrant, but the iterator formed from iter(iterable) is not. So by your previous comment, giving the iterator form a length is not appropriate. With the exception of tee, all the functions in itertools return iterators. ah, so your gripe is that the itertools functions return iterators, not (possibly) reentrant objects like range(). and changing that would break backwards compatibility, since the documentation says “iterator”, not “iterable” (i.e. people can expect e.g. next(groupby(...))) to work. that’s probably the end of this :( the only thing i can imagine that adds reentrant properties (and an useful len()) to iterators would be an optional function (maybe __uniter__ :D) that returns an iterable whose __iter__ function creates a restarted iterator copy, or an optional function that directly returns such a copy. probably too much to ask for :/ Since you can't rely on it having a length, you have to program as if it doesn't. So in practice, I believe this will just add complication. I don’t agree here. If something accepts iterables and expects to sometimes be called on iterators and sometimes on sequences/len()gthy objects, it will already try/catch len(iterable) and do something useful if that succeeds. The best we ended-up with has having __length_hint__ to indicate size to list(). Just out of interest, how does my __uniter__ compare? because it changed their boolean value from always-true it does? is it forbidden to define methods so that int(bool(o)) != len(o)? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24849 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Hooking Mechanism when Entering and Leaving a Try Block
On 13.08.2015 02:45, Chris Angelico wrote: On Thu, Aug 13, 2015 at 6:54 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 12/08/2015 19:44, Sven R. Kunze wrote: On 12.08.2015 18:11, Chris Angelico wrote: (Please don't top-post.) Is this some guideline? I actually quite dislike pick somebody's mail to pieces. It actually pulls things out of context. But if this is a rule for this, so be it. The rules here are very simple. Snip what you don't wish to reply to (yes I know I forget sometimes), intersperse your answers to what you do want to respond to. As Mark says, the key is to intersperse your answers with the context. In some email clients, you can highlight a block of text and hit Reply, and it'll quote only that text. (I was so happy when Gmail introduced that feature. It was the one thing I'd been most missing from it.) ChrisA So, I take this as a my personal preference guideline because I cannot find an official document for this (maybe, I am looking at the wrong places). In order to keep you happy, I perform this ancient type communication where the most relevant information (i.e. the new one) is either to find at the bottom (scrolling is such fun) OR hidden between the lines (wasting time is even more fun these days). Btw. to me, the *context is the entire post*, not just two lines. I hate if people answer me on every single word I've written and try to explain what've got wrong instead of trying to understand the message and my perspective as a whole. I find it very difficult to respond to such a post and I am inclined to completely start from an empty post. -- https://mail.python.org/mailman/listinfo/python-list
Re: Hooking Mechanism when Entering and Leaving a Try Block
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 13.08.2015 08:26, Sven R. Kunze wrote: So, I take this as a my personal preference guideline because I cannot find an official document for this (maybe, I am looking at the wrong places). - From RFC 1855 (Netiquette Guidelines https://tools.ietf.org/html/rfc1855): - If you are sending a reply to a message or a posting be sure you summarize the original at the top of the message, or include just enough text of the original to give a context. This will make sure readers understand when they start to read your response. Since NetNews, especially, is proliferated by distributing the postings from one host to another, it is possible to see a response to a message before seeing the original. Giving context helps everyone. But do not include the entire original! (there is other stuff related to this in there too) In order to keep you happy, I perform this ancient type communication where the most relevant information (i.e. the new one) is either to find at the bottom (scrolling is such fun) OR hidden between the lines (wasting time is even more fun these days). I have seen that notion with people who have not much mail traffic or are not trying to keep track of several threads at once. I personally have much less trouble (i.e. I am actually saving time!) following multiple threads when the posters are using proper quoting and are not top-posting. regards, jwi -BEGIN PGP SIGNATURE- Version: GnuPG v2 iQIbBAEBCgAGBQJVzE5BAAoJEMBiAyWXYliKe48P+L9fZm55y/0ORi7FtdzDmUaL 1gD5zhSflGrI0dRusfETu8kkAJOi3uDFs0rKRXJuWh3vY9f+Dj0573wWFuJ5CRPz SRIb3M8s7txo3Oxj+IJEgKk+FRqVwBrw5MIbkuNrhZ0UmZnvO0JhtqPYEmZpb+Ht Yvnj+PeLChytKzuMYGVz3bwU7FM9C5VMIkXeszL2oEMbqdfwfINP89bS779RQwz0 ZcT3z1OG/rqNgAJrn2/fMVZTMQe9lhfLcgWvIR2+/pxPpU7iuaTqRXC130kc7hIu ifzZf25Wi2Wxz5B4Psx0dJFKfSxasPa5qEBO1rlrH4vxJI6sPu8CI0P15fS7bO1O Mh3IPrPPZM8mByxuJxcdKHyCvOOXcs4G0Iz2+QjXuvujP8p9vrA+TVq2trB07FL9 lleXkH0ETjZzwxdzpdmgCePP302nqm5MZimpGLCjmygvSZo/HFj4PH9WWcmEhVgA kzN1uyk1f0RVk/8KqtnKNWs5pWKORxuCBCeMhm8PeIov1uJwhsWenqHsbmERUciY RKs3raJQ+M4fedGHAmlrWcI9N0slG2MIcYBCXbA0v0HM/7+JF63Orc6TCqf5iQ1p O1VyJqUASRKJ9XekWcliGkyuIS9WPR0vUsjjqdpRWfGhd62FAq6xfzPuf8V4PdfI K+TfUFKDSS6yjLNGxY0= =8iLz -END PGP SIGNATURE- -- https://mail.python.org/mailman/listinfo/python-list
[issue24857] Crash on comparing call_args with long strings
New submission from Wilfred Hughes: What steps will reproduce the problem? from mock import Mock m = Mock() m(1, 2) Mock name='mock()' id='139781492681104' m.call_args == foob Traceback (most recent call last): File stdin, line 1, in module File /home/wilfred/.py_envs/trifle/lib/python2.7/site-packages/mock.py, line 2061, in __eq__ first, second = other ValueError: too many values to unpack What is the expected output? What do you see instead? Expected False, got an error instead. (Migrated from https://github.com/testing-cabal/mock/issues/232 ) -- components: Library (Lib) messages: 248504 nosy: Wilfred.Hughes priority: normal severity: normal status: open title: Crash on comparing call_args with long strings type: crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24857 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24852] Python 3.5.0rc1 HOWTO Use Python in the web needs fix
Berker Peksag added the comment: +1 I'd delete most of the CGI section, add a note about PEP and mention Gunicorn, uwsgi and Waitress. The frameworks section also needs a cleanup. Do you want to work on a patch? -- nosy: +berker.peksag stage: - needs patch versions: +Python 3.4, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24852 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24852] Python 3.5.0rc1 HOWTO Use Python in the web needs fix
Georg Brandl added the comment: It's probably better to remove the document for now, and add a rewritten version back when it arrives. Although, this topic sees lot of change regularly, so it is probably not a good one for the standard documentation after all. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24852 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24857] Crash on comparing call_args with long strings
Michael Foord added the comment: call_args is not user settable! It is set for you by the mock when it is called. Arguably it could be a property instead. -- resolution: - not a bug status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24857 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24857] mock: Crash on comparing call_args with long strings
Changes by Wilfred Hughes yowilf...@gmail.com: -- title: Crash on comparing call_args with long strings - mock: Crash on comparing call_args with long strings ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24857 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24855] fail to mock the urlopen function
New submission from sih4sing5hong5: I also posted in stackoverflow: http://stackoverflow.com/questions/30978207/python-urlopen-mock-fail ``` from unittest.mock import patch import urllib from urllib import request from urllib.request import urlopen @patch('urllib.request.urlopen') def openPatch(urlopenMock): print(urlopenMock) print(urlopen) print(request.urlopen) print(urllib.request.urlopen) openPatch() ``` and got ``` MagicMock name='urlopen' id='140645541554384' function urlopen at 0x7fea9764c268 MagicMock name='urlopen' id='140645541554384' MagicMock name='urlopen' id='140645541554384' ``` request.urlopen and urllib.request.urlopen worked. Why urlopen had been not mocked? -- components: Library (Lib) messages: 248500 nosy: sih4sing5hong5 priority: normal severity: normal status: open title: fail to mock the urlopen function versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24855 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24856] Mock.side_effect as iterable or iterator
New submission from Martijn Pieters: The documentation states that `side_effect` can be set to an [iterable](https://docs.python.org/3/glossary.html#term-iterable): If you pass in an iterable, it is used to retrieve an iterator which must yield a value on every call. This value can either be an exception instance to be raised, or a value to be returned from the call to the mock (`DEFAULT` handling is identical to the function case). but the [actual handling of the side effect](https://github.com/testing-cabal/mock/blob/27a20329b25c8de200a8964ed5dd7762322e91f6/mock/mock.py#L1112-L1123) expects it to be an [*iterator*](https://docs.python.org/3/glossary.html#term-iterator): if not _callable(effect): result = next(effect) This excludes using a list or tuple object to produce the side effect sequence. Can the documentation be updated to state an *iterator* is required (so an object that defines __next__ and who's __iter__ method returns self), or can the CallableMixin constructor be updated to call iter() on the side_effect argument if it is not an exception or a callable? You could even re-use the [_MockIter() class](https://hg.python.org/cpython/file/256d2f01e975/Lib/unittest/mock.py#l348) already used for the [NonCallableMock.side_effect property](https://hg.python.org/cpython/file/256d2f01e975/Lib/unittest/mock.py#l509). -- components: Library (Lib) messages: 248501 nosy: mjpieters priority: normal severity: normal status: open title: Mock.side_effect as iterable or iterator versions: Python 3.4, Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24856 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Hooking Mechanism when Entering and Leaving a Try Block
On 13/08/2015 07:26, Sven R. Kunze wrote: On 13.08.2015 02:45, Chris Angelico wrote: On Thu, Aug 13, 2015 at 6:54 AM, Mark Lawrencebreamore...@yahoo.co.uk wrote: On 12/08/2015 19:44, Sven R. Kunze wrote: On 12.08.2015 18:11, Chris Angelico wrote: (Please don't top-post.) Is this some guideline? I actually quite dislike pick somebody's mail to pieces. It actually pulls things out of context. But if this is a rule for this, so be it. The rules here are very simple. Snip what you don't wish to reply to (yes I know I forget sometimes), intersperse your answers to what you do want to respond to. As Mark says, the key is to intersperse your answers with the context. In some email clients, you can highlight a block of text and hit Reply, and it'll quote only that text. (I was so happy when Gmail introduced that feature. It was the one thing I'd been most missing from it.) ChrisA So, I take this as a my personal preference guideline because I cannot find an official document for this (maybe, I am looking at the wrong places). This is a community list. The rule has been no top posting here for the 15 years I've been using Python. I find trying to follow the really long threads on python-dev or python-ideas almost impossible as there is no rule, so you're up and down responses like a yo-yo. In order to keep you happy, I perform this ancient type communication where the most relevant information (i.e. the new one) is either to find at the bottom (scrolling is such fun) OR hidden between the lines (wasting time is even more fun these days). What rubbish. Just because some people have been brainwashed into writing English incorrectly by their using M$ Outlook doesn't mean that the rest of the world has to follow suit. If you don't want to work so hard to use this list then simply don't bother coming here, I doubt that the list will miss you. Btw. to me, the *context is the entire post*, not just two lines. I hate if people answer me on every single word I've written and try to explain what've got wrong instead of trying to understand the message and my perspective as a whole. I find it very difficult to respond to such a post and I am inclined to completely start from an empty post. Which is why we prefer interspersed posting such as this. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
[issue24857] Crash on comparing call_args with long strings
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +michael.foord stage: - needs patch type: crash - behavior versions: +Python 3.4, Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24857 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Hooking Mechanism when Entering and Leaving a Try Block
On 12.08.2015 20:44, Sven R. Kunze wrote: On 12.08.2015 18:11, Chris Angelico wrote: Sounds to me like you want some sort of AST transform, possibly in an import hook. Check out something like MacroPy for an idea of how powerful this sort of thing can be. Sounds like I MacroPy would enable me to basically insert a function call before and after each try: block at import time. Is that correct so far? That sounds not so bad at all. However, if that only works due to importing it is not a solution. I need to make sure I catch all try: blocks, the current stack is in (and is about to step into). Ah yes, and it should work with Python 3 as well. Back to topic, please. :) -- https://mail.python.org/mailman/listinfo/python-list
[issue23530] os and multiprocessing.cpu_count do not respect cpuset/affinity
Serhiy Storchaka added the comment: Argument Clinic code was not regenerated. Actually the commit breaks Argument Clinic. $ make clinic ./python -E ./Tools/clinic/clinic.py --make Error in file ./Modules/posixmodule.c on line 11211: Docstring for os.cpu_count does not have a summary line! Every non-blank function docstring must start with a single line summary followed by an empty line. make: *** [clinic] Error 255 -- nosy: +serhiy.storchaka resolution: fixed - stage: resolved - needs patch status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23530 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24855] fail to mock the urlopen function
sih4sing5hong5 added the comment: It is normal because of __all__ syntax. By: https://github.com/testing-cabal/mock/issues/313#issuecomment-130564364 -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24855 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24857] mock: Crash on comparing call_args with long strings
Wilfred Hughes added the comment: This caught me by surprise and I spent a while debugging due to this issue. Isn't it reasonable that I can compare two values in Python without exceptions being raised? (1, 2) == foob False I'm happy to write a patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24857 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: AttributeError
So calling people stupid and ignorant on the internet makes you sexual arousal and to masturbate with yourself On Wed, Aug 12, 2015 at 1:38 PM, Denis McMahon denismfmcma...@gmail.com wrote: On Wed, 12 Aug 2015 12:05:37 -0700, Ltc Hotspot wrote: Have a look at assignment_10_2_v_06.py. What should I look at assignment_10_2_v_06.py.: You shouldn't. You should instead approach your tutor and tell him you are too stupid to learn computer programming[1], and can you please transfer to floor-scrubbing 101. [1] You have repeatedly ignored advice and instructions that you have been given. This is de-facto proof that you are not capable of learning to program computers. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
problem with netCDF4 OpenDAP
I'm having a problem trying to access OpenDAP files using netCDF4. The netCDF4 is installed from the Anaconda package. According to their changelog, openDAP is supposed to be supported. netCDF4.__version__ Out[7]: '1.1.8' Here's some code: url = 'http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc' nc = netCDF4.Dataset(url) I get the error - netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Dataset.__init__ (netCDF4/_netCDF4.c:9551)() RuntimeError: NetCDF: file not found However if I download the same file, it works - url = '/home/tom/Downloads/ersst.201507.nc' nc = netCDF4.Dataset(url) print nc . . . . Is it something I'm doing wrong? -- https://mail.python.org/mailman/listinfo/python-list
Re: AttributeError
On Thu, 13 Aug 2015 02:41:55 -0700, Ltc Hotspot wrote: How do I define X? What are the values of X Y from the code as follows: # print time: ['From', 'stephen.marqu...@uct.ac.za', 'Sat', 'Jan', '5', '09:14:16', '2008'] This is the data you need to look at. X is the position in the printed list of the time information. If you can not determine the correct X value by inspection of the list having been told which element it should be, then you need to go back to the python documentation and read about the list data object and how elements within the list are referenced. Once you understand from the documentation how to reference the list elements, you will be able to determine by inspection of the above list the correct value for X. Y is the position of the hours element within the time information when that information is further split using the ':' separator. You may need to refer to the documentation for the split() method of the string data object. Once you understand from the documentation how the string.split() function creates a list, and how to reference the list elements (as above), you will be able to determine by inspection the correct value for Y. This is fundamental python knowledge, and you must discover it in the documentation and understand it. You will then be able to determine the correct values for X and Y. Note that the code I posted may need the addition of a line something like: if line.startswith(From ): in a relevant position, as well as additional indenting to take account of that addition. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list
[OT] How to post properly (was: Re: Hooking Mechanism when Entering and Leaving a Try Block)
Mark Lawrence breamore...@yahoo.co.uk: The rule has been no top posting here for the 15 years I've been using Python. Top posting is simply annoying. However, I'd like people to also stick to another rule: only quote a few lines. I should start seeing your contribution to the discussion without scrolling because those few lines help me decide if I should skip the posting altogether. (Well, if I can't see any original content at once, I'll skip the posting.) A third rule, which I'm violating here myself, is stick to Python-related topics on this newsgroup. Marko -- https://mail.python.org/mailman/listinfo/python-list
[issue24857] Crash on comparing call_args with long strings
Michael Foord added the comment: Oops, I misunderstood the bug report - however, call_args is a tuple, so you can't compare it directly to a string like that. Please refer to the docs on using call_args. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24857 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24857] mock: Crash on comparing call_args with long strings
Wilfred Hughes added the comment: This bug is particularly subtle because it only applies to *long* strings. m.call_args == f False m.call_args == fo False m.call_args == foo False m.call_args == foob Traceback (most recent call last): File stdin, line 1, in module File build/bdist.linux-x86_64/egg/mock.py, line 2061, in __eq__ ValueError: too many values to unpack -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24857 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: AttributeError
On 12/08/2015 22:04, Ltc Hotspot wrote: So calling people stupid and ignorant on the internet makes you sexual arousal and to masturbate with yourself *plonk* - please follow suit everybody, it's quite clear that he has no interest in bothering with any of the data we've all provided. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: AttributeError
On Wed, 12 Aug 2015 16:46:32 -0700, Ltc Hotspot wrote: How do I define X? - Traceback reads: 10 f = open(filename,'r') 11 for l in f: --- 12 h = int(l.split()[X].split(':')[Y]) 13 c[h] = c[h] + 1 14 f.close() NameError: name 'X' is not defined If you read the text that I posted with the solution, it tells you what X and Y are. They are numbers that describe the positions of elements in your input data. This absolute refusal by you to read any explanations that are posted are exactly why you will never be a good programmer. To become a good programmer you need to read and understand the explanations. In the post with that code example, I wrote: It also assumes that there is a timestamp of the form hh:mm:ss that always appears at the same word position X in each line in the file, and that the hours record always at position Y in the timestamp. You have to replace X and Y in that line with numbers that represent the positions in the lists returned by the relevant split commands of the actual text elements that you want to extract. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list
Re: AttributeError
On Thu, Aug 13, 2015 at 2:15 AM, Denis McMahon denismfmcma...@gmail.com wrote: On Wed, 12 Aug 2015 16:46:32 -0700, Ltc Hotspot wrote: How do I define X? - Traceback reads: 10 f = open(filename,'r') 11 for l in f: --- 12 h = int(l.split()[X].split(':')[Y]) 13 c[h] = c[h] + 1 14 f.close() NameError: name 'X' is not defined If you read the text that I posted with the solution, it tells you what X and Y are. They are numbers that describe the positions of elements in your input data. This absolute refusal by you to read any explanations that are posted are exactly why you will never be a good programmer. To become a good programmer you need to read and understand the explanations. In the post with that code example, I wrote: It also assumes that there is a timestamp of the form hh:mm:ss that always appears at the same word position X in each line in the file, and that the hours record always at position Y in the timestamp. You have to replace X and Y in that line with numbers that represent the positions in the lists returned by the relevant split commands of the actual text elements that you want to extract. -- Denis, What are the values of X Y from the code as follows: Code reads: handle = From stephen.marqu...@uct.ac.za Sat Jan 5 09:14:16 2008 From lo...@media.berkeley.edu Fri Jan 4 18:10:48 2008 .split(\n) # snippet file data: mbox-short.txt count = dict() #fname = raw_input(Enter file name: )# insert # to add snippet file data #handle = open (fname, 'r')# insert # to add snippet file data for line in handle: if line.startswith(From ): time = line.split() # splitting the lines - # print time: ['From', 'stephen.marqu...@uct.ac.za', 'Sat', 'Jan', '5', '09:14:16', '2008'] for hours in time: #getting the index pos of time - hours = line.split(:)[2] # splitting on : - line = line.rstrip() count[hours] = count.get(hours, 0) + 1 # getting the index pos of hours. lst = [(val,key) for key,val in count.items()] # find the most common words lst.sort(reverse=True) for key, val in lst[:12] : print key, val Regards, Hal -- https://mail.python.org/mailman/listinfo/python-list
[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files
Robert Collins added the comment: Ok, so will someone commit 3), or would you like me to do so? After that it sounds like we can move this back to patch review, since there will be nothing left ready for commit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20180 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24857] mock: Crash on comparing call_args with long strings
Michael Foord added the comment: Ok, fair enough. -- resolution: not a bug - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24857 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24854] Null check handle return by new_string()
New submission from Pankaj Sharma: The issue reported in python-2.7.10/Parser/tokenizer.c:237 to handle NULL return by new_string() if PyMem_MALLOC() failed. So need to check for NULL and return to prevent from crash happened in get_normal_name().this issue related with issue18470 has been taken care by setting error code E_NOMEM in 3.4.X. i have attached patch, please review it. -- files: Python-2.7.10-tokenizer.patch keywords: patch messages: 248498 nosy: benjamin.peterson, pankaj.s01 priority: normal severity: normal status: open title: Null check handle return by new_string() type: crash versions: Python 2.7 Added file: http://bugs.python.org/file40172/Python-2.7.10-tokenizer.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24854 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18383] test_warnings modifies warnings.filters when running with -W default
Alex Shkop added the comment: @rbcollins that is exactly what was trying to say in previous comment. We can make a change to current patch that won't affect behavior. In old API in this sequence of filters last filter was never used: simplefilter(ignore) simplefilter(error, append=True) simplefilter(ignore, append=True) # never used So I suggest that new patch should work like this: simplefilter(error) simplefilter(ignore, append=True) # appends new filter to the end simplefilter(ignore) simplefilter(error, append=True) simplefilter(ignore, append=True) # does nothing since same filter is present. This way filtering will work in the same way it worked before patch and we won't have duplicates. I'll update the patch as soon as I will get to my computer. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18383 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Ensure unwanted names removed in class definition
Peter Otten __pete...@web.de writes: Ben Finney wrote: Peter Otten __pete...@web.de writes: That's an unexpected inconsistency between list comprehensions versus generator expressions, then. Is that documented explicitly in the Python 2 documentation? https://docs.python.org/2.4/whatsnew/node4.html Or URL:https://docs.python.org/2/whatsnew/2.4.html#pep-289-generator-expressions. Also in the PEP that introduces generator expressions, PEP 289: List comprehensions also leak their loop variable into the surrounding scope. This will also change in Python 3.0, so that the semantic definition of a list comprehension in Python 3.0 will be equivalent to list(generator expression). URL:https://www.python.org/dev/peps/pep-0289/#the-details Thanks for seeking the answer. Can you describe an improvement to URL:https://docs.python.org/2/reference/expressions.html#list-displays that makes clear this unexpected, deprecated behaviour which is only in Python 2? -- \ “What is needed is not the will to believe but the will to find | `\ out, which is the exact opposite.” —Bertrand Russell, _Free | _o__) Thought and Official Propaganda_, 1928 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list
[issue24852] Python 3.5.0rc1 HOWTO Use Python in the web needs fix
John Hagen added the comment: A couple other notes I saw: The examples (https://docs.python.org/3.5/howto/webservers.html#setting-up-fastcgi) do not follow PEP 8 (should not have an encoding statement if it is UTF-8 Python 3) or the current guidance in PEP 394 to use python3 in the shebang rather than python. Unfortunately, I think I should defer writing the patch/new page to someone with more experience in the Python/web world. I am still pretty new to it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24852 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24856] Mock.side_effect as iterable or iterator
R. David Murray added the comment: The documentation is accurate. The object being manipulated by the code clause you site is not the original object passed in to the side_effect argument. -- nosy: +r.david.murray resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24856 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15601] tkinter test_variables fails with OS X Aqua Tk 8.4
Terry J. Reedy added the comment: Andrew (and others): I wasn't sure whether to reopen this or start a new issue. Will re-close this and open new if preferable. -- nosy: +terry.reedy status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15601 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Real-time recoding of video from asx to non-Windows formats
On 12-08-15 08:04, Montana Burr wrote: Hi, I'm interested in using Python to create a server for streaming my state's traffic cameras - which are only available as Windows Media streams - to devices that do not natively support streaming Windows Media content (think Linux computers iPads). I know Python makes various problems easy to solve, and I'd like to know if this is one of those problems. I would like to use a module that works on any Linux- or UNIX-based computer, as my primary computer is UNIX-based. Hi Montana, You should take a look at FFmpeg (www.ffmpeg.org). There's a python wrapper but I doubt you need it. https://github.com/mhaller/pyffmpeg gr Arno -- https://mail.python.org/mailman/listinfo/python-list
Re: Linux users: please run gui tests
On 8/13/2015 1:11 AM, Laura Creighton wrote: In a message of Wed, 12 Aug 2015 21:49:24 -0400, Terry Reedy writes: https://bugs.python.org/issue15601 Could you add a note to the issue then? Done, though I wonder if it isn't a separate issue. I was not sure. The people currently nosy will get email. I didn't re-open the issue, which is marked closed. I decided to do so, so issue is included in new issues list. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
[issue24857] mock: Crash on comparing call_args with long strings
R. David Murray added the comment: Yeah, if it isn't comparable it should return either False or NotImplemented, not raise an exception. False would be better here, I think. -- keywords: +easy nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24857 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24855] fail to mock the urlopen function
R. David Murray added the comment: It has nothing to do with __all__, and everything to do with the way namespaces work in Python. 'from urllib.request import urllib' creates a name 'urllib' in the global namespace of your module pointing to the urlopen function (*before* you do your patch), and patch has no effect on the global namespace of your module, only on the global namespace of urllib.request. By contrast, urllib in your module's global namespace points to the urllib module, so urllib.request points to the urllib.request's global namespace, which patch has altered to point to your mock by the time you print its value. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24855 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21167] float('nan') returns 0.0 on Python compiled with icc
Roundup Robot added the comment: New changeset d9c85b6bab3a by R David Murray in branch '2.7': #21167: Fix definition of NAN when ICC used without -fp-model strict. https://hg.python.org/cpython/rev/d9c85b6bab3a New changeset 5e71a489f01d by R David Murray in branch '3.4': #21167: Fix definition of NAN when ICC used without -fp-model strict. https://hg.python.org/cpython/rev/5e71a489f01d New changeset e3008318f76b by R David Murray in branch '3.5': Merge: #21167: Fix definition of NAN when ICC used without -fp-model strict. https://hg.python.org/cpython/rev/e3008318f76b New changeset 1dd4f473c627 by R David Murray in branch 'default': Merge: #21167: Fix definition of NAN when ICC used without -fp-model strict. https://hg.python.org/cpython/rev/1dd4f473c627 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21167 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21167] float('nan') returns 0.0 on Python compiled with icc
R. David Murray added the comment: Thanks Chris, and Mark. I ran the tests on 3.6 both on Linux (non ICC) and on Mac (with ICC without -fp-model strict) and all the tests passed. -- resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21167 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21167] float('nan') returns 0.0 on Python compiled with icc
R. David Murray added the comment: Larry, do you want this for 3.5.0a2? It's an innocuous patch for anyone not using ICC, and makes ICC just work (with the default ICC build arguments) for people using ICC. (Well, on (lin/u)nux and mac, anyway, I'm not sure we've resolved all the ICC issues on Windows yet.) -- nosy: +larry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21167 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Real-time recoding of video from asx to non-Windows formats
On 08/12/2015 12:04 AM, Montana Burr wrote: I'm interested in using Python to create a server for streaming my state's traffic cameras - which are only available as Windows Media streams - to devices that do not natively support streaming Windows Media content (think Linux computers iPads). I know Python makes various problems easy to solve, and I'd like to know if this is one of those problems. I would like to use a module that works on any Linux- or UNIX-based computer, as my primary computer is UNIX-based. This is a case of use the best tool for the job. Python could glue the parts together, but maybe a bash script would be best. As for the tools themselves, they aren't going to be Python. Things like mplayer, vlc, ffmpeg all might assist. VLC is very good at this kind of thing, and can be driven from the command line, say from a bash script. VLC can connect to a network stream, transcode it, and offer it up as a different network stream. However VLC network transcoding is only a one connection at a time sort of thing, so it may not be enough for your needs. If your main target is Linux, windows media streams work fairly well with mplayer or vlc. -- https://mail.python.org/mailman/listinfo/python-list
[issue24847] Can't import tkinter in Python 3.5.0rc1
R. David Murray added the comment: Is this buildbot failure: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.5/builds/189 related to this issue? LINK : fatal error LNK1104: cannot open file 'C:\buildbot.python.org\3.5.kloth-win64\build\PCBuild\amd64\_tkinter_d.pyd' [C:\buildbot.python.org\3.5.kloth-win64\build\PCbuild\_tkinter.vcxproj] -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24847 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Vaga Java (Belgica, com tudo pago)
https://walljobs.typeform.com/to/uWpUqj We seek a software developer with experience in web application development. Should you have the passion to work in the start-up environment and the willingness to evolve in a fast-paced environment, then we'd like to get in touch. We are located in Brussels, Belgium, in the center of Europe. You should be able to work in an international team, show passion and commitment to towards the project, and be able to adapt to challenging European working standards. Responsibilities Understand design documents, giving feedback when necessary, and implement the required changes in the code base. Interact with an existing large software implementation and independently perform the required actions Review code from peers Develop automated tests and other quality assurance techniques Interact with the marketing, psychology and business teams giving advice and feedback Adapt and adjust to a fast pacing environment https://walljobs.typeform.com/to/uWpUqj -- https://mail.python.org/mailman/listinfo/python-list
[issue24851] infinite loop in faulthandler._stack_overflow
Antoine Pitrou added the comment: To fix this in a generic way, perhaps the function could update a volatile global variable after the recursive call? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24851 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24570] IDLE Autocomplete and Call Tips Do Not Pop Up on OS X with ActiveTcl 8.5.18
Mark Roseman added the comment: Awesome, thanks Kevin. Have attached calltip.patch. The extra lift() call doesn't seem to hurt on Windows or X11, so didn't make it conditional. -- keywords: +patch Added file: http://bugs.python.org/file40173/calltip.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24570 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: OBIEE Developer and Administrator @ Seattle WA
Hi Amrish, I think you can post to j...@python.org See: https://www.python.org/community/jobs/howto/ Thank you Stephane On 13 Aug 2015, at 18:42, Amrish B wrote: Hello Folks, Please go through below job description and send me updated resume to amr...@uniteditinc.com Job Title: OBIEE Developer and Administrator Location: Seattle WA Duration: 12+months Experience: 10+ years only Job Description: * maintain the Oracle Business Intelligence Enterprise Edition application and develop reports/dashboards for functional areas * Act as an analyst interacting with departments to understand, define, and document report and dashboard requirements * Assist in configuring complex Oracle systems (Oracle client tools, administration of Web Logic, and setup and configuration of web server with front end reporting tools) * Responsible for security administration within OBIEE as well as integrations with active directory * Research, tune, and implement configurations to ensure applications are performing to expected standards * Researches, evaluates and recommends enabling software design practices, trends, and related technologies * Support and comply with security model and company audit standards * Conduct comprehensive analysis of enterprise systems concepts, design, and test requirements * Analyzes, defines, and documents requirements for data, workflow, logical processes, interfaces with other systems, internal and external checks and controls, and outputs Qualifications/Knowledge, Skills, Abilities Requirements * Bachelor's Degree in Computer Science, Engineering, or related discipline, or equivalent, experience * 8 plus years of experience in data warehouse or reporting design and development * Experience with DBMS (i.e. Oracle) and working with data * Experience in system administration * Ability to troubleshoot and solve complex issues in an Enterprise environment * Ability to establish and maintain a high level of customer trust and confidence * Strong analytical and conceptual skills; ability to create original concepts and ideas Thanks Regards, Amrish Babu | IT Recruiter -- https://mail.python.org/mailman/listinfo/python-list -- Stéphane Wirtel - http://wirtel.be - @matrixise -- https://mail.python.org/mailman/listinfo/python-list
[issue15601] tkinter test_variables fails with OS X Aqua Tk 8.4
Serhiy Storchaka added the comment: Please open a new issue Laura. -- nosy: +serhiy.storchaka status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15601 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)
New submission from Laura Creighton: I have tried this on several debian unstable releases, and get the following 3 failures lac at smartwheels:~$ lsb_release -a LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch Distributor ID:Debian Description: Debian GNU/Linux unstable (sid) Release: unstable Codename: sid Idle shows my tk version as 8.6.4 python3 -m test -ugui -v test_tk gives 3 failures = CPython 3.4.3+ (default, Jul 28 2015, 13:17:50) [GCC 4.9.3] == Linux-3.16.0-4-amd64-x86_64-with-debian-stretch-sid little-endian == hash algorithm: siphash24 64bit == /tmp/test_python_7974 Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0) test_default (tkinter.test.test_tkinter.test_variables.TestBooleanVar) ... FAIL test_get (tkinter.test.test_tkinter.test_variables.TestBooleanVar) ... FAIL test_set (tkinter.test.test_tkinter.test_variables.TestBooleanVar) ... FAIL == FAIL: test_default (tkinter.test.test_tkinter.test_variables.TestBooleanVar) -- Traceback (most recent call last): File /usr/lib/python3.4/tkinter/test/test_tkinter/test_variables.py, line 163, in test_default self.assertIs(v.get(), False) AssertionError: 0 is not False == FAIL: test_get (tkinter.test.test_tkinter.test_variables.TestBooleanVar) -- Traceback (most recent call last): File /usr/lib/python3.4/tkinter/test/test_tkinter/test_variables.py, line 167, in test_get self.assertIs(v.get(), True) AssertionError: 1 is not True == FAIL: test_set (tkinter.test.test_tkinter.test_variables.TestBooleanVar) -- Traceback (most recent call last): File /usr/lib/python3.4/tkinter/test/test_tkinter/test_variables.py, line 186, in test_set self.assertEqual(self.root.globalgetvar(name), true) AssertionError: 42 != 1 -- Ran 660 tests in 3.901s FAILED (failures=3) 1 test failed: test_tk -- components: Tkinter messages: 248529 nosy: lac, terry.reedy priority: normal severity: normal status: open title: python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid) versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24858 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16554] The description of the argument of MAKE_FUNCTION and MAKE_CLOSURE is incorrect
Roundup Robot added the comment: New changeset c515b40a70eb by Antoine Pitrou in branch '3.4': Issue #16554: fix description for MAKE_CLOSURE. Initial patch by Daniel Urban. https://hg.python.org/cpython/rev/c515b40a70eb New changeset 2a41fb63c095 by Antoine Pitrou in branch '3.5': Issue #16554: fix description for MAKE_CLOSURE. Initial patch by Daniel Urban. https://hg.python.org/cpython/rev/2a41fb63c095 New changeset 7aed2d7e7dd5 by Antoine Pitrou in branch 'default': Issue #16554: fix description for MAKE_CLOSURE. Initial patch by Daniel Urban. https://hg.python.org/cpython/rev/7aed2d7e7dd5 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16554 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Module load times
I have an auto generated module that provides functions exported from a c dll. Its rather large and we are considering some dynamic code generation and caching, however before I embark on that I want to test import times. As the module is all auto generated through XSL, things like __all__ are not used, a consumer only imports one class which has methods for their use. It is the internal supporting classes which are large such as the ctype function prototypes and structures. My concern is simply reloading this in Python 3.3+ in a timeit loop is not accurate. What is the best way to do this? Thanks, jlc -- https://mail.python.org/mailman/listinfo/python-list
[issue24856] Mock.side_effect as iterable or iterator
Martijn Pieters added the comment: Bugger, that's the last time I take someone's word for it and not test properly. Indeed, I missed the inheritance of NonCallableMock, so the property is inherited from there. Mea Culpa! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24856 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16554] The description of the argument of MAKE_FUNCTION and MAKE_CLOSURE is incorrect
Antoine Pitrou added the comment: The description for MAKE_FUNCTION had already been fixed in the meantime, so I pushed the changes for MAKE_CLOSURE. Thank you! -- nosy: +pitrou resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16554 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24853] Py_Finalize doesn't clean up PyImport_Inittab
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24853 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
OBIEE Developer and Administrator @ Seattle WA
Hello Folks, Please go through below job description and send me updated resume to amr...@uniteditinc.com Job Title: OBIEE Developer and Administrator Location: Seattle WA Duration: 12+months Experience: 10+ years only Job Description: * maintain the Oracle Business Intelligence Enterprise Edition application and develop reports/dashboards for functional areas * Act as an analyst interacting with departments to understand, define, and document report and dashboard requirements * Assist in configuring complex Oracle systems (Oracle client tools, administration of Web Logic, and setup and configuration of web server with front end reporting tools) * Responsible for security administration within OBIEE as well as integrations with active directory * Research, tune, and implement configurations to ensure applications are performing to expected standards * Researches, evaluates and recommends enabling software design practices, trends, and related technologies * Support and comply with security model and company audit standards * Conduct comprehensive analysis of enterprise systems concepts, design, and test requirements * Analyzes, defines, and documents requirements for data, workflow, logical processes, interfaces with other systems, internal and external checks and controls, and outputs Qualifications/Knowledge, Skills, Abilities Requirements * Bachelor's Degree in Computer Science, Engineering, or related discipline, or equivalent, experience * 8 plus years of experience in data warehouse or reporting design and development * Experience with DBMS (i.e. Oracle) and working with data * Experience in system administration * Ability to troubleshoot and solve complex issues in an Enterprise environment * Ability to establish and maintain a high level of customer trust and confidence * Strong analytical and conceptual skills; ability to create original concepts and ideas Thanks Regards, Amrish Babu | IT Recruiter -- https://mail.python.org/mailman/listinfo/python-list
[issue17703] Trashcan mechanism segfault during interpreter finalization in Python 2.7.4
Antoine Pitrou added the comment: I'm seeing this bug in Python 3.4.2 as well, and the patch here (tstate_trashcan.patch) appears to fix it. What is the context? Some specific C code? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17703 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24492] using custom objects as modules: AttributeErrors new in 3.5
Brett Cannon added the comment: I noticed you accepted the PR on Bitbucket, Larry. Should I consider your part done and I can now pull the commit into the 3.5 and default branches on hg.python.org? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24492 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21159] configparser.InterpolationMissingOptionError is not very intuitive
Changes by Robert Collins robe...@robertcollins.net: -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21159 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21159] configparser.InterpolationMissingOptionError is not very intuitive
Robert Collins added the comment: I've applied this since it seems Lukasz was busy. Thanks for the patch Lukasz! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21159 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[Back off topic] - Re: Hooking Mechanism when Entering and Leaving a Try Block
On 08/13/2015 12:28 AM, Sven R. Kunze wrote: On 12.08.2015 20:44, Sven R. Kunze wrote: On 12.08.2015 18:11, Chris Angelico wrote: Sounds to me like you want some sort of AST transform, possibly in an import hook. Check out something like MacroPy for an idea of how powerful this sort of thing can be. Sounds like I MacroPy would enable me to basically insert a function call before and after each try: block at import time. Is that correct so far? That sounds not so bad at all. However, if that only works due to importing it is not a solution. I need to make sure I catch all try: blocks, the current stack is in (and is about to step into). Ah yes, and it should work with Python 3 as well. Back to topic, please. :) But we love being off topic! Also if you change the subject line to demarcate a branch in the discussion (and mark it as off topic), that is completely acceptable as well. This in fact was done eventually by Marko. That leaves the original part of the thread to carry on its merry way. Of course I am assuming you read your email using a threaded email client that shows you the nested tree structure of the replies, instead of the really strange 1-dimensional gmail-style conversations that lose that structure entirely. But I digress. We get sidetracked rather easily around here. -- https://mail.python.org/mailman/listinfo/python-list
Re: [Meta] How to post properly (was: Re: Hooking Mechanism when Entering and Leaving a Try Block)
On Thu, 13 Aug 2015 07:09 pm, Marko Rauhamaa wrote: A third rule, which I'm violating here myself, is stick to Python-related topics on this newsgroup. On the sorts of places that take these sorts of fine distinctions seriously, your post would be considered Meta rather than Off-topic. That is: - posts about the main topic (here, that would be Python) are on-topic; - posts about posting are meta; - everything else is off-topic. We have a reasonable tolerance to off-topic discussions, particularly if they evolve naturally from an on-topic one. -- Steven -- https://mail.python.org/mailman/listinfo/python-list
[issue24861] deprecate importing components of IDLE
Terry J. Reedy added the comment: Thank you for doing the research. It seems that extensions are the only unknown. Steps for doing this. 1. Nick once said to start with a notice in idlelib.__init__. How about the following. The idlelib package implements the Idle application, which include an interactive shell and editor. The files named idle.* should be used to start Idle. The other files are private implementations and should not be imported by other applications. Their details are subject to change. See PEP 434 for more informaton. 2. Put same in NEWS.txt -- not just a notice that a notice was added to .__init__, but the notice itself. 3. Put a single line at the top of each 'new' file. Perhaps # Private implementation module. API subject to change. 4. 'Old' files, which will go away someday, perhaps as soon as 3.6, are less of a concern to me. If one that has been replaced by a ttk version is imported when use_ttk is true, we can assume that it is being imported by an extension and issue a DeprecationWarning. 5. PyShell is a special case since from idlelib.PyShell import main; main() (essentially the content of idlelib.__main__) was once advertised as the way to start Idle. PyShell is also a special case because it includes startup code, shell code, and editor debug code, making it a prime target for refactoring. If main() were moved elsewhere and __main__.py and idle.* files modified to point to the new location, we could raise a DeprecationWarning in PyShell.main before calling the new main. -- assignee: - terry.reedy priority: normal - high versions: +Python 2.7, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24861 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24861] deprecate importing components of IDLE
Changes by Terry J. Reedy tjre...@udel.edu: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24861 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[OT] unwritten list etiquette ate, was Re: Hooking Mechanism when Entering and Leaving a Try Block
On 08/13/2015 12:26 AM, Sven R. Kunze wrote: snip Btw. to me, the *context is the entire post*, not just two lines. You're a very rare person indeed. Most people seem to not read any of the post except the first and last lines. At least posting inline shows me they've read and understood the portion of my email they are quoting. Many times I've emailed someone with a few details and queries (not too many; attention spans are short), only to get a one sentence, top-posted reply that completely fails to come remotely close to answering my actual question. I went back and forth with one guy three times once, each time pleading with him to read what I wrote. Note that I removed content that isn't relevant to my reply, thus making it easier for others to follow this. I hate if people answer me on every single word I've written and try to explain what've got wrong instead of trying to understand the message and my perspective as a whole. I find it very difficult to respond to such a post and I am inclined to completely start from an empty post. In my experience, when a person does this (delete everything and start from an empty post, or just say screw it and top post), he or she is likely the one who got the wrong message and failed to understand the message or my perspective. Not saying you do, but in general it's this rationale that has led to the reaction people on usenet have to top posting. -- https://mail.python.org/mailman/listinfo/python-list
[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)
Serhiy Storchaka added the comment: Oh, sorry. The issue still looks strange to me. It looks as a result of mix Python core, library or tests of different versions. Could you please test what following commands output? import tkinter tcl = tkinter.Tcl() tcl.getboolean(42) True tkinter.BooleanVar.set function BooleanVar.set at 0xb6ed5614 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24858 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24860] handling of IDLE 'open module' errors
Terry J. Reedy added the comment: I see this as two related changes: a) Leave the module name query box open when there is a error, so the user can either correct a mistake (or hit Cancel) without reopening the box and re-entering the module name. Good idea. b) Put the error message in the box itself, perhaps with a beep. I presume there would be no [OK] button, but rather the cursor would remain in the entry box. Nice simplification. I believe 'not a source-based module' means 'not a python-coded module', which seems a little clearer. We could check the importlib doc. -- stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24860 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21159] configparser.InterpolationMissingOptionError is not very intuitive
Roundup Robot added the comment: New changeset 267422f7c927 by Robert Collins in branch '3.4': Issue #21159: Improve message in configparser.InterpolationMissingOptionError. https://hg.python.org/cpython/rev/267422f7c927 New changeset 1a144ff2d78b by Robert Collins in branch '3.5': Issue #21159: Improve message in configparser.InterpolationMissingOptionError. https://hg.python.org/cpython/rev/1a144ff2d78b New changeset fb4e67040779 by Robert Collins in branch 'default': Issue #21159: Improve message in configparser.InterpolationMissingOptionError. https://hg.python.org/cpython/rev/fb4e67040779 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21159 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24860] handling of IDLE 'open module' errors
Mark Roseman added the comment: Exactly. The querydialog code (which will replace the simpledialog askstring/askinteger calls) displays errors as shown in querydialog.png, with the error messages disappearing as soon as you hit another key. You can also pass in a 'validator' to check if the input is ok, so in this case it would check if the module could be loaded and return the appropriate message if not. -- Added file: http://bugs.python.org/file40175/querydialog.png ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24860 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
How to model government organization hierarchies so that the list can expand and compress
It's like the desktop folder/directory model where you can create unlimited folders and put folders within other folders. Instead of folders, I want to use government organizations. Example: Let user create agency names: Air Force, Marines, Navy, Army. Then let them create an umbrella collection called Pentagon, and let users drag Air Force, Marines, Navy, etc. into the umbrella collection. User may wish to add smaller sub-sets of Army, such as Army Jeep Repair Services User may also want to add a new collection Office of the President and put OMB and Pentagon under that as equals. What would the data model look like for this? If I have a field: next_higher_level_parent that lets children records keep track of parent record, it's hard for me to imagine anything but an inefficient bubble sort to produce a hierarchical organizational list. Am using Postgres, not graph database. I'm hoping someone else has worked on this problem, probably not with government agency names, but perhaps the same principle with other objects. Thanks! Alex Glaros -- https://mail.python.org/mailman/listinfo/python-list
Re: Module load times
Hi Stefan, How is the DLL binding implemented? Using ctypes? Or something else? It is through ctypes. Obviously, instantiating a large ctypes wrapper will take some time. A binary module would certainly be quicker here, both in terms of import time and execution time. Since you're generating the code anyway, generating Cython code instead shouldn't be difficult but would certainly yield faster code. True, I was using XSLT to auto generate the module. I will however explore this. What makes you think the import might be a problem? That's a one-time thing. Or is your application a command-line tool or so that needs to start and terminate quickly? The code is used within plugin points and soon to be asynchronous code (once the original broken implementation is fixed) where in some cases it will be instantiated 100's of 1000's of times etc... Thanks, jlc -- https://mail.python.org/mailman/listinfo/python-list
Re: Mock object but also assert method calls?
Thomas Lehmann via Python-list python-list@python.org writes: How about asserting that test2 of class Bar is called? It is unusual to call class methods; do you mean a method on an instance? You will make a mock instance of the class, or a mock of the class; and you'll need to know which it is. Of course I can do a patch for a concrete method but I was looking for something like: mocked_object.assert_method_called_with(name=test2, hello) The ‘mock’ library defaults to providing ‘MagicMock’, which is “magic” in the sense that it automatically provides any attribute you request, and those attributes are themselves also MagicMocks:: import unittest.mock def test_spam_calls_foo_bar(): Should call the `spam` method on the specified `Foo` instance. mock_foo = unittest.mock.MagicMock(system_under_test.Foo) system_under_test.spam(mock_foo) mock_foo.spam.assert_called_with(hello) If find following totally different to the normal API which is provided by the mock library: assert call().test2(hello) in mocked_objects.mock_calls The ‘assert’ statement is a crude tool, which knows little about the intent of your assertion. You should be instead using the specialised methods from ‘unittest.TestCase’ and the methods on the mock objects themselves. -- \ “It is the mark of an educated mind to be able to entertain a | `\ thought without accepting it.” —Aristotle | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list
[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)
Serhiy Storchaka added the comment: This looks strange. Current default Tcl in Debian unstable is 8.6 [1]. New Python3 builds depend on libtcl8.6 [2]. The full version of the 8.4 branch is 8.4.20 [3], this is the last release in the 8.4 branch. Perhaps your installation was not updated too long time if you see 8.6.4. [1] https://packages.debian.org/sid/tcl [2] https://packages.debian.org/sid/python3-tk [3] https://packages.debian.org/sid/tcl8.4 -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24858 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: How to model government organization hierarchies so that the list can expand and compress
Create a model with a parent_id on the current model and you can use the mptt concept or some others for the reading. On 13 Aug 2015, at 21:10, Alex Glaros wrote: It's like the desktop folder/directory model where you can create unlimited folders and put folders within other folders. Instead of folders, I want to use government organizations. Example: Let user create agency names: Air Force, Marines, Navy, Army. Then let them create an umbrella collection called Pentagon, and let users drag Air Force, Marines, Navy, etc. into the umbrella collection. User may wish to add smaller sub-sets of Army, such as Army Jeep Repair Services User may also want to add a new collection Office of the President and put OMB and Pentagon under that as equals. What would the data model look like for this? If I have a field: next_higher_level_parent that lets children records keep track of parent record, it's hard for me to imagine anything but an inefficient bubble sort to produce a hierarchical organizational list. Am using Postgres, not graph database. I'm hoping someone else has worked on this problem, probably not with government agency names, but perhaps the same principle with other objects. Thanks! Alex Glaros -- https://mail.python.org/mailman/listinfo/python-list -- Stéphane Wirtel - http://wirtel.be - @matrixise -- https://mail.python.org/mailman/listinfo/python-list
Re: How to model government organization hierarchies so that the list can expand and compress
On Thu, Aug 13, 2015 at 1:10 PM, Alex Glaros alexgla...@gmail.com wrote: It's like the desktop folder/directory model where you can create unlimited folders and put folders within other folders. Instead of folders, I want to use government organizations. Example: Let user create agency names: Air Force, Marines, Navy, Army. Then let them create an umbrella collection called Pentagon, and let users drag Air Force, Marines, Navy, etc. into the umbrella collection. User may wish to add smaller sub-sets of Army, such as Army Jeep Repair Services User may also want to add a new collection Office of the President and put OMB and Pentagon under that as equals. What would the data model look like for this? If I have a field: next_higher_level_parent that lets children records keep track of parent record, it's hard for me to imagine anything but an inefficient bubble sort to produce a hierarchical organizational list. Am using Postgres, not graph database. I'm hoping someone else has worked on this problem, probably not with government agency names, but perhaps the same principle with other objects. https://en.wikipedia.org/wiki/Tree_(data_structure) -- https://mail.python.org/mailman/listinfo/python-list
[issue24861] deprecate importing components of IDLE
New submission from Mark Roseman: One of the concerns with making significant structural changes to the IDLE codebase is breakage of external that might import a piece of idlelib (so not just 'import idlelib' but a particular submodule). PEP 434 already makes the case that this behaviour is unsupported (the modules are undocumented and effectively private implementations). In the interests of not digging this particular hole any further, I'm suggesting we make this official. I don't know what the appropriate mechanism would be (e.g. something in IDLE's README.txt file, something at the top of each IDLE module, etc.). Based on some suggestions on idle-dev, I did some searching to find out what impact this might have. As expected, most uses import the whole thing, either documenting how to run IDLE, or launching it as an external editor. This is done as both import idlelib but also as import idlelib.idle Turtledemo appears to be the only thing in stdlib that imports a piece of idlelib. From nullege.com, one reference to a now-defunct wiki/collaboration tool called Springnote. From programcreek.com, nothing significant. Multiple applications do import PyShell as a way of starting a Python shell in their application. Usually they do just call PyShell.main(). Sometimes though they do reach inside in fairly significant ways that might break if the code were substantially changed. For example, search for PyShell in http://igraph.org/python/doc/igraph.app.shell-pysrc.html I could locate no other significant uses based on Google search, etc. The one exception I would therefore suggest to the no importing submodules would be importing PyShell to open up a Python shell window. I'd go further to suggest that the existing PyShell be called something else, and a new PyShell wrapper be created which documents an official API (with therefore very limited mucking inside), and then delegates to an actual implementation. -- components: IDLE messages: 248540 nosy: Al.Sweigart, kbk, markroseman, roger.serwy, terry.reedy priority: normal severity: normal status: open title: deprecate importing components of IDLE type: enhancement versions: Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24861 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Module load times
Joseph L. Casale schrieb am 13.08.2015 um 18:56: I have an auto generated module that provides functions exported from a c dll. Its rather large and we are considering some dynamic code generation and caching, however before I embark on that I want to test import times. As the module is all auto generated through XSL, things like __all__ are not used, a consumer only imports one class which has methods for their use. It is the internal supporting classes which are large such as the ctype function prototypes and structures. How is the DLL binding implemented? Using ctypes? Or something else? Obviously, instantiating a large ctypes wrapper will take some time. A binary module would certainly be quicker here, both in terms of import time and execution time. Since you're generating the code anyway, generating Cython code instead shouldn't be difficult but would certainly yield faster code. My concern is simply reloading this in Python 3.3+ in a timeit loop is not accurate. What is the best way to do this? What makes you think the import might be a problem? That's a one-time thing. Or is your application a command-line tool or so that needs to start and terminate quickly? Stefan -- https://mail.python.org/mailman/listinfo/python-list
Re: How to model government organization hierarchies so that the list can expand and compress
Figure out, right now, what you want to do when you find a government agency that has 2 masters and not one, so the strict heirarchy won't work. Laura -- https://mail.python.org/mailman/listinfo/python-list
[issue24860] handling of IDLE 'open module' errors
New submission from Mark Roseman: In EditorWindow.open_module... once switch to querydialog, display errors (e.g. module not found) in askstring dialog itself, not open up subsequent 'showerror' dialog -- components: IDLE messages: 248539 nosy: kbk, markroseman, roger.serwy, terry.reedy priority: normal severity: normal status: open title: handling of IDLE 'open module' errors type: enhancement versions: Python 2.7, Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24860 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24860] handling of IDLE 'open module' errors
Terry J. Reedy added the comment: Where is querydialog? (It looks like something than should be in tkinter ;-). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24860 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21167] float('nan') returns 0.0 on Python compiled with icc
Larry Hastings added the comment: Assuming that ICC_NAN_STRICT is only on for Intel icc: yes, please. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21167 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Mock object but also assert method calls?
On Fri, 14 Aug 2015 07:21 am, Ben Finney wrote: If find following totally different to the normal API which is provided by the mock library: assert call().test2(hello) in mocked_objects.mock_calls The ‘assert’ statement is a crude tool, which knows little about the intent of your assertion. I agree with Ben here. Despite the popularity of nose (I think it is nose?) which uses `assert` for testing, I think that is a gross misuse of the statement. It is okay to use assertions this way for quick and dirty ad hoc testing, say at the command line, but IMO totally inappropriate for anything more formal, like unit testing. If for no other reason than the use of `assert` for testing makes it impossible to test your code when running with the Python -O (optimize) switch. For more detail on the uses, and abuses, of `assert` see this: http://import-that.dreamwidth.org/676.html -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Is Django the way to go for a newbie?
In a message of Thu, 13 Aug 2015 18:30:17 -0700, Rustom Mody writes: admission I dont know Django. Used RoR some years ago and it was frightening. And Ruby is not bad. So I assume Rails is. I just assumed -- maybe ignorantly -- that Django and RoR are generically similar systems /admission It's web2py that is the Python web framework that was inspired and influenced by RoR. And they are about as different as can be and still both be Full Stack Frameworks, to the extent that most people (at least all the ones I know) who really like one framework also really dislike the other. Laura -- https://mail.python.org/mailman/listinfo/python-list
[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)
Serhiy Storchaka added the comment: Thanks Laura. Looks as binary _tkinter is out of sync with the library and tests. Failing tests were added in issue15133 together with related changes in Python library (added BooleanVar.set and other changes) and _tkinter (changed getboolean()). If Debian version includes 117f45749359, getboolean() always should return boolean. Otherwise failing tests shouldn't exist. -- nosy: +doko ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24858 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24492] using custom objects as modules: AttributeErrors new in 3.5
Larry Hastings added the comment: Yep. This time I have foisted nearly all the work, including the forward-merging, onto y'all. *sits back, sips iced coffee* -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24492 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Is Django the way to go for a newbie?
On Fri, Aug 14, 2015 at 11:05 AM, Michael Torrie torr...@gmail.com wrote: Given that until recently he thought Django was an IDE, I think calling Django a library is fair, as it describes to him how it relates to Python. You download it and install it and it goes in site-packages along with all the other libraries you might install. Of course it comes with utilities as well (which I mentioned). Making the distinctions you are making, in this context, is probably ultimately going to be confusing to him at this stage of the game. As he gets familiar with django I don't think he'll find this original simplification confusing, nor has it seemed to make this discussion a mess. As to the DSL, I'm not quite sure which part of django you're getting at. Are you referring to the (optional) templating system? My view, for what it's worth: Django is a library, but it's also a framework. The difference isn't really that great, and most frameworks are implemented using libraries. The library vs framework distinction, from an application's standpoint, broadly one of how you structure your code - do you write a bunch of top-level code that calls on library functions, or do you write a bunch of functions that the framework calls on? The distinction can blur some, too. And as Michael says, the slight simplification isn't causing problems, so it's really only a technical correctness issue. (Pedantry, in the best sense of the word.) I've often explained things using technically-incorrect language, because going into immense detail won't help; we don't explain quantum mechanics and the nuances of electrical engineering when we explain how an HTTP request arrives at your app, because it doesn't matter. Saying The system hands you a request to process is slightly sloppy even from a network admin's perspective (what you actually get is a socket connection, and then you read from that until you reckon you have the whole request, yada yada), but it's what you most likely care about. On Fri, Aug 14, 2015 at 11:30 AM, Rustom Mody rustompm...@gmail.com wrote: Purposive, directed lying is usually better pedagogy than legalistic correctness. Right :) Only I wouldn't call it lying, as that term indicates an intent to deceive. Purposeful inaccuracy, let's say. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
RE: Module load times
Importing is not the same as instantiation. When you import a module, the code is only read from disk and instantiated the first time. Then it is cached. Subsequent imports in the same Python session use the cached version. I do mean imported, in the original design there were many ctype function prototypes, the c developer had ran some tests and showed quite a bit of time taken up just the import over 100 clean imports. I don't have his test harness and hence why I am trying to validate the results. So the answer will depend on your application. If your application runs for a long time (relatively speaking), and imports the plugins 100s or 1000s of times, it should not matter. Only the first import is likely to be slow. But if the application starts up, imports the plugin, then shuts down, then repeats 100s or 1000s of times, that may be slow. Or if it launches separate processes, each of which imports the plugin. Yeah that wasn't clear. The plugins are invoked in fresh interpreter processes and hence modules with import side effects or simply large modules can manifest over time. Thanks Steven jlc -- https://mail.python.org/mailman/listinfo/python-list
Re: Is Django the way to go for a newbie?
On 08/13/2015 07:30 PM, Rustom Mody wrote: Nothing specifically Django I am getting at. Just that learning - a templating engine -- eg Cheetah, Mako - an ORM eg SQLAlchemy - etc is more fun than learning to chant the right mantras that a framework demands without any clue of what/why/how Indeed. It's this very thing that you speak of that makes web development very discouraging to me because it does demand knowledge of quite a few separate but interconnected domains and their specific languages. In my original post I had forgotten to mention ORM, though I did mention SQL. Adding abstraction in theory makes things easier. In practice it's often kind of like the old saying about solving a problem using regular expressions. -- https://mail.python.org/mailman/listinfo/python-list
[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)
Laura Creighton added the comment: So this is a debian packaging issue we need to tell the debian package maintainers about? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24858 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24862] subprocess.Popen behaves incorrect when moved in process tree
New submission from Andre Merzky: - create a class which is a subclass of multiprocessing.Process ('A') - in its __init__ create new thread ('B') and share a queue with it - in A's run() method, run 'C=subprocess.Popen(args=/bin/false)' - push 'C' though the queue to 'B' - call 'C.pull()' -- returns 0 Apart from returning 0, the pull will also return immediately, even if the task is long running. The task does not die -- 'ps' shows it is well alive. I assume that the underlying reason is that 'C' is moved sideways in the process tree, and the wait is happening in a thread which is not the parent of C. I assume (or rather guess, really) that the system level waitpid call raises a 'ECHILD' (see wait(2)), but maybe that is misinterpreted as 'process gone'? I append a test script which shows different combinations of process spawner and watcher classes. All of them should report an exit code of '1' (as all run /bin/false), or should raise an error. None should report an exit code of 0 -- but some do. PS.: I implore you not to argue if the above setup makes sense -- it probably does not. However, it took significant work to condense a real problem into that small excerpt, and it is not a full representation of our application stack. I am not interested in discussing alternative approaches: we have those, and I can live with the error not being fixed. #!/usr/bin/env python from subprocess import Popen from threading import Thread as T from multiprocessing import Process as P import multiprocessing as mp class A(P): def __init__(self): P.__init__(self) self.q = mp.Queue() def b(q): C = q.get() exit_code = C.poll() print exit code: %s % exit_code B = T(target = b, args=[self.q]) B.start () def run(self): C = Popen(args = '/bin/false') self.q.put(C) a = A() a.start() a.join() -- components: Library (Lib) files: test_mp.py messages: 248553 nosy: Andre Merzky priority: normal severity: normal status: open title: subprocess.Popen behaves incorrect when moved in process tree type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file40177/test_mp.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24862 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Is Django the way to go for a newbie?
On 08/10/2015 10:08 PM, Rustom Mody wrote: On Tuesday, August 11, 2015 at 8:59:47 AM UTC+5:30, Michael Torrie wrote: On 08/10/2015 07:49 PM, Dwight GoldWinde wrote: Thank you, Gary, for this new information. I will be looking into virtualenv and vertualenvwrapper. I thought that Django was an IDE. But, it seems that an IDE is one more thing that I need that I didn¹t know I needed!? Django is a programming _library_ (also called a framework) Please dont conflate library and framework. Library, framework, DSL are different approaches for solving similar problems. I personally tend to prefer DSL's, dislike frameworks and am neutral to libraries. Which is why I would tend to start with flask + template-language + ORM rather than start with a framework. Others may have for very good reasons different preferences and that is fine¹. But if you say equate all these, discussion becomes a mess. Ahh. Well at least you didn't rail on me for being too lazy to capitalize acronyms like html. Given that until recently he thought Django was an IDE, I think calling Django a library is fair, as it describes to him how it relates to Python. You download it and install it and it goes in site-packages along with all the other libraries you might install. Of course it comes with utilities as well (which I mentioned). Making the distinctions you are making, in this context, is probably ultimately going to be confusing to him at this stage of the game. As he gets familiar with django I don't think he'll find this original simplification confusing, nor has it seemed to make this discussion a mess. As to the DSL, I'm not quite sure which part of django you're getting at. Are you referring to the (optional) templating system? -- https://mail.python.org/mailman/listinfo/python-list
Re: Is Django the way to go for a newbie?
On Friday, August 14, 2015 at 6:35:27 AM UTC+5:30, Michael Torrie wrote: On 08/10/2015 10:08 PM, Rustom Mody wrote: On Tuesday, August 11, 2015 at 8:59:47 AM UTC+5:30, Michael Torrie wrote: On 08/10/2015 07:49 PM, Dwight GoldWinde wrote: Thank you, Gary, for this new information. I will be looking into virtualenv and vertualenvwrapper. I thought that Django was an IDE. But, it seems that an IDE is one more thing that I need that I didn¹t know I needed!? Django is a programming _library_ (also called a framework) Please dont conflate library and framework. Library, framework, DSL are different approaches for solving similar problems. I personally tend to prefer DSL's, dislike frameworks and am neutral to libraries. Which is why I would tend to start with flask + template-language + ORM rather than start with a framework. Others may have for very good reasons different preferences and that is fine¹. But if you say equate all these, discussion becomes a mess. Ahh. Well at least you didn't rail on me for being too lazy to capitalize acronyms like html. No I am not trolling :-) Given that until recently he thought Django was an IDE, I think calling Django a library is fair, as it describes to him how it relates to Python. You download it and install it and it goes in site-packages along with all the other libraries you might install. Of course it comes with utilities as well (which I mentioned). Making the distinctions you are making, in this context, is probably ultimately going to be confusing to him at this stage of the game. As he gets familiar with django I don't think he'll find this original simplification confusing, nor has it seemed to make this discussion a mess. True. Purposive, directed lying is usually better pedagogy than legalistic correctness. As to the DSL, I'm not quite sure which part of django you're getting at. Are you referring to the (optional) templating system? Nothing specifically Django I am getting at. Just that learning - a templating engine -- eg Cheetah, Mako - an ORM eg SQLAlchemy - etc is more fun than learning to chant the right mantras that a framework demands without any clue of what/why/how admission I dont know Django. Used RoR some years ago and it was frightening. And Ruby is not bad. So I assume Rails is. I just assumed -- maybe ignorantly -- that Django and RoR are generically similar systems /admission -- https://mail.python.org/mailman/listinfo/python-list
[issue24860] handling of IDLE 'open module' errors
Mark Roseman added the comment: Work in progress, have a few more tweaks to make, but here's a snapshot... -- Added file: http://bugs.python.org/file40176/querydialog.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24860 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24854] Null check handle return by new_string()
Roundup Robot added the comment: New changeset 208d6d14c2a3 by Benjamin Peterson in branch '2.7': add missing NULL checks to get_coding_spec (closes #24854) https://hg.python.org/cpython/rev/208d6d14c2a3 -- nosy: +python-dev resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24854 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)
Serhiy Storchaka added the comment: Yes, this looks as packaging issue. Added Matthias Klose, the Debian package maintainer. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24858 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Module load times
On Fri, 14 Aug 2015 07:12 am, Joseph L. Casale wrote: What makes you think the import might be a problem? That's a one-time thing. Or is your application a command-line tool or so that needs to start and terminate quickly? The code is used within plugin points and soon to be asynchronous code (once the original broken implementation is fixed) where in some cases it will be instantiated 100's of 1000's of times etc... Importing is not the same as instantiation. When you import a module, the code is only read from disk and instantiated the first time. Then it is cached. Subsequent imports in the same Python session use the cached version. So the answer will depend on your application. If your application runs for a long time (relatively speaking), and imports the plugins 100s or 1000s of times, it should not matter. Only the first import is likely to be slow. But if the application starts up, imports the plugin, then shuts down, then repeats 100s or 1000s of times, that may be slow. Or if it launches separate processes, each of which imports the plugin. Without understanding your application, and the plugin model, it is difficult to predict the impact of importing. -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Module load times
On Fri, Aug 14, 2015 at 12:25 PM, Joseph L. Casale jcas...@activenetwerx.com wrote: Yeah that wasn't clear. The plugins are invoked in fresh interpreter processes and hence modules with import side effects or simply large modules can manifest over time. If they're invoked in fresh processes, then you're looking at process startup time, and I would recommend using OS-level tools to play around with that. Unix-like systems will usually have a 'time' command which will tell you exactly how much wall and CPU time a process took needed; just create a system that starts up and promptly shuts down, and then you can test iterations that way. Of course, there are a million and one variables (disk caches, other activity on the system, etc), but it's better than nothing. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[issue24859] ctypes.Structure bit order is reversed - counts from right
Martin Panter added the comment: It would be helpful if you could trim down your example code a bit. Without studying the whole file, it is hard to see exactly what order you are seeing and what order you expect, since there are two versions with different orders in the code. My understanding of the “ctypes” module is that it is for interacting with the local OS, ABI, compiler, etc, which could use various layouts depending on the platform. According to the Linux x86-64 ABI http:/www.x86-64.org/documentation/abi.pdf, page 14, “bit-fields are allocated from right to left”, which I interpret to mean from least-significant to most-significant bit. Not so sure about Windows, but https://msdn.microsoft.com/en-us/library/yszfawxh.aspx suggests a similar story (LSB first). This behaviour agrees with my experiments on Linux and Wine: class Bitfield(Structure): ... _fields_ = ((a, c_uint8, 4), (b, c_uint8, 4)) ... bytes(Bitfield(0xA, 0xB)) b'\xba' Does this agree with what you expect? Otherwise, what leads you to expect something different? Also: * bytes(saej1939_message_id) should copy the bytes directly; no need for a union. * struct.unpack() should also accept a “ctypes” object directly; no need for the copy. -- nosy: +martin.panter ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24859 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)
Laura Creighton added the comment: Python 3.4.3+ (default, Jul 28 2015, 13:17:50) [GCC 4.9.3] on linux Type help, copyright, credits or license for more information. import tkinter tcl = tkinter.Tcl() tcl.getboolean(42) 42 tkinter.BooleanVar.set function BooleanVar.set at 0x7f15b780bea0 print (tkinter) module 'tkinter' from '/usr/lib/python3.4/tkinter/__init__.py' import _tkinter print(_tkinter) module '_tkinter' from '/usr/lib/python3.4/lib-dynload_tkinter.cpython-34m-x86_64-linux-gnu.so' I have the libpython3.4-testsuite installed lac@fido:~$ apt-cache policy libpython3.4-testsuite libpython3.4-testsuite: Installed: 3.4.3-8 Candidate: 3.4.3-8 Version table: *** 3.4.3-8 0 500 http://ftp.se.debian.org/debian/ unstable/main amd64 Packages 500 http://ftp.debian.org/debian/ unstable/main amd64 Packages 100 /var/lib/dpkg/status I am getting these same errors on multiple machines. As far as I know every one of them gets their packages from the same place, ftp.se.debian.org -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24858 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Vaga Java (Belgica, com tudo pago)
Wondering why a position for Java/JS was sent to this list...just wondering... On Thu, Aug 13, 2015 at 11:59 AM, henrique.calan...@walljobs.com.br wrote: https://walljobs.typeform.com/to/uWpUqj We seek a software developer with experience in web application development. Should you have the passion to work in the start-up environment and the willingness to evolve in a fast-paced environment, then we'd like to get in touch. We are located in Brussels, Belgium, in the center of Europe. You should be able to work in an international team, show passion and commitment to towards the project, and be able to adapt to challenging European working standards. Responsibilities Understand design documents, giving feedback when necessary, and implement the required changes in the code base. Interact with an existing large software implementation and independently perform the required actions Review code from peers Develop automated tests and other quality assurance techniques Interact with the marketing, psychology and business teams giving advice and feedback Adapt and adjust to a fast pacing environment https://walljobs.typeform.com/to/uWpUqj -- https://mail.python.org/mailman/listinfo/python-list -- -- Leônidas S. Barbosa (Kirotawa) blog: corecode.wordpress.com -- https://mail.python.org/mailman/listinfo/python-list
Mock object but also assert method calls?
Hi, How about asserting that test2 of class Bar is called? Of course I can do a patch for a concrete method but I was looking for something like: mocked_object.assert_method_called_with(name=test2, hello) If find following totally different to the normal API which is provided by the mock library: assert call().test2(hello) in mocked_objects.mock_calls Is there a better way? APPENDIX: Foo delegates calls to Bar. [code] from mock import patch with patch(__main__.Bar) as mocked_object: foo = Foo() foo.test1() foo.test2(hello) print(mocked_object.mock_calls) # print all calls (c'tor as well as normal methods) for name, args, kwargs in mocked_object.mock_calls: print(name, args, kwargs) [/code] Generates: class '__main__.Bar' test1: Foo has been called test2: Foo has been called with value hello [call(), call().test1(), call().test2('hello')] ('', (), {}) ('().test1', (), {}) ('().test2', ('hello',), {}) -- https://mail.python.org/mailman/listinfo/python-list
[issue24851] infinite loop in faulthandler._stack_overflow
Paul Murphy added the comment: Somehow, you need to preserve access to the stack memory. The generated code is still growing the stack, it just fails to touch any of it. I'm guessing a volatile access would just add an extra non-stack access to the infinite loop. Initially, I had tried creating a non-inlined function to touch the stack memory. It worked in this case, but still required some undesirable compiler specific assistance. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24851 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com