[issue11406] There is no os.listdir() equivalent returning generator instead of list

2014-06-26 Thread Ben Hoyt
Ben Hoyt added the comment: Raymond, there are very compelling timings/benchmarks for this -- not so much the original issue here (generator vs list, that's not really an issue) but having a scandir() function that returns the stat-like info from the OS so you don't need extra

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2014-06-26 Thread Ben Hoyt
Ben Hoyt added the comment: Thanks! Will post the PEP to python-dev in the next day or two. -- ___ Python tracker <http://bugs.python.org/issue11406> ___ ___ Pytho

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2014-06-26 Thread Ben Hoyt
Ben Hoyt added the comment: Nick -- sorry, already posted to python-dev before seeing your latest. However, I think it's the right place, as there's already been a fair bit of hashing this idea and API out on python-ideas first and then also python-dev. See links in the PEP

[issue21926] Bundle C++ compiler with Python on Windows

2014-07-05 Thread Ben Lucato
New submission from Ben Lucato: I am wondering if it is at all on the roadmap to bundle a C compiler with Python on Windows, given that installing libraries with C extensions is very confusing on Windows. For example, to install NumPy on Windows you end up either having to download the right

[issue10551] mimetypes read from the registry should not overwrite standard mime mappings

2014-07-29 Thread Ben Hoyt
Ben Hoyt added the comment: Mark, are you referring to part 3 of this issue, the image/pjpeg type of problem? This was fixed in Python 2.7.6 -- see changeset http://hg.python.org/cpython/rev/e8cead08c556 and http://bugs.python.org/issue15207

[issue21965] Add support for Memory BIO to _ssl

2014-08-05 Thread Ben Darnell
Ben Darnell added the comment: Looks good to me. I've added exarkun and glyph to the nosy list since Twisted's experience with PyOpenSSL may provide useful feedback even though Twisted will presumably stick with what they've got instead of switching to this new interface.

[issue22192] dict_values objects are hashable

2014-08-13 Thread Ben Roberts
New submission from Ben Roberts: In python 3.4 these result in a TypeError: hash({}.keys()) hash({}.items()) But this succeeds: hash({}.values()) The 2.7 backports of these - viewkeys, viewitems, and viewvalues respectively - behave equivalently. See more discussion on StackOverflow

[issue22192] dict_values objects are hashable

2014-08-15 Thread Ben Roberts
Ben Roberts added the comment: I have a patch with tests for this (running the test suite now) but I am increasingly unsure if python isn't doing the right thing already. Intuitively, it "feels" wrong (to me) to allow a dict_values view to be hashable since the mapping onto wh

[issue2527] Pass a namespace to timeit

2014-08-17 Thread Ben Roberts
Changes by Ben Roberts : -- nosy: +roippi ___ Python tracker <http://bugs.python.org/issue2527> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue2527] Pass a namespace to timeit

2014-08-18 Thread Ben Roberts
Ben Roberts added the comment: Attached is a patch that adds a 'global' kwarg to the Timeit constructor, which does pretty much what it says on the tin: specifies a global namespace that exec() will use. I originally had a 'locals' arg as well (to mirror the signature

[issue2527] Pass a namespace to timeit

2014-08-18 Thread Ben Roberts
Ben Roberts added the comment: Correction, the name of the argument is 'globals', not 'global'. -- ___ Python tracker <http://bugs.python.org/issue2527> ___

[issue2527] Pass a namespace to timeit

2014-08-21 Thread Ben Roberts
Ben Roberts added the comment: I did sign one right after I submitted the patch. Takes a few days for the asterisks to propagate I guess :) -- ___ Python tracker <http://bugs.python.org/issue2

[issue2527] Pass a namespace to timeit

2014-08-21 Thread Ben Roberts
Ben Roberts added the comment: Ah yes. New patch improves the docs. -- Added file: http://bugs.python.org/file36432/timeit_global_arg_v2.patch ___ Python tracker <http://bugs.python.org/issue2

[issue2527] Pass a namespace to timeit

2014-08-23 Thread Ben Roberts
Ben Roberts added the comment: Thanks Antoine. Cheers :-) -- ___ Python tracker <http://bugs.python.org/issue2527> ___ ___ Python-bugs-list mailing list Unsub

