[issue21369] Extended modes for tarfile.TarFile()

2014-04-27 Thread Lars Gustäbel
Lars Gustäbel added the comment: That was a design decision. What would be the advantage of having the TarFile class offer the compression itself? -- assignee: -> lars.gustaebel ___ Python tracker ___

[issue13583] sqlite3.Row doesn't support slice indexes

2014-04-27 Thread Jessica McKellar
Jessica McKellar added the comment: I've also uploaded a short script that sets up an in-memory sqlite database that fetches Rows, for easy manual testing. -- Added file: http://bugs.python.org/file35071/sqlite3_slicing_demo.py ___ Python tracker

[issue13583] sqlite3.Row doesn't support slice indexes

2014-04-27 Thread Jessica McKellar
Jessica McKellar added the comment: Thanks for the ticket and patch, xapple! I updated the patch to address the compiler warning and use assertEqual. While testing, I noticed that slicing with steps wasn't supported, so I expanded the sqlite3.Row slicing code to support steps, and added some

[issue21026] Document sitecustomize.py problems with pythonw

2014-04-27 Thread Carol Willing
Carol Willing added the comment: Updated documentation using Terry Reedy's suggested addition. -- nosy: +willingc Added file: http://bugs.python.org/file35069/issue21026.patch ___ Python tracker ___

[issue13096] ctypes: segfault with large POINTER type names

2014-04-27 Thread Jessica McKellar
Jessica McKellar added the comment: Thanks for the report and patch, meador.inge. I'd prefer not to add more globals that are only used in one place, but doing so is consistent with the existing style of test_pointers.py, and there's plenty in this file that could be cleaned up in another tick

[issue21340] Possible concurrency bug in asyncio, AttributeError in tasks.py

2014-04-27 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, should have let someone review it. I'm a bit out of practice. :-) But in this case I think three-arg getattr() is better; less code, less indentation, and the final question (is the frame not None?) must still be asked. -- __

[issue19776] Provide expanduser() on Path objects

2014-04-27 Thread Antoine Pietri
Antoine Pietri added the comment: > I think that `absolute` method should call `expanduser` and `expandvars` (do > you plan to include it?) automatically. This should be optional (via default > arguments: `expanduser=True, expandvars=True`. I think it shouldn't. (Or shouldn't be set to True by

[issue13204] sys.flags.__new__ crashes

2014-04-27 Thread Jessica McKellar
Jessica McKellar added the comment: Thanks for reporting this and providing a patch, Trundle. The Python 3 patch didn't apply cleanly anymore, so I regenerated it and added tests for sys.version_info and sys.getwindowsversion. * The patch passes `make patchcheck` * The full test suite passes w

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2014-04-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: > any chance of the easy (_fields) change being committed > and putting off the harder parts until later? Yes, it is not an all-or-nothing exercise. >> 1. _asdict() returns a normal dictionary. I don't know if this is what >>is required. A regular dic

[issue10510] distutils upload/register should use CRLF in HTTP requests

2014-04-27 Thread Ian Cordasco
Ian Cordasco added the comment: I've attached a patch that should fix this issue. Please review and let me know if changes are necessary. -- keywords: +patch Added file: http://bugs.python.org/file35067/compliant_distutils.patch ___ Python tracker <

[issue21371] struct lconv does not have decimal_point on android platform

2014-04-27 Thread Li Zhenhua
New submission from Li Zhenhua: When compile python for android, it gets error because struct lconv does not have a member "decimal_point". -- components: Cross-Build files: lconv_member.patch keywords: patch messages: 217335 nosy: lizhenhua priority: normal severity: normal status: ope

[issue21031] [patch] Add AlpineLinux to the platform module's supported distributions list

2014-04-27 Thread Elizabeth Myers
Elizabeth Myers added the comment: Any information or updates? :) -- status: open -> languishing ___ Python tracker ___ ___ Python-bug

[issue21369] Extended modes for tarfile.TarFile()

2014-04-27 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue21369] Extended modes for tarfile.TarFile()

