[issue26200] SETREF adds unnecessary work in some cases

2016-02-11 Thread Stefan Krah
Stefan Krah added the comment: As Serhiy mentioned, I'm really happy with the Py_SETREF() macro and I understand the reasons why it was applied so broadly. But if a module maintainer prefers not to change existing (and correct) code, then that should have priority (also, the existing version

[issue24165] Free list for single-digits ints

2016-02-11 Thread Yury Selivanov
Yury Selivanov added the comment: Best of 5s: -m timeit -s "r = range(10**4)" -- "for i in r: pass" orig: 239 usec my patch: 148 int_free_list_2: 151 int_free_list_multi: 156 -m timeit -s "r = range(10**5)" -- "for i in r: pass" orig: 2.4 msec my patch: 1.47 int_free_list_2: 1.53

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Gustavo Goretkin
Gustavo Goretkin added the comment: It looks like cpython will check to see if O_CLOEXEC is #defined. In my system's /usr/include/sys/fcntl.h #if __DARWIN_C_LEVEL >= 200809L #define O_CLOEXEC 0x100 /* implicitly set FD_CLOEXEC */ #endif --

[issue26323] Add a assert_called() method for mock objects

2016-02-11 Thread Amit Saha
Amit Saha added the comment: Please take a look at the attached patch. -- keywords: +patch Added file: http://bugs.python.org/file41903/issue26323.patch ___ Python tracker

[issue26323] Add a assert_called() method for mock objects

2016-02-11 Thread Amit Saha
Amit Saha added the comment: Fixed the test name -- Added file: http://bugs.python.org/file41904/issue26323.patch ___ Python tracker ___

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Wolfgang Richter
Wolfgang Richter added the comment: Brett thanks for the very quick response. I've inserted my finder as the first element in sys.meta_path. I also overrode the @classmethod find_loader, but it doesn't appear that it's being called. -- ___ Python

tarfile : secure extract?

2016-02-11 Thread Ulli Horlacher
In https://docs.python.org/2/library/tarfile.html there is a warning: Never extract archives from untrusted sources without prior inspection. It is possible that files are created outside of path, e.g. members that have absolute filenames starting with "/" or filenames with two dots "..".

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Wolfgang Richter
Wolfgang Richter added the comment: Sure Brett I'll upload the code separately in an hour or two. I've overridden all the publicly exposed functions (including find_spec). I wanted to initially see if anything was passing through my finder in the first position of the meta_path. --

[issue24165] Free list for single-digits ints

2016-02-11 Thread STINNER Victor
STINNER Victor added the comment: I ran perf.py on long_fl.patch of issue #26341. It looks slower and has no impact on such macro benchmark. ~/bin/taskset_isolated.py time python3 -u perf.py --rigorous ../default/python.orig ../default/python_long_fl # python rev 37bacf3fa1f5 Report on

Re: tarfile : read from a socket?

2016-02-11 Thread Random832
On Thu, Feb 11, 2016, at 11:41, Ulli Horlacher wrote: > When I use: > > for member in taro.getmembers(): > print('extracting "%s"' % member.name) > taro.extract(member) > > I get the error: > > File "/usr/lib/python2.7/tarfile.py", line 556, in seek > raise