[issue22291] Typo in docs - Lib/random

2014-08-27 Thread Ben Rodrigue
New submission from Ben Rodrigue: Small typo: In the documentation for the random module. The documentation refers to the semi-open range and then gives an example using a left bracket and then a curved parenthesis on the right. Link to page:https://docs.python.org/3.4/library/random.html

[issue18577] lru_cache enhancement: lru_timestamp helper function

2014-09-03 Thread Ben Hoyt
Ben Hoyt added the comment: I really like this idea (and am needing this functionality), but I don't think this API (or implementation) is very nice: 1) It means you have to change your function signature to use the timeout feature. 2) Specifying the interval in minutes seems odd

[issue22192] dict_values objects are hashable

2014-09-05 Thread Ben Roberts
Ben Roberts added the comment: Going to close this down - implementing rich comparisons for values() does feel like the correct solution... but I don't think it's possible to implement __eq__ in better than nlogn time (and possibly space). So nothing can realistically be

[issue22454] Adding the opposite function of shlex.split()

2014-09-21 Thread Ben Roberts
Ben Roberts added the comment: ' '.join(shlex.quote(x) for x in split_command) -- nosy: +roippi ___ Python tracker <http://bugs.python.org/issue22454> ___ __

[issue22454] Adding the opposite function of shlex.split()

2014-09-21 Thread Ben Roberts
Ben Roberts added the comment: For the record I am on board with a shlex.join. Even though the implementation is simple: - It is not obvious to many users if there are any "gotchas" by doing a ' '.join yourself, /even if/ you know that strings with spaces in them n

[issue19119] duplicate test name in Lib/test/test_heapq.py

2014-09-21 Thread Ben Roberts
Ben Roberts added the comment: > The major issue (there are other issues as well but not so difficult) is > whether nlargest and nsmallest should support iterator that could be endless > iterator or reject it (by checking __len__ attribute) straight away. Well, failing with an except

[issue19119] duplicate test name in Lib/test/test_heapq.py

2014-09-21 Thread Ben Roberts
Ben Roberts added the comment: Attached patch fixes the tests. -- Added file: http://bugs.python.org/file36683/fix_heapq_tests.patch ___ Python tracker <http://bugs.python.org/issue19

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2014-09-30 Thread Ben Hoyt
Ben Hoyt added the comment: Yes, PEP 471 has been accepted, and I've got a mostly-finished C implementation of os.scandir() for CPython 3.5, as well as tests and docs. If you want a sneak preview, see posixmodule_scandir*.c, test/test_scandir.py, and os.rst here: https://github.com/be

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-09-30 Thread Ben Hoyt
New submission from Ben Hoyt: Opening this to track the implementation of PEP 471: os.scandir() [1]. This supercedes Issue #11406 (and possibly others)? The implementation is most of the way there, but not yet done as a CPythono 3.5 patch. Before I have a proper patch, it's availab

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2014-09-30 Thread Ben Hoyt
Ben Hoyt added the comment: Okay, I've opened http://bugs.python.org/issue22524, but I don't have the permissions to close this one, so could someone with bugs.python.org superpowers please do that? -- ___ Python tracker <http://bu

[issue19119] duplicate test name in Lib/test/test_heapq.py

2014-10-03 Thread Ben Roberts
Ben Roberts added the comment: Any thoughts/reviews on the patch? -- ___ Python tracker <http://bugs.python.org/issue19119> ___ ___ Python-bugs-list mailin

[issue19119] duplicate test name in Lib/test/test_heapq.py