2014-04-27 Thread Ned Deily
Changes by Ned Deily : -- nosy: +lars.gustaebel ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue5001] Remove assertion-based checking in multiprocessing

2014-04-27 Thread Ned Deily
Changes by Ned Deily : -- nosy: +sbt versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3 ___ Python tracker ___ ___ Python-bugs-l

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread STINNER Victor
STINNER Victor added the comment: > The real use case I envision is with huge powers of two. I'm not sure that it's a common use case, but it can be nice to optimize this case if it doesn't make longobject.c more complex. It looks like calloc() becomes interesting for objects larger than 1 MB.

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-27 Thread STINNER Victor
STINNER Victor added the comment: > We should not overcomplicate this. I suggest that we simply use utf-8 under > the C locale. Please open a new issue if you would prefer UTF-8. You will have to solve different technical issues. I tried to list some of them in issues #19846 and #19847. In s

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Ok, now the real use case where it becomes faster: I implemented the > same optimization for bytearray. The real use case I envision is with huge powers of two. If I write: x = 2 ** 100 then all of x's bytes except the highest one will be zeros. If we

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread STINNER Victor
STINNER Victor added the comment: > Don't hesitate to rerun my benchmark on more different platforms? Oops, I wanted to write ";-)" not "?". -- ___ Python tracker ___ __

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-27 Thread STINNER Victor
STINNER Victor added the comment: > We should not overcomplicate this. I suggest that we simply use utf-8 under > the C locale. Do you mean utf8/strict or utf8/surrogateescape? utf8/strict doesn't work (os.listdir raises an unicode error) if your system is configured to use latin1 (ex: filenam

[issue21368] Check for systemd locale on startup if current locale is set to POSIX

2014-04-27 Thread STINNER Victor
STINNER Victor added the comment: I don't think that Python should read such configuration file. If you consider that something is wrong here, please report the issue to the C library. -- nosy: +haypo ___ Python tracker

[issue21340] Possible concurrency bug in asyncio, AttributeError in tasks.py

2014-04-27 Thread STINNER Victor
STINNER Victor added the comment: Why not using try/except AttributeError? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread STINNER Victor
STINNER Victor added the comment: > Are you sure this is a good platform for performance reports? :) Don't hesitate to rerun my benchmark on more different platforms? -- ___ Python tracker

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Common platform: > Timer: time.perf_counter > Timer info: namespace(adjustable=False, > implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, > resolution=1e-09) > Platform: Linux-3.13.9-200.fc20.x86_64-x86_64-with-fedora-20-Heisenbug

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread STINNER Victor
STINNER Victor added the comment: bench_alloc2.py: updated benchmark script. I added bytes(n) and bytearray(n) tests and removed the test decoding from ASCII. Common platform: Timer: time.perf_counter Timer info: namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', mono

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread STINNER Victor
STINNER Victor added the comment: I splitted my patch into two parts: - calloc-4.patch: add new "Calloc" functions including _PyObject_GC_Calloc() - use_calloc.patch: patch types (bytes, dict, list, set, tuple, etc.) and various modules to use calloc I reverted my changes on _PyObject_GC_Mallo

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file35064/use_calloc.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-04-27 Thread Nikolaus Rath
Nikolaus Rath added the comment: As discussed on python-dev, here is a patch that changes the behavior of send() and sendall() to raise SSLWant* exceptions instead of returning zero. -- Added file: http://bugs.python.org/file35062/issue20951_r2.diff

[issue21370] segfault from simple traceback.format_exc call

2014-04-27 Thread John Rusnak
New submission from John Rusnak: Launch python3.3 and then >>> import traceback >>> tracebacke.format_exc() Seomteims a long trace about missing attribute is produced, on subequent of sometimes first call, python executable segfaults. I see this behavior in an app as well then calling format

[issue21369] Extended modes for tarfile.TarFile()