[issue26200] SETREF adds unnecessary work in some cases

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

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Gustavo Goretkin
New submission from Gustavo Goretkin: I am on OS X 10.9.5 Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.O_CLOEXEC Traceback (most recent

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Ronald Oussoren
Ronald Oussoren added the comment: The lack of o_cloexec could be caused by the SDK used to build the binary installer. AFAIK _DARWIN_C_LEVEL is set automatically based on the deployment target. Ronald Sent from my iPad > On 11 feb. 2016, at 23:44, STINNER Victor

[issue26292] Raw I/O writelines() broken for non-blocking I/O

2016-02-11 Thread STINNER Victor
Changes by STINNER Victor : -- title: Raw I/O writelines() broken -> Raw I/O writelines() broken for non-blocking I/O ___ Python tracker

[issue26342] Faster bit ops for single-digit positive longs

2016-02-11 Thread STINNER Victor
STINNER Victor added the comment: fast_bits.patch LGTM. But it would be better to have at least two reviews. -- ___ Python tracker ___

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Wolfgang Richter
New submission from Wolfgang Richter: My understanding of `sys.meta_path` is that it is supposed to allow customized loading of Python modules and packages. In fact the `importlib` machinery appears to have support for identifying packages with `__init__` files with non-standard suffixes:

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread STINNER Victor
STINNER Victor added the comment: FYI Python creates non-inheritable file descriptors by default since Python 3.4: PEP 446. See also the PEP 433 which has more information on OS support, especially: https://www.python.org/dev/peps/pep-0433/#atomic-flags -- nosy: +haypo

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +brett.cannon, eric.smith, eric.snow, ncoghlan ___ Python tracker ___

[issue26346] PySequenceMethods documentation missing sq_slice and sq_ass_slice

2016-02-11 Thread Anthony Tuininga
New submission from Anthony Tuininga: These methods are completely missing from the documentation found here: https://docs.python.org/3/c-api/typeobj.html -- assignee: docs@python components: Documentation messages: 260154 nosy: atuining, docs@python priority: normal severity: normal

Re: Storing a big amount of path names

2016-02-11 Thread MRAB
On 2016-02-12 00:31, Paulo da Silva wrote: Hi! What is the best (shortest memory usage) way to store lots of pathnames in memory where: 1. Path names are pathname=(dirname,filename) 2. There many different dirnames but much less than pathnames 3. dirnames have in general many chars The idea

Re: Storing a big amount of path names

2016-02-11 Thread Rob Gaddi
Tim Chase wrote: > On 2016-02-12 00:31, Paulo da Silva wrote: >> What is the best (shortest memory usage) way to store lots of >> pathnames in memory where: >> >> 1. Path names are pathname=(dirname,filename) >> 2. There many different dirnames but much less than pathnames >> 3. dirnames have in

[issue19543] Add -3 warnings for codec convenience method changes

2016-02-11 Thread Nick Coghlan
Nick Coghlan added the comment: I think so - if anyone spots another place a Py3k warning could be usefully emitted, it can be handled as a new issue. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Brett Cannon
Brett Cannon added the comment: I found the problem: you have a bug in your code at line 45 (the first line of WolfPathFinder.find_spec()). When you try and import a top-level package the path will always be None since __path__ doesn't exist for a top-level package. You only end up with a

[issue26347] BoundArguments.apply_defaults doesn't handle empty arguments

2016-02-11 Thread Frederick Wagner
New submission from Frederick Wagner: [First-time contributor, feedback appreciated.] Found and fixed some unexpected behavior in inspect.BoundArguments.apply_defaults. Simplest explanation is the following test that I added: # Make sure a no-args binding still acquires proper

[issue26339] Python rk0.3b1 KeyError: 'config_argparse_rel_path'

2016-02-11 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report, but both rk and configobj are not part of the Python standard library. Please use their issue tracker to report your problem. -- nosy: +berker.peksag resolution: -> not a bug stage: -> resolved status: open -> closed

Re: Storing a big amount of path names

2016-02-11 Thread Chris Angelico
On Fri, Feb 12, 2016 at 2:13 PM, MRAB wrote: > Apart from all of the other answers that have been given: > p1 = 'foo/bar' p2 = 'foo/bar' id(p1), id(p2) > (982008930176, 982008930120) d = {} id(d.setdefault(p1, p1)) > 982008930176

[issue26180] multiprocessing.util._afterfork_registry leak in threaded environment

2016-02-11 Thread Ned Deily
Changes by Ned Deily : -- nosy: +davin ___ Python tracker ___ ___ Python-bugs-list mailing

[issue26347] BoundArguments.apply_defaults doesn't handle empty arguments

2016-02-11 Thread Martin Panter
Martin Panter added the comment: Patch looks good to me -- nosy: +martin.panter stage: -> patch review ___ Python tracker ___

[issue26346] PySequenceMethods documentation missing sq_slice and sq_ass_slice

2016-02-11 Thread Martin Panter
Martin Panter added the comment: Maybe they are missing because they don’t exist in Python 3 :) Perhaps what is needed instead is a list of the actual fields in order, since I assume Python supports compilers that can’t use the