2014-10-03 Thread Ben Roberts
Ben Roberts added the comment: That is one approach, of course, but imo pretty incomplete. A test that is named "test_get_only" presumably would be expected to test __getitem__, not __cmp__. Confusingly there is still a GetOnly item declared in the module, but it is not used.

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-06 Thread Ben Hoyt
Ben Hoyt added the comment: Attaching my first patch here. It includes docs, the implementation of scandir and DirEntry in posixmodule.c, and tests in test_scandir.py. It does not yet include the changes for os.walk() to use scandir; I'm hoping to do that in a separate patch for easier

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-08 Thread Ben Hoyt
Ben Hoyt added the comment: Thanks for the initial response and code review, Victor. I'll take a look and respond further in the next few days. In the meantime, however, I'm definitely open to splitting scandir out into its own C file. This will mean a little refactoring (m

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-08 Thread Ben Hoyt
Ben Hoyt added the comment: Here are the actual numbers (instead of just from memory) running on my Windows laptop, which happens to have an SSD drive, so os.walk() with scandir is particularly good here. python 3.4: benchmark.py -c python (all implemented in Python using ctypes): os.walk

[issue20353] Hanging bug with multiprocessing + sqlite3 + tkinter (OS X 10.9 only)

2014-01-22 Thread Ben Alpert
Changes by Ben Alpert : -- nosy: +spicyj ___ Python tracker <http://bugs.python.org/issue20353> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6689] subprocess doesn't pass arguments correctly on Linux when shell=True

2009-08-12 Thread Ben Hoyt
Changes by Ben Hoyt : -- nosy: +benhoyt type: behavior -> feature request ___ Python tracker <http://bugs.python.org/issue6689> ___ ___ Python-bugs-list mai

[issue6689] subprocess doesn't pass arguments correctly on Linux when shell=True

2009-08-12 Thread Ben Hoyt
Ben Hoyt added the comment: Oops, didn't intend to change the type, changing back. -- type: feature request -> behavior ___ Python tracker <http://bugs.python.or

[issue6990] threading.local subclasses don't cleanup their state and it gets recycled

2009-09-24 Thread Ben Bangert
Changes by Ben Bangert : -- nosy: +bbangert ___ Python tracker <http://bugs.python.org/issue6990> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7337] Add lossy queue to queue library module

2009-11-17 Thread Ben Bass
New submission from Ben Bass : Many applications would benefit from 'connectionless' queues, i.e. they don't want to care whether anything is reading from the other end. Using current queue module classes this is not practical, because there is a choice between unbounded mem

[issue7337] Add lossy queue to queue library module

2009-11-18 Thread Ben Bass
Ben Bass added the comment: 'connectionless' is from how I see it as an analogy with UDP (vs TCP); why not just use a deque is primarily about having the same API - a client (getter) of the queue shouldn't know or care whether it is a 'lossy' queue or a normal queue

[issue6683] smtplib authentication - try all mechanisms

2009-11-24 Thread Ben Standefer
Ben Standefer added the comment: Here is one work-around. The default smtplib.SMTP.login() doesn't work for StrongMail out of the box. http://www.harelmalka.com/?p=94&cpage=1 -- nosy: +aguynamedben ___ Python tracker <http://bug

[issue7507] pipes.quote does not correctly escape !

2009-12-14 Thread Ben Gertzfield
New submission from Ben Gertzfield : The undocumented (but unit tested!) pipes.quote does not correctly escape '!', which cannot be passed to the shell outside of single- quotes: sh-3.2$ python Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) [GCC 4.2.1 (Apple Inc. build 5646)] on d

[issue7580] distutils makefile from python.org installer doesn't work on OS X Snow Leopard

2009-12-26 Thread Ben Kaplan
New submission from Ben Kaplan : Comes from this thread on comp.lang.python: http://groups.google.com/group/comp.lang.python/browse_thread/thread/e15915df2e9cdd9/ The Makefile for distutils in the Mac binary for Python 3.1 specifies the use of the OS X 10.4u SDK. However, XCode only includes

[issue7580] distutils makefile from python.org installer doesn't work on OS X Snow Leopard

