[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: Patch version 3: * pattern_hash() includes isbytes, I also shifted flags by 1 bit to not erase the isbytes bit (FYI maximum value of flags is 256) * pattern_richcompare() avoids calling PyObject_RichCompareBool() if flags or isbytes is different * unit test

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your plan LGTM. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: Ok, let me propose a plan for 3.5, 3.6 and 3.7: * Remove warnings.filters test on Python 3.5 from regrtest * Implement comparison for SRE_Pattern in Python 3.6 and 3.7: issue #28727 I consider that the issue #28727 is a minor enhancement and so is still good

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: > The key is based on (action, message, category, module). I think you should > add item[4] (lineno). Oops, right! -- ___ Python tracker

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread Martin Panter
Martin Panter added the comment: I didn’t really like adding the _add_filter() special handling in the first place, but I went ahead because I couldn’t think of a better way to avoid the problem with reloading the warnings modules. So unless anyone can suggest anything better, I am okay with

Re: What exactly is a python variable?

2016-11-17 Thread Ben Finney
Ned Batchelder writes: > So it's not a bug, and it also is not a feature. It just is. +1 QotW -- \“A free press is one where it's okay to state the conclusion | `\ you're led to by the evidence.” —Bill Moyers | _o__)

Unable to sniff outgoing traffic using raw sockets in python2.7

2016-11-17 Thread Ayush Aggarwal
Hello, Following is my code : #!/usr/bin/python import socket import struct import binascii rawSocket = socket.socket(socket.PF_PACKET,socket.SOCK_RAW,socket.htons(0x0800)) # use 0x0800 for IPv4 packets , 0x0003 is for sniffing all kinds of packets while True: pkt=

[issue28159] Deprecate isdst argument in email.utils.localtime

2016-11-17 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Hi Alexander, Is the idea here to raise deprecation warning starting in 3.6 and remove it by 3.8? Thanks :) -- nosy: +Mariatta ___ Python tracker

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: That is because some datetime classes now define __reduce_ex__ instead of __reduce__ (see issue24773). It has higher priority. -- nosy: +belopolsky, serhiy.storchaka ___ Python tracker

how to simulate the situation in DNA evolution for finding the minimum population needed and minimum samples selected to mating in order to no extinction in any one of original species and new species

2016-11-17 Thread meInvent bbird
how to simulate the situation in DNA evolution for finding the minimum population needed and minimum samples selected to mating in order to no extinction in any one of original species and new species assume mating are randomly selected to become a couple, how to keep species good which means

[issue24764] cgi.FieldStorage can't parse multipart part headers with Content-Length and no filename in Content-Disposition

2016-11-17 Thread Bert JW Regeer
Bert JW Regeer added the comment: I've uploaded a patchset to bug #2 that fixes this issue by fixing make_file, and doesn't cause Python to throw out the content-length information. It also fixes FieldStorage for when you provide it a non-multipart form submission and there is no list in

[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2016-11-17 Thread Bert JW Regeer
Bert JW Regeer added the comment: @berker.peksag: Attached is a patch with a test case that exercises this issue. Code path is that read_single() checks if the length is greater than 0, and then it reads binary, otherwise it reads it as a single line. This fixes make_file so that if

Re: Error in webscraping problem

2016-11-17 Thread Gregory Ewing
stanleydasilv...@gmail.com wrote: I am trying to solve the following problem. Two numbers appear on a website. The user has to enter the gcd (greatest common divisor) and hit the submit button. The catch is that the time limit is far too slow for any human processes -- it must be fully

Re: help on "from deen import *" vs. "import deen"

2016-11-17 Thread Michael Torrie
On 11/17/2016 08:41 PM, jf...@ms4.hinet.net wrote: > The fact that most novices will stumble on Python variable many times > until it becomes his "second nature" proves it's different from the > human language:-) The fact is that most novices don't stumble when dealing with Python variables. The

Re: key and ..

2016-11-17 Thread justin walters
On Thu, Nov 17, 2016 at 7:05 PM, Val Krem via Python-list < python-list@python.org> wrote: > > > Hi all, > Sorry for asking such a basic question butI am trying to merge two > files(file1 and file2) and do some stuff. Merge the two files by the first > column(key). Here is the description of

Re: help on "from deen import *" vs. "import deen"

2016-11-17 Thread jfong
Michael Torrie at 2016/11/18 11:03:12AM wrote: > >> Python's variables are different from other languages, but in an > >> understandable way. > > > > Unfortunately it's also different from human language. > > How so? I don't find this to be true at all. The fact that most novices will stumble

[issue20572] subprocess.Popen.wait() undocumented "endtime" parameter

2016-11-17 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: 1. So, is it ok to remove the endtime parameter now? 2. Can the attached downloadfile.htm be removed? It's a spam. Thanks :) -- nosy: +Mariatta ___ Python tracker

key and ..

2016-11-17 Thread Val Krem via Python-list
Hi all, Sorry for asking such a basic question butI am trying to merge two files(file1 and file2) and do some stuff. Merge the two files by the first column(key). Here is the description of files and what I would like to do. file1 key c1 c2 1 759 939 2 345 154571 3 251 350711 4 3749

Re: help on "from deen import *" vs. "import deen"

2016-11-17 Thread Michael Torrie
On 11/17/2016 07:23 PM, jf...@ms4.hinet.net wrote: >> Python's variables are different from other languages, but in an >> understandable way. > > Unfortunately it's also different from human language. How so? I don't find this to be true at all. --

[issue28723] tkinter, radiobutton, indicatoron=0 has no effect.

2016-11-17 Thread Simon Holland
Simon Holland added the comment: FYI, it seems that the Tk team are unable to use cocoa for this functionality so indicatoron has not worked on OSX for Radiobuttons or Checkbuttons for over 4 years. On 17 November 2016 at 18:21, Simon Holland wrote: > > Simon Holland

Re: help on "from deen import *" vs. "import deen"

2016-11-17 Thread jfong
Michael Torrie at 2016/11/17 11:38:32PM wrote: > Like I said, whether the names you use are appropriate is completely up > to you. But this statement seems to imply you're still not getting it > and still thinking of variables as boxes like they are in other > languages, rather than labels that

Re: help on "from deen import *" vs. "import deen"

2016-11-17 Thread Nathan Ernst
I would also toss in there: never name a script test.py. Causes nothing but trouble, at least in python2. On Nov 17, 2016 8:01 PM, wrote: > Steven D'Aprano at 2016/11/17 4:04:04PM wrote: > > The most important thing you should learn from this thread is: > > > > - avoid

Re: help on "from deen import *" vs. "import deen"

2016-11-17 Thread jfong
Steven D'Aprano at 2016/11/17 4:04:04PM wrote: > The most important thing you should learn from this thread is: > > - avoid using "from module import *" as it is usually more trouble > than it is worth. > > > It is confusing and leads to more problems than it solves. If Python was > being

Re: What exactly is a python variable?

2016-11-17 Thread Ned Batchelder
On Thursday, November 17, 2016 at 8:35:15 PM UTC-5, BartC wrote: > That Py2's dis.dis() accepts a string argument but treats it as compiled > byte-code sounds like a bug. Unless it's a feature. In Python 2, plain-old strings are byte-strings, so there's no way for dis.dis to distinguish between

[issue28728] test_host_resolution in test_socket fails on duplicate assert

2016-11-17 Thread R. David Murray
R. David Murray added the comment: It might be interesting to stick a 'with subtest' in there and see which address is failing to raise. -- nosy: +r.david.murray ___ Python tracker

RE: how to control formatting of a namedtuple in a list

2016-11-17 Thread Boylan, Ross
Actually, >> print(list(foo, bar)) Traceback (most recent call last): File "", line 1, in TypeError: list()

Re: What exactly is a python variable?

2016-11-17 Thread BartC
On 18/11/2016 00:47, Steve D'Aprano wrote: On Fri, 18 Nov 2016 12:19 am, BartC wrote: On 17/11/2016 12:20, Steve D'Aprano wrote: In the most recent versions of Python, dis.dis() will also accept a string: py> dis.dis('y = x + 1') 1 0 LOAD_NAME0 (x)

[issue28728] test_host_resolution in test_socket fails on duplicate assert

2016-11-17 Thread Martin Panter
Martin Panter added the comment: That’s not exactly a duplicate; one is host-by-NAME, the other host-by-ADDR -- nosy: +martin.panter ___ Python tracker

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-17 Thread Jeff Reback
New submission from Jeff Reback: xref to https://github.com/pandas-dev/pandas/issues/14679. pandas has had a cython extension class to datetime.datetime for quite some time. A simple __reduce__ is defined. def __reduce__(self): object_state = self.value, self.freq, self.tzinfo

Re: What exactly is a python variable?

2016-11-17 Thread Chris Angelico
On Fri, Nov 18, 2016 at 11:47 AM, Steve D'Aprano wrote: > You may have missed the bit where I said "In the most recent versions". > Python 2.7 will be interpreting the string "y=x+1" as compiled byte-code, > and disassembling it into junk. > Heh. That's a side benefit

Re: What exactly is a python variable?

2016-11-17 Thread Steve D'Aprano
On Fri, 18 Nov 2016 12:19 am, BartC wrote: > On 17/11/2016 12:20, Steve D'Aprano wrote: >> On Thu, 17 Nov 2016 10:37 pm, BartC wrote: > >>> (I don't know how to disassemble code outside a function, not from >>> inside the same program. Outside it might be: 'python -m dis file.py') > >> In the

Re: Python does not start

2016-11-17 Thread Terry Reedy
On 11/17/2016 2:59 PM, Jelena Tavcar wrote: How do I find stdlib files? Python coded stdlib files are, at least on Windows, in /Lib -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: how to control formatting of a namedtuple in a list

2016-11-17 Thread Ethan Furman
On 11/17/2016 04:09 PM, MRAB wrote: On 2016-11-17 23:49, Boylan, Ross wrote: Thank you; I can confirm that overriding __repr__ makes the list display as I wanted. The decision to use repr inside the list seems very odd, given the context, namely formatting something for display or looking

[issue28729] Exception from sqlite3 adapter masked by sqlite3.InterfaceError

2016-11-17 Thread Julien Palard
Julien Palard added the comment: I missed an occurrence of this "if/else" block, and by changing it, a lot of tests are failing, typically: ```== ERROR: CheckBlob (sqlite3.test.types.SqliteTypeTests)

Re: how to control formatting of a namedtuple in a list

2016-11-17 Thread Ned Batchelder
On Thursday, November 17, 2016 at 6:50:07 PM UTC-5, Boylan, Ross wrote: > Thank you; I can confirm that overriding __repr__ makes the list display as I > wanted. > > The decision to use repr inside the list seems very odd, given the context, > namely formatting something for display or looking

Re: how to control formatting of a namedtuple in a list

2016-11-17 Thread MRAB
On 2016-11-17 23:49, Boylan, Ross wrote: Thank you; I can confirm that overriding __repr__ makes the list display as I wanted. The decision to use repr inside the list seems very odd, given the context, namely formatting something for display or looking for a simple string representation.

[issue28729] Exception from sqlite3 adapter masked by sqlite3.InterfaceError

2016-11-17 Thread Julien Palard
Julien Palard added the comment: Problems looks from `Modules/_sqlite/statement.c`: ``` if (!_need_adapt(current_param)) { adapted = current_param; } else { adapted = pysqlite_microprotocols_adapt(current_param, (PyObject*)_PrepareProtocolType, NULL); if (adapted) {

RE: how to control formatting of a namedtuple in a list

2016-11-17 Thread Boylan, Ross
Thank you; I can confirm that overriding __repr__ makes the list display as I wanted. The decision to use repr inside the list seems very odd, given the context, namely formatting something for display or looking for a simple string representation. It seems more natural to me to use str or,

[issue28673] When using pyro4 with more than 15 threads, python 2.7.12 cores frequently

2016-11-17 Thread Michael Hu
Michael Hu added the comment: Could you please look into the core (attached into this bug) to figure out? This issue does not happen always. We are tight on resource to reproduce this. -- ___ Python tracker

[issue28729] Exception from sqlite3 adapter masked by sqlite3.InterfaceError

2016-11-17 Thread Peter Inglesby
New submission from Peter Inglesby: The following code raises `sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.` when I would expect it to raise `AssertionError: Problem in adapter`. import sqlite3 class Point: def __init__(self, x, y): self.x,

Re: how to control formatting of a namedtuple in a list

2016-11-17 Thread Chris Angelico
On Fri, Nov 18, 2016 at 10:04 AM, Boylan, Ross wrote: > Even after defining custom __str__ and __format__ methods they don't affect > the display of objects when they are in a list. Is there a way to change > that, other than explicitly converting each list element to a

how to control formatting of a namedtuple in a list

2016-11-17 Thread Boylan, Ross
Even after defining custom __str__ and __format__ methods they don't affect the display of objects when they are in a list. Is there a way to change that, other than explicitly converting each list element to a string? The last line of output below shows that when I format the list I get

[issue28724] Add method send_io, recv_io to the socket module.

2016-11-17 Thread Julien Palard
Julien Palard added the comment: Hi, thanks for your contribution! Documentation give examples implementation of your methods: - https://docs.python.org/3/library/socket.html#socket.socket.sendmsg - https://docs.python.org/3/library/socket.html#socket.socket.recvmsg and from here, some

Re: Python does not start

2016-11-17 Thread Joel Goldstick
On Thu, Nov 17, 2016 at 2:59 PM, Jelena Tavcar wrote: > How do I find stdlib files? > Regards > -- > https://mail.python.org/mailman/listinfo/python-list First of all, your subject line doesn't seem related to your body text. Second of all, stdlib is a C thing as I

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-11-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file45526/update_one_slot2-2.7.patch ___ Python tracker ___

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-11-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here are updated patches with tests for 3.x and 2.7. -- components: +Interpreter Core nosy: +serhiy.storchaka stage: -> patch review versions: +Python 2.7, Python 3.5, Python 3.6, Python 3.7 -Python 2.6 Added file:

[issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user

2016-11-17 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: -giampaolo.rodola ___ Python tracker ___ ___

[issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user

2016-11-17 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___

Re: Overlapping co-ordiantes of rectangles fail to print in python

2016-11-17 Thread BartC
On 17/11/2016 14:27, aruns...@gmail.com wrote: I am working with following code in which I am trying to output co ordinates of overlapping rectangles.. However the code fails to output the co ordinates. I am customizing the following code This is the input 1.6 1.2 7.9 3.1 1.2 1.6 3.4 7.2 2.6

python package: financial_life

2016-11-17 Thread martin . pyka
Hi everybody, I recently uploaded a project I am working on for some months. It is called financial_life and the purpose of it is to simulate monetary flows between different accounts (like normal bank accounts, loans etc.). The simulations let you explore different financial strategies and

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread Matthew Barnett
Matthew Barnett added the comment: I hope you make it clear what you mean by 'equal', i.e. that it's comparing the pattern and the flags (AFAICT), so re.compile('(?x)a') != re.compile('(?x) a '). -- ___ Python tracker

modify screen pop up

2016-11-17 Thread John Zayatz via Python-list
when running pycharm the modify setup window keep coming on the screen. I have uninstalled and reinstalled python and pycharm multiple times. Do you have a solution? Thank You" -- https://mail.python.org/mailman/listinfo/python-list

Python does not start

2016-11-17 Thread Jelena Tavcar
How do I find stdlib files? Regards -- https://mail.python.org/mailman/listinfo/python-list

Can signal.alarm be safely cleared in python?

2016-11-17 Thread Pedro Franco de Carvalho
Assume a python program sets a handler function for the `signal.SIGALRM` signal, and then schedules an alarm in T seconds with `signal.alarm(T)`. Assume the program later cancels any scheduled alarm with `signal.alarm(0)`. Can the program safely assume that after the call to `signal.alarm(0)`

[issue25008] Deprecate smtpd (based on deprecated asyncore/asynchat): write a new smtp server with asyncio

2016-11-17 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___

[issue25002] Deprecate asyncore/asynchat

2016-11-17 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___

Re: Overlapping co-ordiantes of rectangles fail to print in python

2016-11-17 Thread Peter Pearson
On Thu, 17 Nov 2016 06:27:49 -0800 (PST), aruns...@gmail.com wrote: > I am working with following code in which I am trying to output co > ordinates of overlapping rectangles.. However the code fails to > output the co ordinates. I am customizing the following code [about 100 lines of code

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett ___ Python tracker ___

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added comments on Rietveld. -- nosy: +serhiy.storchaka stage: -> patch review ___ Python tracker ___

[issue28728] test_host_resolution in test_socket fails on duplicate assert

2016-11-17 Thread SilentGhost
New submission from SilentGhost: Commit 540a9c69c2ea introduced double assertRaises which now is failing on ubuntu 16.10 If it is necessary, then it's not obvious why and there is no comment, but here is the one-line patch that removes the duplicated line and makes the test pass for me.

Re: Access to the caller's globals, not your own

2016-11-17 Thread Rob Gaddi
Steven D'Aprano wrote: > On Thursday 17 November 2016 04:52, Rob Gaddi wrote: > >>> import library >>> result = library.make_spam(arg) >>> >>> >>> versus: >>> >>> import library >>> make_spam = library.make_library() >>> result = make_spam(arg) >>> >>> What a drag. >>> >>> >> >> And there you

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Xiang Zhang
Xiang Zhang added the comment: > Your patch looks to be introducing a number of changes to the structure of > the data being passed around between threads and even monitored/indirectly > shared across processes. That's why I say even myself don't like it. To solve an edge case some long

Re: What exactly is a python variable?

2016-11-17 Thread Terry Reedy
On 11/17/2016 12:40 AM, Veek M wrote: In C: int x = 10; results in storage being allocated and type and location are fixed for the life of the program. In Python, x = 10 causes an object '10' to be created but how exactly is 'x' handled? Symbol Table lookup at compile time? Modules and class

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Davin Potts
Davin Potts added the comment: @xiang.zhang: Your patch looks to be introducing a number of changes to the structure of the data being passed around between threads and even monitored/indirectly shared across processes. It's looking increasingly high risk to me. We already have logic for

[issue28708] Low FD_SETSIZE limit on Windows

2016-11-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: > To implement an efficient event loop, IOCP is the way to do: the asyncio > module supports it using ProactorEventLoop. Not everyone uses asyncio, though, so it would still be nice to see the select() limit raised anyway. Implementing your own event loop

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: > Ten subtest in test_re fail with: TypeError: unhashable type: > '_sre.SRE_Pattern' Oops, right. Updated patch implements also hash() on patterns. -- Added file: http://bugs.python.org/file45523/pattern_compare-2.patch

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Xiang Zhang
Xiang Zhang added the comment: Here is a patch which is just a try. I don't quite like the implementation but I can not figure out a better solution. The examples in this one and #28696 seems to work and no test fails currently. -- Added file:

Re: How to test for type or instance of dict_values?

2016-11-17 Thread Terry Reedy
On 11/17/2016 9:57 AM, Thorsten Kampe wrote: The code in question is part of an attempt to get the dimensions of multi-dimensional lists, the `isinstance` is there in order to exclude strings. You can do the exclusion directly. """ def dim(seq): dimension = [] while isinstance(seq,

[issue28725] Awaiting an awaitable returned from an async function does nothing

2016-11-17 Thread Yury Selivanov
Yury Selivanov added the comment: This isn't a bug. Python doesn't magically unwind awaitables, you have to do that yourself: async def two(): await (await one()) Broadly speaking, returning awaitables from coroutines is an anti-pattern. Closing this one. Feel free to re-open or ask

[issue28726] py.exe launches wrong version

2016-11-17 Thread Pravic Ehysta
Pravic Ehysta added the comment: Well, I deleted outdated registry keys, now it works fine. Thanks for helping and I am going to close this issue since it isn't a bug. -- resolution: -> not a bug status: open -> closed ___ Python tracker

[issue28726] py.exe launches wrong version

2016-11-17 Thread Steve Dower
Steve Dower added the comment: Were Python 3.5 and 3.4 installed into the same location? That would explain some of the problems. It looks like it's finding it from the 3.4 key and then skipping the 3.5 key because the path is the same - hence "py -3.5" doesn't find it. Also, we apparently

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread SilentGhost
SilentGhost added the comment: Ten subtest in test_re fail with TypeError: unhashable type: '_sre.SRE_Pattern' -- nosy: +SilentGhost ___ Python tracker

[issue28726] py.exe launches wrong version

2016-11-17 Thread Pravic Ehysta
Pravic Ehysta added the comment: d:\>py -3.5 launcher build: 32bit launcher executable: Console File 'C:\Users\owle\AppData\Local\py.ini' non-existent File 'C:\Windows\py.ini' non-existent Called with command line: -3.5 locating Pythons in 64bit registry locate_pythons_for_key:

Re: What exactly is a python variable?

2016-11-17 Thread Anton Mamaenko
Just a couple of days ago I was asking myself a similar question, and found this blog article: https://jeffknupp.com/blog/2013/02/14/drastically-improve-your-python-understanding-pythons-execution-model/ Clarified a lot of things to me. , Anton > On 17 Nov 2016, at 16:19, BartC

[issue26941] android: test_threading hangs on armv7

2016-11-17 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- stage: patch review -> commit review ___ Python tracker ___

[issue26940] android: test_importlib hangs on armv7

2016-11-17 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- stage: patch review -> commit review ___ Python tracker ___

[issue26939] android: test_functools hangs on armv7

2016-11-17 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- stage: patch review -> commit review ___ Python tracker ___

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: FYI Python 2.7 is not impacted by this bug because it seems like reimporting warnings.py twice gets a new fresh list from _warnings.filters. I don't undertand how/why. -- versions: +Python 3.5, Python 3.6 ___

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: > * Fix warnings._add_filter() to implement a custom comparator operator for > regular expression objects: compare pattern and flags Attached patch warnings_key.patch implements this. I really dislike the patch :-( -- keywords: +patch Added file:

[issue28726] py.exe launches wrong version

2016-11-17 Thread Steve Dower
Steve Dower added the comment: Can you do "set PYLAUNCH_DEBUG=1" and then run "py -3.4" again and paste the full output? Also, is there anything unusual about how you installed Python? Did you customize any settings? -- ___ Python tracker

[issue28726] py.exe launches wrong version

2016-11-17 Thread Pravic Ehysta
New submission from Pravic Ehysta: d:\>py -3.5 Requested Python version (3.5) not installed d:\>py -3.3 Requested Python version (3.3) not installed d:\>py -3.4 Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits"

[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-17 Thread Eryk Sun
Eryk Sun added the comment: Thanks, Serihy. When I looked at this previously, I mistakenly assumed that any undefined codes would be decoded using the codepage's default Unicode character. But for single-byte codepages in the range above 0x9F, Windows instead maps undefined codes to the

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: > * Implement comparision in _sre.SRE_Pattern I wrote a patch and opened the issue #28727: "Implement comparison (x==y and x!=y) for _sre.SRE_Pattern". -- ___ Python tracker

[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread STINNER Victor
New submission from STINNER Victor: Attached patch implements rich comparison for _sre.SRE_Pattern objects created by re.compile(). Comparison between patterns is used in the warnings module to not add duplicated filters, see issue #18383: New changeset f57f4e33ba5e by Martin Panter in

[issue28725] Awaiting an awaitable returned from an async function does nothing

2016-11-17 Thread Gavin Panella
New submission from Gavin Panella: The following will sleep: async def one(): await asyncio.sleep(10) async def two(): await one() loop.run_until_complete(two()) but the following will not: async def one(): return asyncio.sleep(10) async def two(): await

Re: help on "from deen import *" vs. "import deen"

2016-11-17 Thread Michael Torrie
On 11/16/2016 07:01 PM, jf...@ms4.hinet.net wrote: > Michael Torrie at 2016/11/16 11:15:11AM wrote: >> ... The globals object is a dictionary and is itself mutable. But >> when we assign a new object to a particular dictionary key, it >> tosses out the old reference and makes the key now refer to

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: Hum, this issue is a regression caused by the issue #23839. The environment warning was already fixed by the issue #18383 (duplicate: issue #26742): New changeset f57f4e33ba5e by Martin Panter in branch '3.5': Issue #18383: Avoid adding duplicate filters when

[issue28724] Add method send_io, recv_io to the socket module.

2016-11-17 Thread Shinya Okano
New submission from Shinya Okano: This patch makes it easy to pass file descriptor in using AF_UNIX. Ruby language libraries have such methods. see slso: - https://docs.ruby-lang.org/en/2.3.0/UNIXSocket.html#method-i-send_io -- components: Library (Lib) files:

Re: How to test for type or instance of dict_values?

2016-11-17 Thread Thorsten Kampe
* Peter Otten (Thu, 17 Nov 2016 13:38:26 +0100) > > Thorsten Kampe wrote: > > > How can I test for type or instance of dictviews like dict_values? > > Why do you want to? Thanks, for the `collections.abc.ValuesView` tip. The code in question is part of an attempt to get the dimensions of

Re: Error in webscraping problem

2016-11-17 Thread Chris Angelico
On Thu, Nov 17, 2016 at 10:55 python-ideas PM, wrote: > I am trying to solve the following problem. Two numbers appear on a website. > The user has to enter the gcd (greatest common divisor) and hit the > submit button. The catch is that

Overlapping co-ordiantes of rectangles fail to print in python

2016-11-17 Thread arunsocs
I am working with following code in which I am trying to output co ordinates of overlapping rectangles.. However the code fails to output the co ordinates. I am customizing the following code This is the input 1.6 1.2 7.9 3.1 1.2 1.6 3.4 7.2 2.6 11.6 6.8 14.0 9.6 1.2 11.4 7.5 9.6 1.7 14.1 2.8

Re: Access to the caller's globals, not your own

2016-11-17 Thread MRAB
On 2016-11-17 05:40, Dan Sommers wrote: On Thu, 17 Nov 2016 16:17:51 +1100, Steven D'Aprano wrote: ... factory functions are great. But I'm saying that as the writer of the library, not the user of the library. Can you imagine expecting users to do this? from math import trig sin =

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Xiang Zhang
Xiang Zhang added the comment: What's more, this case seems non-reentrant. Since there is no task in this case, the job id is always 0 which is not true. This means after the first time, we can not set even the exception. -- ___ Python tracker

Re: What exactly is a python variable?

2016-11-17 Thread BartC
On 17/11/2016 12:20, Steve D'Aprano wrote: On Thu, 17 Nov 2016 10:37 pm, BartC wrote: (I don't know how to disassemble code outside a function, not from inside the same program. Outside it might be: 'python -m dis file.py') In the most recent versions of Python, dis.dis() will also accept

[issue27945] Various segfaults with dict

2016-11-17 Thread INADA Naoki
INADA Naoki added the comment: I modified the patch to avoid incref when pair is not list, because tuple is common for such case. But I can't get back original performance. (python 2.7 is modified version of patch) inada-n@test1:~/work/bench$ ~/local/py27/bin/master -m perf timeit --rigorous

[issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user

2016-11-17 Thread Xavier de Gaye
Xavier de Gaye added the comment: With this patch, test_asyncio runs successfully with no ResourceWarning when run on the android-24 emulator. -- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file45518/test_asyncio_bind.patch

Re: How to test for type or instance of dict_values?

2016-11-17 Thread Peter Otten
Thorsten Kampe wrote: > How can I test for type or instance of dictviews like dict_values? Why do you want to? > `isinstance({}.values, dict_values)` gives > `NameError: name 'dict_values' is not defined` You can "fix" this with >>> dict_values = type({}.values()) or, depending on the use

[issue27945] Various segfaults with dict

2016-11-17 Thread INADA Naoki
INADA Naoki added the comment: I'm sorry, dict.fromkeys() didn't use PyDict_MergeFromSeq2(). This may be microbench for worst case: $ ~/local/py35/bin/master -m perf timeit --rigorous --python ~/local/py35/bin/patched --compare-to ~/local/py35/bin/master -s 'L = [(i,i) for i in

[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-11-17 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: Here's a retelling of this bug report as a silly fantasy saga: https://engineering.mongodb.com/post/the-saga-of-concurrent-dns-in-python-and-the-defeat-of-the-wicked-mutex-troll/ -- ___ Python tracker

[issue27945] Various segfaults with dict

2016-11-17 Thread INADA Naoki
INADA Naoki added the comment: Only patch which affects to hot loop is: --- a/Objects/dictobject.c Tue Nov 15 21:21:35 2016 -0500 +++ b/Objects/dictobject.c Wed Nov 16 11:40:51 2016 + @@ -1550,11 +1550,18 @@ PyDict_MergeFromSeq2(PyObject *d, PyObje /* Update/merge with

  1   2   >