2014-04-27 Thread Sworddragon
New submission from Sworddragon: tarfile.open() does support optionally an compression method on the mode argument in the form of 'filemode[:compression]' but tarfile.TarFile() does only suport 'a', 'r' and 'w'. Is there a special reason that tarfile.TarFile() doesn't directly support an optio

[issue20265] Bring Windows docs up to date

2014-04-27 Thread Kathleen Weaver
Kathleen Weaver added the comment: Latest update -- Added file: http://bugs.python.org/file35061/mywork.patch ___ Python tracker ___ _

[issue18314] Have os.unlink remove junction points

2014-04-27 Thread Kim Gräsman
Kim Gräsman added the comment: Thanks! At first I suspected 32 vs 64 bit, but the failing bots cover both... One thing that stands out to me as risky is the memcmp() against "\\??\\", which could overrun a short src_path buffer. But I don't think that would fail here. I must have made some m

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-27 Thread Nick Coghlan
Nick Coghlan added the comment: If you can convince Stephen Turnbull that's a good idea, sure. It's probably more likely to be the right thing than "ASCII" or "ASCII + surrogateescape", but in the absence of hard data, he's in a better position than we are to judge the likely impact of that, at l

[issue13330] Attempt full test coverage of LocaleTextCalendar.formatweekday

2014-04-27 Thread Jessica McKellar
Jessica McKellar added the comment: Thanks for working to increase our test coverage, Sean.Fleming! Looking at the current coverage, the there is one line in LocaleTextCalendar.formatweekday without coverage: http://hg.python.org/cpython/file/e159cb0d955b/Lib/calendar.py#l519. You add some ad

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: We should not overcomplicate this. I suggest that we simply use utf-8 under the C locale. -- versions: +Python 3.5 -Python 3.4 ___ Python tracker _

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-27 Thread Nick Coghlan
Nick Coghlan added the comment: Issue 21368 now suggests looking for /etc/locale.conf before falling back to ASCII+surrogateescape. -- ___ Python tracker ___ ___

[issue21362] concurrent.futures does not validate that max_workers is proper

2014-04-27 Thread Charles-François Natali
Changes by Charles-François Natali : -- stage: patch review -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue21368] Check for systemd locale on startup if current locale is set to POSIX