Re: Storing a big amount of path names

2016-02-11 Thread Paulo da Silva
Às 03:49 de 12-02-2016, Chris Angelico escreveu: > On Fri, Feb 12, 2016 at 2:13 PM, MRAB wrote: >> Apart from all of the other answers that have been given: >> ... > > Simpler to let the language do that for you: > import sys p1 = sys.intern('foo/bar')

Re: Storing a big amount of path names

2016-02-11 Thread Chris Angelico
On Fri, Feb 12, 2016 at 3:15 PM, Paulo da Silva wrote: > Às 03:49 de 12-02-2016, Chris Angelico escreveu: >> On Fri, Feb 12, 2016 at 2:13 PM, MRAB wrote: >>> Apart from all of the other answers that have been given: >>> > ... >> >>

[issue26346] PySequenceMethods documentation missing sq_slice and sq_ass_slice

2016-02-11 Thread Anthony Tuininga
Anthony Tuininga added the comment: Ah yes. The fields are still there, though, just marked as not used. Interestingly enough they aren't documented in the Python 2 documentation eitherand they are in the Python 2.7 headers I have (not marked as unused either). Your suggestion makes

[issue26317] Build Problem with GCC + Macintosh OS X 10.11 El Capitain

2016-02-11 Thread Robert P Fischer
Robert P Fischer added the comment: > The makefiles use CC throughout and don't look at and OBJC variable. Is > that variable a standard way to specify an ObjC compiler in makefiles? I believe that OBJC and OBJCFLAGS are standard for Autoconf/Automake:

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Gustavo Goretkin
Gustavo Goretkin added the comment: Can the documentation be updated accordingly? Currently the documentation (roughly) says that this is available. If not separately noted, all functions that claim “Availability: Unix” are supported on Mac OS X, which builds on a Unix core. os.O_EXLOCK

[issue26253] tarfile in stream mode always set zlib compression level to 9

2016-02-11 Thread Ned Deily
Changes by Ned Deily : -- nosy: +lars.gustaebel ___ Python tracker ___ ___ Python-bugs-list

Re: Storing a big amount of path names

2016-02-11 Thread Paulo da Silva
Às 04:23 de 12-02-2016, Chris Angelico escreveu: > On Fri, Feb 12, 2016 at 3:15 PM, Paulo da Silva > wrote: >> Às 03:49 de 12-02-2016, Chris Angelico escreveu: >>> On Fri, Feb 12, 2016 at 2:13 PM, MRAB wrote: Apart from all of the

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Ned Deily
Ned Deily added the comment: This is only one example of many cases of calls and options that are exposed by the os module but are not available on specific platforms or platform releases. It would be a huge documentation effort to try to identify and keep them all up-to-date. The fourth

Re: Storing a big amount of path names

2016-02-11 Thread Chris Angelico
On Fri, Feb 12, 2016 at 3:45 PM, Paulo da Silva wrote: >> Correct. Two equal strings, passed to sys.intern(), will come back as >> identical strings, which means they use the same memory. You can have >> a million references to the same string and it takes up no

Re: Handling transactions in Python DBI module

2016-02-11 Thread Israel Brewster
On Feb 10, 2016, at 8:14 PM, Chris Angelico wrote: > > On Thu, Feb 11, 2016 at 4:06 PM, Frank Millman wrote: >> A connection has 2 possible states - 'in transaction', or 'not in >> transaction'. When you create the connection it starts off as 'not'. >> >>

[issue26340] modal dialog with transient method; parent window fails to iconify