2009-12-27 Thread Ben Kaplan
Ben Kaplan added the comment: The issue here isn't with Macports (which doesn't do a universal build by default). It's with the installer on python.org which is also a universal binary. Macports has the advantage of knowing which OS version it's being compiled on so it s

[issue1351020] PythonD DJGPP-specific patch set for porting to DOS.

2009-03-20 Thread Ben Decker
Ben Decker added the comment: Our next target will probably be somewhere with Python 3 -- components: +Interpreter Core -None versions: +Python 3.1 -Python 2.4 ___ Python tracker <http://bugs.python.org/issue1351

[issue5821] Documentation: mention 'close' and iteration for tarfile.TarFile.extractfile()

2009-04-23 Thread Ben North
New submission from Ben North : The current documentation for tarfile.TarFile.extractfile() does not mention that the returned 'file-like object' supports close() and also iteration. The attached patch (against svn trunk) fixes this. (Background: I was wondering whether I could wr

[issue1555842] email package and Unicode strings handling

2009-05-01 Thread Ben Gamari
Changes by Ben Gamari : -- nosy: +bgamari ___ Python tracker <http://bugs.python.org/issue1555842> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1685453] email package should work better with unicode

2009-05-01 Thread Ben Gamari
Changes by Ben Gamari : -- nosy: +bgamari ___ Python tracker <http://bugs.python.org/issue1685453> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1368247] unicode in email.MIMEText and email/Charset.py

2009-05-05 Thread Ben Gamari
Ben Gamari added the comment: What is the status of this? -- nosy: +bgamari ___ Python tracker <http://bugs.python.org/issue1368247> ___ ___ Python-bugs-list m

[issue4487] Add utf8 alias for email charsets

2009-05-05 Thread Ben Gamari
Ben Gamari added the comment: Has this patch been merged yet? -- nosy: +bgamari ___ Python tracker <http://bugs.python.org/issue4487> ___ ___ Python-bugs-list m

[issue1564508] RFC 2965 BaseCookie does not support "$Port"

2009-05-27 Thread Ben Anhalt
Ben Anhalt added the comment: Actually, I was just bit by this. In fact, RFC 2965 prohibits clients from sending $Port if the port attribute was not included in the Set-Cookie header. But, it turns out that the mono System.Net library (at least) will add the attribute any time the URI includes

[issue1564508] RFC 2965 BaseCookie does not support "$Port"

2009-05-27 Thread Ben Anhalt
Ben Anhalt added the comment: Grrr, the link in my last comment should have been http://www.nabble.com/System.Net.CookieContainer-adding-inappropriate-%24Port-attribute-to-cookies--td23752882ef1367.html Yuck. -- ___ Python tracker <h

[issue19240] iglob should try to use `readdir`

2017-02-07 Thread Ben Longbons
Ben Longbons added the comment: This is a duplicate of bug 25596, which is now fixed. -- nosy: +o11c ___ Python tracker <http://bugs.python.org/issue19

[issue29475] option to not follow symlinks when globbing

2017-02-07 Thread Ben Longbons
New submission from Ben Longbons: Background: I have a data hierarchy with a lot of "sibling" symlinked directories/files. I want to glob only the non-symlink files, because it's a *huge* performance increase. Before `os.scandir`, I was using a local copy of `glob.

[issue29549] Improve docstring for str.index

2017-02-17 Thread Ben Hoyt
Ben Hoyt added the comment: Good call. Additionally, it's weird to me that the docstring for str.find() says "Return -1 on failure." because the string not being found is not a "failure". Like the docs (https://docs.python.org/3.5/library/stdtypes.html#str.find) say,

[issue29540] Add compact=True flag to json.dump/dumps

2017-02-17 Thread Ben Hoyt
Ben Hoyt added the comment: I agree with the confusion (PR proposes separators=COMPACT, issue compact=True). I like the concept but not either of the APIs proposed. I *much* more often want to get pretty output -- if I had a dime for every time I've written "json.dumps(obj, sort

[issue28609] argparse claims '*' positional argument is required in error output

2017-02-27 Thread Ben Hoyt
Changes by Ben Hoyt : -- nosy: +benhoyt ___ Python tracker <http://bugs.python.org/issue28609> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28609] argparse claims '*' positional argument is required in error output

2017-02-27 Thread Ben Hoyt
Ben Hoyt added the comment: I definitely agree with Reuben here -- I just ran into this issue while creating a "production quality" tool, and the help message produced by argparse with nargs='*' confused me too. It's pretty clear that this is a simple bug in argp

[issue27043] Describe what ‘inspect.cleandoc’ does to synopsis line.

2016-05-27 Thread Ben Finney
Ben Finney added the comment: On 27-May-2016, Nathan Harold wrote: > > Split version (cleandoc2.patch): > >Clean up indentation from docstrings that are indented to line up >with blocks of code. > >All leading whitespace is removed from the first l

[issue27155] '-' sign typo in example

2016-05-29 Thread Ben Kane
New submission from Ben Kane: On page https://docs.python.org/3/library/subprocess.html#replacing-os-system it looks like the code in the realistic example has a spurious '-' sign. The line: print("Child was terminated by signal", -retcode, file=sys.stderr) shou

[issue27155] '-' sign typo in example

2016-05-30 Thread Ben Kane
Ben Kane added the comment: https://docs.python.org/3/library/subprocess.html#subprocess.Popen.returncode does mention the negativeness about returncode in conjunction with POSIX signals. It would be helpful to mention this Python-specific (I think) behavior in a comment. However, returncode

[issue27719] Misleading note about "args" attribute in "User-defined Exceptions" section of tutorial

2016-08-09 Thread Ben Hoyt
New submission from Ben Hoyt: In the official tutorial in the "User-defined Exceptions" section (https://docs.python.org/3.5/tutorial/errors.html#user-defined-exceptions) there's a note about a user-defined Exception subclass as follows: "In this example, the default __i

[issue27719] Misleading note about "args" attribute in "User-defined Exceptions" section of tutorial

2016-08-09 Thread Ben Hoyt
Ben Hoyt added the comment: Note that I added the committers from issue 1692335 to the Nosy List -- probably overzealous and probably not the folks who maintain the docs, but oh well. :-) -- ___ Python tracker <http://bugs.python.org/issue27

[issue27719] Misleading note about "args" attribute in "User-defined Exceptions" section of tutorial

2016-08-10 Thread Ben Hoyt
Ben Hoyt added the comment: Okay, patch attached -- I think it's best to simply remove that sentence. Side note: this is why GitHub is so good -- click edit, remove the sentence, click create pull request (approx time 30 seconds). I've got a new machine since I last did Python devel

[issue27719] Misleading note about "args" attribute in "User-defined Exceptions" section of tutorial

2016-08-11 Thread Ben Hoyt
Ben Hoyt added the comment: Removing that whole example sounds good to me, thanks. -- ___ Python tracker <http://bugs.python.org/issue27719> ___ ___ Python-bug

[issue27772] Refer to actual format string when creating “zero padding” error message

2016-08-15 Thread Ben Finney
New submission from Ben Finney: When using a format specifier with leading zero, the format spec mini-language (as documented at https://docs.python.org/3/library/string.html#format-specification-mini-language>) says: > '=' […] becomes the default when ‘0’ immediately pr

[issue15660] Clarify 0 prefix for width specifier in str.format doc,

2016-08-15 Thread Ben Finney
Ben Finney added the comment: Terry Reedy wrote: > If the spec string is still available, it could be searched and the message > adjusted if '=' is not present. That proposal should be a new issue if > someone wants to push it. Done now, see Issue 27772. --

[issue12916] Add inspect.splitdoc

2016-08-15 Thread Ben Finney
Ben Finney added the comment: Am I right that this: > pydoc doesn't have public API other than its CLI and the help() function. > […] On the other hand, there are already functions related to splitdoc() > in the inspect module […]. > There is no rush to make splitdoc() publi

[issue12014] str.format parses replacement field incorrectly

2013-02-19 Thread Ben Wolfson
Ben Wolfson added the comment: "My own preference is to let this quote from PEP 3101 dominate the behaviour: "The rules for parsing an item key are very simple. If it starts with a digit, then it is treated as a number, otherwise it is used as a string." That means Petri'

[issue17403] Robotparser fails to parse some robots.txt

2013-03-12 Thread Ben Mezger
New submission from Ben Mezger: I am trying to parse Google's robots.txt (http://google.com/robots.txt) and it fails when checking whether I can crawl the url /catalogs/p? (which it's allowed) but it's returning false, according to my question on stackoverflow -> http:/

[issue15207] mimetypes.read_windows_registry() uses the wrong regkey, creates wrong mappings

2013-04-17 Thread Ben Hoyt
Ben Hoyt added the comment: Okay, I'm looking at the diff between mt-tip-noregistry.txt and mt-tip-newregistry.txt, and I've attached a file showing the lines that are *different* between the two, as well as the Apache mime.types value for that file extension. In most cases, noregi

[issue15535] Fix pickling efficiency of named tuples in 2.7.3

2013-04-25 Thread Ben Hoyt
Ben Hoyt added the comment: I just hit this issue in a big way -- would have been nice for this fix to go into Python 2.7.4. :-) It was quite hard to track down (as in, a day or two of debugging :-) because the symptoms didn't point directly to namedtuple. In our setup we pickle/unp