2014-04-27 Thread Nick Coghlan
New submission from Nick Coghlan: Issue 19977 added "surrogateescape" to the fallback settings for the standard streams if Python 3 appears to be running under the POSIX locale (which Python 3 currently reads as setting a default encoding of ASCII, which is almost certainly wrong on any modern

[issue18314] Have os.unlink remove junction points

2014-04-27 Thread Tim Golden
Tim Golden added the comment: Here are a couple: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/4423 http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/8288 -- ___ Python tracker

[issue18314] Have os.unlink remove junction points

2014-04-27 Thread Kim Gräsman
Kim Gräsman added the comment: Thanks for pushing this forward! Do you have links to the failing bots I could take a look at? -- ___ Python tracker ___ _

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: >> Hm... >> What's /proc/sys/vm/overcommit_memory ? >> If it's set to 0, then the kernel will always overcommit. > > Ah, indeed. See above, I mistyped: 0 is the default (which is already quite optimistic), 1 is always. >> If you set it to 2, normally y

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Hm... > What's /proc/sys/vm/overcommit_memory ? > If it's set to 0, then the kernel will always overcommit. Ah, indeed. > If you set it to 2, normally you'd definitely get ENOMEM You're right, but with weird results: $ gcc -o /tmp/test test.c; /tmp/test mal

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: > Hm... > What's /proc/sys/vm/overcommit_memory ? > If it's set to 0, then the kernel will always overcommit. I meant 1 (damn, I need sleep). -- ___ Python tracker __

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: > Both OOM here (3.11.0-20-generic, 64-bit, Ubuntu). Hm... What's /proc/sys/vm/overcommit_memory ? If it's set to 0, then the kernel will always overcommit. If you set it to 2, normally you'd definitely get ENOMEM (which is IMO much nicer than getting

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Stefan Krah
Stefan Krah added the comment: This is probably offtopic, but I think people who want reliable MemoryErrors can use limits, e.g. via djb's softlimit (daemontools): $ softlimit -m 1 ./python Python 3.5.0a0 (default:462470859e57+, Apr 27 2014, 19:34:06) [GCC 4.7.2] on linux Type "help", "c

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: > $ gcc -o /tmp/test /tmp/test.c; /tmp/test > malloc() returned NULL after 3050MB > $ gcc -DDO_MEMSET -o /tmp/test /tmp/test.c; /tmp/test > malloc() returned NULL after 2130MB > > Without memset, the kernel happily allocates until we reach the 3GB > user address

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: > So yeah, touching pages can affect whether a later malloc returns ENOMEM. > > I'm not sure any of this actually matters in the Python case though :-). > There's still no reason to go touching pages pre-emptively just in case we > might write to them

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: Alright, it bothered me so I wrote a small C testcase (attached), which calls malloc in a loop, and can call memset upon the allocated block right after allocation: $ gcc -o /tmp/test /tmp/test.c; /tmp/test malloc() returned NULL after 3050MB $ gcc -DDO

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Nathaniel Smith
Nathaniel Smith added the comment: Right, python3 -c 'b"x" * (2 ** 48)' does give an instant MemoryError for me. So I was wrong about it being the VM limit indeed. The documentation on this is terrible! But, if I'm reading this right: http://lxr.free-electrons.com/source/mm/util.c#L434 the a

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2014-04-27 Thread Stefan Krah
Stefan Krah added the comment: >> 1. _asdict() returns a normal dictionary. I don't know if this is what >>is required. Good question. I don't think we can import OrderedDict from collections because of the impact on startup time (_collections_abc was created to avoid the issue for MutableMa

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2014-04-27 Thread Nick Coghlan
Nick Coghlan added the comment: Additional environments where the system misreports the encoding to use (courtesy of Armin Ronacher & Graham Dumpleton on Twitter): upstart, Salt, mod_wsgi. Note that for more complex applications (e.g. integrated web UIs, socket servers, sending email), round

[issue5001] Remove assertion-based checking in multiprocessing

2014-04-27 Thread Jessica McKellar
Jessica McKellar added the comment: Thanks for the patches, vladris! I've reviewed the latest version, and it addresses all of Antoine's review feedback. Ezio left some additional feedback (http://bugs.python.org/review/5001/#ps3407) which still needs to be addressed. -- nosy: +jesste

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: Dammit, read: python -c 'b"x" * (2**48)' -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: > And your test.py produces the same result. Are you sure you don't have a > ulimit set on address space? Yep, I'm sure: $ ulimit -v unlimited It's probably due to the exponential over-allocation used by the array (to guarantee amortized constant cos

[issue21340] Possible concurrency bug in asyncio, AttributeError in tasks.py

2014-04-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset d42d3d3f9c41 by Guido van Rossum in branch '3.4': asyncio: Be careful accessing instance variables in __del__ (closes #21340). http://hg.python.org/cpython/rev/d42d3d3f9c41 New changeset 0cb436c6f082 by Guido van Rossum in branch 'default': Merge 3.

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Nathaniel Smith
Nathaniel Smith added the comment: On my laptop (x86-64, Linux 3.13, 12 GB RAM): $ python3 -c "[i for i in range(9)]" zsh: killed python3 -c "[i for i in range(9)]" $ dmesg | tail -n 2 [404714.401901] Out of memory: Kill process 10752 (python3) score 687 or sacrifice child

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Just try python -c "[i for i in > range()]" on a 64-bit machine, I'll bet you'll get a > MemoryError (ENOMEM). Hmm, I get an OOM kill here. -- ___ Python tracker ___

[issue18314] Have os.unlink remove junction points

2014-04-27 Thread Tim Golden
Tim Golden added the comment: Backed out the commits after all the Windows buildbots broke. Need to look further. (No problems on a Win7 or Ubuntu build here). -- ___ Python tracker ___

[issue21305] PEP 466: update os.urandom

2014-04-27 Thread Nick Coghlan
Nick Coghlan added the comment: Yep, it's scary indeed, but such a long lived feature release is a novel situation that may require some adjustments to our risk management. However, we can still decide to defer some of the changes until 2.7.8, even though the notion of backporting them has been

[issue21367] multiprocessing.JoinableQueue requires new kwarg

2014-04-27 Thread Claudiu.Popa
Changes by Claudiu.Popa : -- nosy: +sbt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: > @Charles-François: I think your worries about calloc and overcommit are > unjustified. First, calloc and malloc+memset actually behave the same way > here -- with a large allocation and overcommit enabled, malloc and calloc > will both go ahead and

[issue21367] multiprocessing.JoinableQueue requires new kwarg

2014-04-27 Thread Lee Clemens
Lee Clemens added the comment: Same issue (ctx keyword) occurs with multiprocessing.queues.SimpleQueue -- ___ Python tracker ___ ___ P

[issue21367] multiprocessing.JoinableQueue requires new kwarg

2014-04-27 Thread Lee Clemens
New submission from Lee Clemens: Not mentioned (at least not specifically) in the release notes, multiprocessing.JoinableQueue now requires 'ctx' keyword argument: def __init__(self, maxsize=0, *, ctx): This causes an application calling JoinableQueue() to work with 3.3.2 (my single test) to

[issue18314] Have os.unlink remove junction points

2014-04-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4b97092aa4bd by Tim Golden in branch 'default': Issue #18314 Add NEWS item. http://hg.python.org/cpython/rev/4b97092aa4bd -- ___ Python tracker ___

[issue18314] Have os.unlink remove junction points

2014-04-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 17df50df62c7 by Tim Golden in branch 'default': Issue #18314 os.unlink will now remove junction points on Windows. Patch by Kim Gräsman. http://hg.python.org/cpython/rev/17df50df62c7 -- nosy: +python-dev ___

[issue21362] concurrent.futures does not validate that max_workers is proper

2014-04-27 Thread Claudiu.Popa
Changes by Claudiu.Popa : Added file: http://bugs.python.org/file35058/issue21362_1.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue21364] Documentation Recommends Broken Pattern

2014-04-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Initial introduction is 59cb9c074e09. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue21362] concurrent.futures does not validate that max_workers is proper

2014-04-27 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox stage: -> patch review versions: +Python 3.4 ___ Python tracker ___ ___ Python-bugs-list

[issue21364] Documentation Recommends Broken Pattern

2014-04-27 Thread Florent Xicluna
Changes by Florent Xicluna : -- components: +IO nosy: +benjamin.peterson, flox, hynek, pitrou, stutzbach type: -> behavior versions: +Python 3.3, Python 3.4, Python 3.5 ___ Python tracker _

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: William, thanks for the benchmarks. Unfortunately this type of benchmark depends on the hardware (disk, SSD, emmoey bandwitdh, etc). So I'd suggest, instead of using an hardcoded value, to simply reuse io.DEFAULT_BUFFER_SIZE. That way, if some day we

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Nathaniel Smith
Nathaniel Smith added the comment: @Charles-François: I think your worries about calloc and overcommit are unjustified. First, calloc and malloc+memset actually behave the same way here -- with a large allocation and overcommit enabled, malloc and calloc will both go ahead and return the large

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread STINNER Victor
STINNER Victor added the comment: "Because if a code creates many such objects which basically just do calloc(), on operating systems with memory overommitting (such as Linux), the calloc() allocations will pretty much always succeed, but will segfault when the page is first written to in case of

[issue21305] PEP 466: update os.urandom

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: Like Antoine, I'm really skeptical about the backport: honestly, this change doesn't bring much in a normal application. To run into the number of open file descriptors limit (so the "scalability" aspect), one would need to have *many* concurrent thre

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread STINNER Victor
STINNER Victor added the comment: list: items are allocated in a second memory block. PyList_New() uses memset(0) to set all items to NULL. tuple: header and items are stored in a single structure (PyTupleObject), in a single memory block. PyTuple_New() fills the items will NULL (so write agai

[issue21362] concurrent.futures does not validate that max_workers is proper

2014-04-27 Thread Claudiu.Popa
Claudiu.Popa added the comment: Attached patch with improvements suggested by Charles-François Natali. Thank you for the review. -- Added file: http://bugs.python.org/file35057/issue21362.patch ___ Python tracker

[issue21365] asyncio.Task reference misses the most important fact about it, related info spread around intros and example commentary instead

2014-04-27 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov ___ Python tracker ___ ___ Python-bugs-li

[issue21342] multiprocessing RLock and Lock raise incorrect exceptions when releasing an unlocked lock.

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: Thanks for the patch. That's IMO a good change, but I would only apply it to default, and not backport it. -- nosy: +neologix ___ Python tracker

[issue21363] io.TextIOWrapper always closes wrapped files

2014-04-27 Thread eryksun
eryksun added the comment: It works if you detach the buffer beforehand: >>> import io, sys >>> stdin = sys.stdin >>> stdin.flush() >>> correct_stdin = io.TextIOWrapper(stdin.buffer, 'utf-8') >>> correct_stdin.readline() foobar 'foobar\n' >>> correct_stdin.detach

[issue16104] Compileall script: add option to use multiple cores

2014-04-27 Thread Claudiu.Popa
Changes by Claudiu.Popa : Added file: http://bugs.python.org/file35056/issue16104_11.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue21366] Document that return in finally overwrites prev value

2014-04-27 Thread Jon Brandvein
New submission from Jon Brandvein: def foo(): try: return 1 finally; return 2 print(foo()) # 2 I've seen this peculiar case discussed on a few blogs lately, but was unable to find confirmation that this behavior is defined. In the try/finally section of Doc/reference/com

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: > __libc_calloc() starts with a check on integer overflow. Yes, see my previous message: """ AFAICT, the two arguments are purely historical (it was used when malloc() didn't guarantee suitable alignment, and has the advantage of performing overflow che

[issue21365] asyncio.Task reference misses the most important fact about it, related info spread around intros and example commentary instead

2014-04-27 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Based on discussion https://groups.google.com/forum/#!topic/python-tulip/zfMQIUcIR-0 . That discussion actually questions the grounds of such Task behavior, and points it as a violation of "Explicit is better than implicit" principle, and as inconsistent beh

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread STINNER Victor
STINNER Victor added the comment: "And http://www.eglibc.org/cgi-bin/viewvc.cgi/trunk/libc/malloc/malloc.c?view=markup to check that calloc(nelem, elsize) is implemented as calloc(nelem * elsize)" __libc_calloc() starts with a check on integer overflow. --

[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2014-04-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0c8a7299c7e3 by Tim Golden in branch '2.7': Issue #9291 Add ACKS & NEWS http://hg.python.org/cpython/rev/0c8a7299c7e3 -- ___ Python tracker

[issue21365] asyncio.Task reference misses the most important fact about it, related info spread around intros and example commentary instead

2014-04-27 Thread Paul Sokolovsky
New submission from Paul Sokolovsky: It caused me a big surprise that asyncio.Task object automatically schedules itself in the main loop for execution upon creation (i.e. in constructor). Nowhere in the main reference part of section "18.5.2.4. Task" (https://docs.python.org/3.5/library/async

[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2014-04-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 18cfc2a42772 by Tim Golden in branch '2.7': Issue #9291 Do not attempt to re-encode mimetype data read from registry in ANSI mode. Initial patches by Dmitry Jemerov & Vladimir Iofik http://hg.python.org/cpython/rev/18cfc2a42772 -- nosy: +py

[issue21364] Documentation Recommends Broken Pattern

2014-04-27 Thread Armin Ronacher
New submission from Armin Ronacher: The documentation recommends replacing sys.stdin with a binary stream currently: https://docs.python.org/3/library/sys.html#sys.stdin This sounds like a bad idea because it will break pretty much everything in Python in the process. As example: >>> import

[issue21320] dict() allows keyword expansion with integer keys, e.g. dict(**{5:'v'})

2014-04-27 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with Raymond: this isn't a practical problem worth solving. If it's causing an actual problem, please re-open this issue and give a use case. Thanks. -- nosy: +eric.smith resolution: -> wont fix status: open -> closed _

[issue21349] crash in winreg SetValueEx with memoryview

2014-04-27 Thread Tim Golden
Tim Golden added the comment: Committed. Thanks for the patch. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue21361] Add how to run a single test case to the devguide

2014-04-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6b912c90de72 by Benjamin Peterson in branch 'default': say how to run one test (closes #21361) http://hg.python.org/devguide/rev/6b912c90de72 -- nosy: +python-dev resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue21090] File read silently stops after EIO I/O error

2014-04-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: ivank, if you know some C, perhaps you could write a trivial program that does an fopen() followed by an fread() of 131072 bytes, and see if the fread() errors out. -- ___ Python tracker

[issue21090] File read silently stops after EIO I/O error

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: I'm with Antoine, it's likely a glibc bug. We already had a similar issue with fwrite(): http://bugs.python.org/issue17976 -- nosy: +neologix ___ Python tracker _

[issue16104] Compileall script: add option to use multiple cores

2014-04-27 Thread Claudiu.Popa
Claudiu.Popa added the comment: Add new patch with fixes proposed by Berker Peksag. Thanks for the review. Hopefully, this is the last iteration of this patch. -- Added file: http://bugs.python.org/file35055/issue16104_10.patch ___ Python tracker

[issue21225] io.py: Improve docstrings for classes

2014-04-27 Thread Berker Peksag
Berker Peksag added the comment: Can this be closed? (or needs backport to 2.7? http://hg.python.org/cpython/file/2.7/Lib/io.py#l69) -- nosy: +berker.peksag ___ Python tracker _

[issue16104] Compileall script: add option to use multiple cores

2014-04-27 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: -steven.daprano ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-27 Thread Charles-François Natali
Charles-François Natali added the comment: > It looks like calloc-3.patch is wrong: it modify _PyObject_GC_Malloc() to > fill the newly allocated buffer with zeros, but _PyObject_GC_Malloc() is not > only called by PyType_GenericAlloc(): it is also used by _PyObject_GC_New() > and _PyObject_GC

[issue16104] Compileall script: add option to use multiple cores

2014-04-27 Thread Claudiu.Popa
Claudiu.Popa added the comment: Added a new patch with improvements suggested by Jim. Thanks! I removed the handling of processes=1, because it can still be useful: having a background worker which processes the files received from _walk_dir. Also, it checks that compile_dir receives a positiv

[issue21363] io.TextIOWrapper always closes wrapped files

2014-04-27 Thread Armin Ronacher
New submission from Armin Ronacher: I'm trying to write some code that fixes a misconfigured sys.stdin on a case by case bases but unfortunately I cannot use TextIOWrapper for this because it always closes the underlying file: Python >>> import io >>> sys.stdin.encoding 'ANSI_X3.4-1968' >>>

[issue21362] concurrent.futures does not validate that max_workers is proper

2014-04-27 Thread Claudiu.Popa
Claudiu.Popa added the comment: For instance, multiprocessing behaves like this: >>> multiprocessing.Pool(-1) Traceback (most recent call last): File "", line 1, in File "C:\Python34\lib\multiprocessing\context.py", line 118, in Pool context=self.get_context()) File "C:\Python34\lib\m

[issue21362] concurrent.futures does not validate that max_workers is proper

2014-04-27 Thread Claudiu.Popa
New submission from Claudiu.Popa: Due to some bad math on my side, I passed max_workers=0 to concurrent.futures.ThreadPoolExecutor. This didn't fail properly, but hanged. The same behaviour occurs in ProcessPoolExecutor, but this time it fails internally with something like this: Exception in

  1   2   >