2016-02-11 Thread vs
New submission from vs: Consider the following code implementing a custom modal dialog: from Tkinter import * def dialog(): win = Toplevel() Label(win, text='Modal Dialog').pack() win.transient(win.master) win.focus_set() win.grab_set() win.wait_window() root = Tk()

Re: Does anyone here use wxGlade on Linux?

2016-02-11 Thread Frank Miles
On Thu, 11 Feb 2016 14:29:04 +, cl wrote: > I am trying out wxGlade on Linux, version 0.7.1 of wxGlade on xubuntu > 15.10. > > I have already written something using wxPython directly so I have the > basics (of my Python skills and the environment) OK I think. > > I am having a lot of

Re: tarfile : read from a socket?

2016-02-11 Thread Ulli Horlacher
Ulli Horlacher wrote: > With > > taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w|') > > I get no more error. Of course, this is the writing client. Now I have a small problem with the reading client. This code works so far: sfo =

[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: serhiy.storchaka -> georg.brandl ___ Python tracker ___

Re: Handling transactions in Python DBI module

2016-02-11 Thread Israel Brewster
On Feb 10, 2016, at 8:06 PM, Frank Millman wrote: > > "Israel Brewster" wrote in message > news:92d3c964-0323-46ee-b770-b89e7e7e6...@ravnalaska.net... > >> I am working on implementing a Python DB API module, and am hoping I can get >> some help with figuring out the

modifying a standard module? (was: Re: tarfile : read from a socket?)

2016-02-11 Thread Ulli Horlacher
Ulli Horlacher wrote: > This code works so far: > > sfo = sock.makefile('r') > taro = tarfile.open(fileobj=sfo,mode='r|') > taro.extractall(path=edir) > > But it does not writes anything to the terminal to inform the user. > > When I use: > > for

Re: tarfile : read from a socket?

2016-02-11 Thread MRAB
On 2016-02-11 16:41, Ulli Horlacher wrote: Ulli Horlacher wrote: With taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w|') I get no more error. Of course, this is the writing client. Now I have a small problem with the reading client. This code

[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-02-11 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___

[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-02-11 Thread Brett Cannon
Brett Cannon added the comment: You need to temporarily turn on warnings for it to work. For example: with warnings.catch_warnings(): warnings.simplefilter('always') with self.assertWarnsRegex(DeprecationWarning, "reserved keyword"): exec('async = 33') Do notice I used

[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

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

Suggested datatype for getting latest information from log files

2016-02-11 Thread ltomassmail
I have timestamped log files I need to read through and keep track of the most upto date information. For example lets say we had a log file timeStamp,name,marblesHeld,timeNow,timeSinceLastEaten I need to keep track of every 'name' in this table, I don't want duplicate values so if values

Re: Suggested datatype for getting latest information from log files

2016-02-11 Thread jmp
On 02/11/2016 07:07 PM, ltomassm...@gmail.com wrote: I thought a dictionary would be a good idea because of the key restrictions ensuring no duplicates, so the data would always update - However because they are unordered and I need to do some more processing on the data afterwards I'm having

[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I wait only Greg's approving for 3.3. If I'll not get it in a day, I'll > commit the patch for 3.4+. Maybe it was my fault. I made a mistake in Georg's name. -- ___ Python tracker

Re: Cygwin and Python3

2016-02-11 Thread Benoit Izac
Terry Reedy writes: >>> Since Python runs natively in Windows, why are you trying to run it >>> with Cygwin? I'm not implying that you shouldn't, just offhand I don't >>> see a reason for it. >> >> I do it because it's easier to install third party packages, those that >> need

[issue26200] SETREF adds unnecessary work in some cases

2016-02-11 Thread STINNER Victor
STINNER Victor added the comment: Raymond Hettinger: "Most of the SETREFs in the next() functions in the itertools module should also be restored to there former state. They look to have been correct before the change, so there was no improvement, only degradation. Much of that code had

[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-02-11 Thread Georg Brandl
Georg Brandl added the comment: This patch includes int(), float(), complex() operations, as well as _pydecimal. -- Added file: http://bugs.python.org/file41894/numeric_underscores_v3_full.diff ___ Python tracker

[issue25995] os.walk() consumes a lot of file descriptors

2016-02-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: walk_consume_fds_opt1.patch is applied in 3.5 (it is more reliable with the absence of close()) and walk_consume_fds_opt2.patch is applied in 3.6. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

Re: tarfile : read from a socket?

2016-02-11 Thread Peter Otten
Ulli Horlacher wrote: > Ulli Horlacher wrote: > >> With >> >> taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w|') >> >> I get no more error. > > Of course, this is the writing client. > > Now I have a small problem with the reading client. > >

[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-11 Thread Georg Brandl
Georg Brandl added the comment: Backpicked to 3.3. Sorry for the wait. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset b9c8f1c80f47 by Serhiy Storchaka in branch '3.3': Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache. https://hg.python.org/cpython/rev/b9c8f1c80f47 -- ___ Python tracker

[issue20741] Documentation archives should be available also in tar.xz format

2016-02-11 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: georg.brandl -> ___ Python tracker ___ ___

[issue4173] PDF documentation: long verbatim lines are cut off at right hand side

2016-02-11 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: georg.brandl -> ___ Python tracker ___ ___

[issue4145] tabulary entries in PDF documentation

2016-02-11 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: georg.brandl -> ___ Python tracker ___ ___

Re: tarfile : read from a socket?

2016-02-11 Thread Lars Gustäbel
On Thu, Feb 11, 2016 at 04:41:43PM +, Ulli Horlacher wrote: > sfo = sock.makefile('r') > taro = tarfile.open(fileobj=sfo,mode='r|') > taro.extractall(path=edir) What about using an iterator? def myiter(tar): for t in tar: print "extracting", t.name yield t sfo =

[issue20741] Documentation archives should be available also in tar.xz format

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

[issue24668] Deprecate 00000 as a synonym for 0

2016-02-11 Thread Georg Brandl
Georg Brandl added the comment: Closing now. -- status: pending -> closed ___ Python tracker ___ ___

[issue15693] expose glossary link on hover

2016-02-11 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: georg.brandl -> ___ Python tracker ___ ___

Re: Does anyone here use wxGlade on Linux?

2016-02-11 Thread cl
Frank Miles wrote: > On Thu, 11 Feb 2016 14:29:04 +, cl wrote: > > > I am trying out wxGlade on Linux, version 0.7.1 of wxGlade on xubuntu > > 15.10. > > > > I have already written something using wxPython directly so I have the > > basics (of my Python skills and the

Re: Cygwin and Python3

2016-02-11 Thread Benoit Izac
Terry Reedy writes: >>> Since Python runs natively in Windows, why are you trying to run it >>> with Cygwin? I'm not implying that you shouldn't, just offhand I don't >>> see a reason for it. >> >> I do it because it's easier to install third party packages, those that >> need

[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-11 Thread Georg Brandl
Georg Brandl added the comment: Actually I prefer Greg to Gerg, so it's only half bad. :D -- ___ Python tracker ___

Re: Suggested datatype for getting latest information from log files

2016-02-11 Thread ltomassmail
On Thursday, February 11, 2016 at 6:16:35 PM UTC, jmp wrote: > On 02/11/2016 07:07 PM, ltomassm...@gmail.com wrote: > > I thought a dictionary would be a good idea because of the key restrictions > > ensuring no duplicates, so the data would always update - However because > > they are unordered

Re: Suggested datatype for getting latest information from log files

2016-02-11 Thread ltomassmail
On Thursday, February 11, 2016 at 6:16:35 PM UTC, jmp wrote: > On 02/11/2016 07:07 PM, ltomassm...@gmail.com wrote: > > I thought a dictionary would be a good idea because of the key restrictions > > ensuring no duplicates, so the data would always update - However because > > they are unordered

<    1   2