[issue13721] ssl.wrap_socket on a connected but failed connection succeeds and .peer_certificate gives AttributeError

2013-04-27 Thread Ben Darnell
Ben Darnell added the comment: We found a related issue with Tornado: https://github.com/facebook/tornado/pull/750 We call wrap_socket with do_handshake_on_connect=False and then call do_handshake when the socket is ready. If the getpeername call in wrap_socket fails with ENOTCONN because

[issue17864] IDLE won't run

2013-04-28 Thread Ben Read
New submission from Ben Read: I am installing Python 3.31 on a Mac running OS 10.8.2 and have already installed ActiveTCL 8.5.13. When I try and launch IDLE, the icon appears on the dock for a second and then disappears and the application doesn't run. I have already installed both Pytho

[issue17864] IDLE won't run

2013-04-28 Thread Ben Read
Ben Read added the comment: Hi there, I'm launching IDLE from Applications in Finder (double clicking the application file). I've tried doing this while Console is open and the response is: 28/04/2013 21:17:19.271 Dock[167]: no information back from LS about running process Th

[issue17864] IDLE won't run

2013-04-28 Thread Ben Read
Ben Read added the comment: In response to the first command: 3.3.1 (v3.3.1:d9893d13c628, Apr 6 2013, 11:07:11) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] …and the second command: Warning: unable to create user config directory /Users/ben/.idlerc Check path and permissions. Exiting

[issue17864] IDLE won't run

2013-04-29 Thread Ben Read
Ben Read added the comment: I've tried this and it looks like write access is already enabled, but I entered the commands you listed all the same - here's the output: Bens-iMac:~ ben$ cd Bens-iMac:~ ben$ ls -lde drwxr-xr-x 28 temp staff 952 28 Apr 18:46 . Bens-iMac:~ ben$ mkdi

[issue17857] sqlite modules doesn't build with 2.7.4 on Mac OS X 10.4

2013-04-29 Thread Ben Harper
Ben Harper added the comment: This issue, like 14572, is also effecting Python 2.7.4 on CentOS 5. I can confirm the patch fixes this issue on CentOS5. -- nosy: +bharper ___ Python tracker <http://bugs.python.org/issue17

[issue13721] ssl.wrap_socket on a connected but failed connection succeeds and .peer_certificate gives AttributeError

2013-04-29 Thread Ben Darnell
Ben Darnell added the comment: That proposal sounds good to me. I agree that any change here should target 3.4, not backports to older versions. -- ___ Python tracker <http://bugs.python.org/issue13

[issue17864] IDLE won't run

2013-04-30 Thread Ben Read
Ben Read added the comment: Good news - ran the sudo command, entered the password but I could still not make the directory, but I could within Finder - this time without a password. Tried the IDLE application again and it now works. Thank you once again for your help in resolving this

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-02 Thread Ben Hoyt
Ben Hoyt added the comment: Ah, this is great. I definitely like the idea of a generator version of os.listdir(). And I like the name iterdir() -- it fits with iteritems() etc. They've gone in 3.x, of course, but listdir didn't change to an iterator, so... See also Betterwalk,

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-02 Thread Ben Hoyt
Ben Hoyt added the comment: Some folks have asked about benchmarks. I don't know about iterdir() vs listdir() -- I kind of suspect the speed gains there wouldn't be big. However, the reason I'm keen on iterdir_stat() is that I'm seeing it speed up os.walk() by a facto

[issue15535] Fix pickling efficiency of named tuples in 2.7.3

2013-05-03 Thread Ben Hoyt
Ben Hoyt added the comment: 2.7 fix works for me, thanks! Just curious -- why the different fix for 3.3 (addition of __getstate__ instead of removal of __dict__)? -- ___ Python tracker <http://bugs.python.org/issue15

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-03 Thread Ben Hoyt
Ben Hoyt added the comment: Thanks. I thought about that -- but I think I *want* to benchmark it when they're cached, so that we're comparing apples with apples, cached system calls with cached systems calls. The benchmark would almost certainly be a lot "better" (BetterWalk

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-04 Thread Ben Hoyt
Ben Hoyt added the comment: That's right: if we have a separate scandir() that returns (name, stat) tuples, then a plain iterdir() is pretty much unnecessary -- callers just ignore the second stat value if they don't care about it. I'd slightly prefer the name iterdir_stat(),

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread Ben Hoyt
Ben Hoyt added the comment: > I find iterdir_stat() ugly :-) I like the scandir name, which has some > precedent with POSIX. Fair enough. I'm cool with scandir(). > scandir() cannot return (name, stat), because on POSIX, readdir() only > returns d_name and d_type (the type

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread Ben Hoyt
Ben Hoyt added the comment: Yeah, I very much agree with what Nick says -- we really want a way to expose what the platform provides. It's less important (though still the ideal), to expose that in a platform-independent way. Today the only way to get access to opendir/readdir on Linu

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-06 Thread Ben Hoyt
Ben Hoyt added the comment: > A normal "caller" would never expect a stat object to be partially populated: > if a function has a prototype returning a stat object, then I definitely > expect it to be a regular stat object, with all the fields guaranteed by > POSI

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-10 Thread Ben Hoyt
Ben Hoyt added the comment: > Please bring this up on python-dev. Good idea. Thread started: http://mail.python.org/pipermail/python-dev/2013-May/126119.html -- ___ Python tracker <http://bugs.python.org/issu

[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2013-05-21 Thread Ben Darnell
Ben Darnell added the comment: I vote for enabling SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER by default. It can catch mistakes (i.e. failure to check the return value of send) in Python just as easily as in C, but I don't think those mistakes are common enough to be worth the headache of

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-09 Thread Ben Hoyt
Ben Hoyt added the comment: Thanks, Victor and Antone. I'm somewhat surprised at the 2-3x numbers you're seeing, as I was consistently getting 4-5x in the Linux tests I did. But it does depend quite a bit on what file system you're running, what hardware, whether you're

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-09 Thread Ben Hoyt
Ben Hoyt added the comment: I dunno, I'd be happy if you implement this, but it does mean *more* C code, not less. :-) I feel this would be a nice-to-have, but we should get the thing working first, and then do the multiple-OS-calls-in-one optimization. In any case, if you implement th

[issue22630] `concurrent.futures.Future.set_running_or_notify_cancel` does not notify cancel

2014-10-14 Thread Ben Mather
New submission from Ben Mather: The documentation for the `set_running_or_notify_cancel` method on `concurrent.futures.Future` states that it will notify waiting threads and trigger callbacks after the `Future` has been cancelled, however currently this is done immediately by the call to

[issue22630] `concurrent.futures.Future.set_running_or_notify_cancel` does not notify cancel

2014-10-14 Thread Ben Mather
Changes by Ben Mather : Added file: http://bugs.python.org/file36909/change-docs.patch ___ Python tracker <http://bugs.python.org/issue22630> ___ ___ Python-bugs-list m

[issue22630] `concurrent.futures.Future.set_running_or_notify_cancel` does not notify cancel

2014-10-14 Thread Ben Mather
Changes by Ben Mather : Added file: http://bugs.python.org/file36910/change-docs-and-waiters.patch ___ Python tracker <http://bugs.python.org/issue22630> ___ ___ Pytho

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-18 Thread Ben Hoyt
Ben Hoyt added the comment: Attaching updated patch (scandir-2.patch) per Victor's code review here: http://bugs.python.org/review/22524/diff/13005/Modules/posixmodule.c Note that I haven't included test_scandir.py this time, as I haven't made any changes there, and it's

[issue22687] horrible performance of textwrap.wrap() with a long word

2014-10-21 Thread Ben Roberts
Changes by Ben Roberts : -- nosy: +roippi ___ Python tracker <http://bugs.python.org/issue22687> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22729] `wait` and `as_completed` depend on private api

2014-10-25 Thread Ben Mather
New submission from Ben Mather: Adds `remove_done_callback` to `Future` object, removes `_waiters` attribute, and re-implements `wait` and `as_completed` using callbacks. This makes it possible to extend or replace `Future` without having to mimic its private `_waiters` interface. Currently

[issue22630] `concurrent.futures.Future.set_running_or_notify_cancel` does not notify cancel

2014-10-25 Thread Ben Mather
Ben Mather added the comment: Have uploaded patch to re-implement `wait` and `as_completed` using callbacks. See issue 22729. Sorry for sitting on it for so long. -- Added file: http://bugs.python.org/file37017/non-magic-waiters.patch ___ Python

[issue22843] doc error: 6.2.4. Match Objects

2014-11-12 Thread Ben Finney
Ben Finney added the comment: The current wording of the passage “Match objects always have a boolean value of True” implies that the value compares equal to the ‘True’ constant. That implication is incorrect. I disagree with R. David Murray; if we want to say that a value is considered true

[issue21614] Case sensitivity problem in multiprocessing.

2014-11-15 Thread Ben Yelsey
Ben Yelsey added the comment: Hi, could you please list more exact steps to reproduce, e.g. directory/file layout and import statements? -- nosy: +inlinestyle ___ Python tracker <http://bugs.python.org/issue21

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-11-25 Thread Ben Hoyt
Ben Hoyt added the comment: Akira, note the "Using slower ctypes version of scandir" -- this is the older, ctypes implementation of scandir. On Linux, depending on file system etc, that can often be slower. You need to at least be using the "fast C version" in _scandir.c,

[issue21720] "TypeError: Item in ``from list'' not a string" message

2014-12-15 Thread Ben Finney
Ben Finney added the comment: Is there room for a better resolution: fix the API so that Unicode objects are accepted in the ‘fromlist’ items? -- nosy: +bignose ___ Python tracker <http://bugs.python.org/issue21

[issue21720] "TypeError: Item in ``from list'' not a string" message

2014-12-15 Thread Ben Finney
Changes by Ben Finney : ___ Python tracker <http://bugs.python.org/issue21720> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/

[issue23297] ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string

2015-01-21 Thread Ben Finney
New submission from Ben Finney: In `tokenize.detect_encoding` is the following code:: first = read_or_stop() if first.startswith(BOM_UTF8): # … The `read_or_stop` function is defined as:: def read_or_stop(): try: return readline() except

<    1   2   3   4   5   6   >