[issue17366] os.chdir win32

2013-03-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The backslash \ has a special meaning in strings: \n is the new line character, and \t is the tab character: http://docs.python.org/2/reference/lexical_analysis.html#string-literals Try to print the string! You could use \\, or raw strings rlike this.

[issue15244] Support for opening files with FILE_SHARE_DELETE on Windows

2013-03-06 Thread Piotr Dobrogost
Changes by Piotr Dobrogost p...@bugs.python.dobrogost.net: -- nosy: +piotr.dobrogost ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15244 ___ ___

[issue17367] subprocess deadlock when read() is interrupted

2013-03-06 Thread John Szakmeister
New submission from John Szakmeister: I discovered this issue while trying to track down why our upcoming release for Nose 1.3.0 was deadlocking under Ubuntu 12.04 with Python 3.3. It turns out that the read() was being interrupted leaving data in the subprocess's output buffers, which

[issue16754] Incorrect shared library extension on linux

2013-03-06 Thread Bohuslav Slavek Kabrda
Changes by Bohuslav Slavek Kabrda bkab...@redhat.com: -- nosy: +bkabrda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16754 ___ ___

[issue17367] subprocess deadlock when read() is interrupted

2013-03-06 Thread Richard Oudkerk
Richard Oudkerk added the comment: The change in your patch is in a Windows-only section -- a few lines before the chunk you can see _winapi.GetExitCodeProcess(). Since read() on Windows never fails with EINTR there is no need for _eintr_retry_call(). If you are using Linux then there must

[issue17367] subprocess deadlock when read() is interrupted

2013-03-06 Thread Richard Oudkerk
Richard Oudkerk added the comment: BTW, on threads are only used on Windows. On Unix select() or poll() is used. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17367 ___

[issue3329] API for setting the memory allocator used by Python

2013-03-06 Thread STINNER Victor
STINNER Victor added the comment: I attached a patch that I wrote for Wyplay: py_setallocators.patch. The patch adds two functions: PyAPI_FUNC(int) Py_GetAllocators( char api, void* (**malloc_p) (size_t), void* (**realloc_p) (void*, size_t), void (**free_p) (void*) );

[issue3329] API for setting the memory allocator used by Python

2013-03-06 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3329 ___

[issue17367] subprocess deadlock when read() is interrupted

2013-03-06 Thread John Szakmeister
John Szakmeister added the comment: Good grief... how did I miss that. The problem has been flaky for me to induce. I'll take a closer look at the correct section. Thank you Richard. -- ___ Python tracker rep...@bugs.python.org

[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-06 Thread Christian Heimes
Christian Heimes added the comment: Gregory, thanks. :) By the way CPython's list type does more than log(N) resize ops: $ ./listresize.py 10 100 1000 1 10 10 list.append() do 4 resize ops. 100 list.append() do 11 resize ops. 1000 list.append() do 28 resize ops. 1 list.append() do

[issue3329] API for setting the memory allocator used by Python

2013-03-06 Thread STINNER Victor
STINNER Victor added the comment: To be exhaustive, another patch should be developed to replace all calls for malloc/realloc/free by PyMem_Malloc/PyMem_Realloc/PyMem_Free. PyObject_Malloc() is still using mmap() or malloc() internally for example. Other examples of functions calling

[issue3329] API for setting the memory allocator used by Python

2013-03-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Some customizable memory allocators I know have an extra parameter void *opaque that is passed to all functions: - in zlib: zalloc and zfree: http://www.zlib.net/manual.html#Usage - same thing for bz2. - lzma's ISzAlloc:

[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: By the way CPython's list type does more than log(N) resize ops: Obviously it's an asymptotic complexity, not a hard number. I understand the proposal as a power user tool. Most people don't need a pneumatic hammer, an ordinary hammer suffices. But in some

[issue17367] subprocess deadlock when read() is interrupted

2013-03-06 Thread Richard Oudkerk
Richard Oudkerk added the comment: I will close the issue then. If you track the problem down to a bug in Python then you can open a new one. -- resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker

[issue12768] docstrings for the threading module

2013-03-06 Thread Eli Bendersky
Eli Bendersky added the comment: I wouldn't expend too much effort on older versions though. So unless it's simple to adapt, IMHO 3.3+ is good enough. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12768

[issue16576] ctypes: structure with bitfields as argument

2013-03-06 Thread Eli Bendersky
Changes by Eli Bendersky eli...@gmail.com: -- nosy: +eli.bendersky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16576 ___ ___ Python-bugs-list

[issue16576] ctypes: structure with bitfields as argument

2013-03-06 Thread Eli Bendersky
Eli Bendersky added the comment: I propose to start with the attached documentation fix (generated vs. 3.2 but should be applied to all active branches). A code fix has to be discussed more thoroughly because in theory some code running only on x86-32 can rely on it and will break.

[issue16576] ctypes: structure with bitfields as argument

2013-03-06 Thread Eli Bendersky
Eli Bendersky added the comment: I propose to start with the attached documentation fix (generated vs. 3.2 but should be applied to all active branches). A code fix has to be discussed more thoroughly because in theory some code running only on x86-32 can rely on it and will break.

[issue16576] ctypes: structure with bitfields as argument

2013-03-06 Thread Eli Bendersky
Changes by Eli Bendersky eli...@gmail.com: -- Removed message: http://bugs.python.org/msg183596 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16576 ___

[issue16576] ctypes: structure with bitfields as argument

2013-03-06 Thread Eli Bendersky
Changes by Eli Bendersky eli...@gmail.com: Removed file: http://bugs.python.org/file29327/issue16576.docfix.1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16576 ___

[issue16576] ctypes: structure with bitfields as argument

2013-03-06 Thread Eli Bendersky
Changes by Eli Bendersky eli...@gmail.com: -- nosy: +amaury.forgeotdarc, belopolsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16576 ___ ___

[issue17329] Document unittest.SkipTest

2013-03-06 Thread Zachary Ware
Zachary Ware added the comment: Fair points. I had originally put it in the section you suggested, but then decided that it better fit in a new section of its own under Classes and functions as that section describes in depth the API of unittest. But then, it also makes sense to move the

[issue17324] SimpleHTTPServer serves files even if the URL has a trailing slash

2013-03-06 Thread karl
karl added the comment: orsenthil, would that test work? See issue-17324-test-1.patch Here the result of the test which is FAIL as planned (given the current issue). → ./python.exe Lib/test/test_httpservers.py test_header_buffering_of_send_error (__main__.BaseHTTPRequestHandlerTestCase)

[issue13564] ftplib and sendfile()

2013-03-06 Thread Charles-François Natali
Charles-François Natali added the comment: Here's the result of a benchmark sending a 1GB file over a Gb/s ethernet network: vanilla: real0m9.446s user0m0.493s sys 0m1.425s sendfile: real0m9.143s user0m0.055s sys 0m0.986s The total time doesn't vary much (the reduction

[issue17368] Python version of JSON decoder does not work with object_pairs_hook

2013-03-06 Thread Aki
New submission from Aki: Specifying any object_pairs_hook makes JSON decoding break when JSONObject from json/decoder.py is used. Can be emulated easily by setting c_make_scanner = None at json/scanner.py Example script: ** import json test = '{key: value, empty: {}}' def hook(pairs):

[issue13564] ftplib and sendfile()

2013-03-06 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Note that is changed Giampaolo's patch to call sendfile on the whole file, not by block. That's not compatible across POSIX platforms. -- ___ Python tracker rep...@bugs.python.org

[issue13564] ftplib and sendfile()

2013-03-06 Thread Charles-François Natali
Charles-François Natali added the comment: That's not compatible across POSIX platforms. What do you mean ? I juste call fstat() before calling senfile() to find out the file size, and pass it as `count`. -- ___ Python tracker

[issue13564] ftplib and sendfile()

2013-03-06 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Ah ok, I misinterpreted what you wrote then. Generally speaking though, you don't need to know the file size: you just decide a blocksize (= 65536 is usually ok) and use sendfile() as you use send(). -- ___

[issue17368] Python version of JSON decoder does not work with object_pairs_hook

2013-03-06 Thread R. David Murray
R. David Murray added the comment: Both the Python version and the C version are supposed to be subject to the same tests (at least in Python3, I don't remember the state of things in 2.7), so this probably indicates there is a missing test for this case. Do you have any interest in trying

[issue17368] Python version of JSON decoder does not work with object_pairs_hook

2013-03-06 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti, serhiy.storchaka stage: - test needed type: - behavior versions: -Python 3.1, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17368

[issue12768] docstrings for the threading module

2013-03-06 Thread moijes12
moijes12 added the comment: This patch was built on 3.2(I made the changes on the local repo after running command hg up 3.2). I've run the test suite and only test_site failed. This patch has some improvements over 12768_2.patch. -- Added file:

[issue13564] ftplib and sendfile()

2013-03-06 Thread Charles-François Natali
Charles-François Natali added the comment: Ah ok, I misinterpreted what you wrote then. Generally speaking though, you don't need to know the file size: you just decide a blocksize (= 65536 is usually ok) and use sendfile() as you use send(). But then you make much more syscalls than

[issue13564] ftplib and sendfile()

2013-03-06 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Specifying a big blocksize doesn't mean the transfer will be faster. send/sendfile won't send more than a certain amount of bytes anyways. If I'm not mistaken I recall from previous benchmarks that after a certain point (131072 or something) increasing the

[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-06 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17338 ___ ___ Python-bugs-list

[issue17323] Disable [X refs, Y blocks] ouput in debug builds

2013-03-06 Thread Ezio Melotti
Ezio Melotti added the comment: Here's a proof of concept that defines a new _print_total_refs() function and calls it through the PRINT_TOTAL_REFS macro, disables printing the refs by default, and adds a -X showrefcount option to reenable it. This can also be achieved at runtime by

[issue13564] ftplib and sendfile()

2013-03-06 Thread Charles-François Natali
Charles-François Natali added the comment: Specifying a big blocksize doesn't mean the transfer will be faster. send/sendfile won't send more than a certain amount of bytes anyways. The transfer won't be faster mainly because it's really I/O bound. But it will use less CPU, only because

[issue13229] Improve tools for iterating over filesystem directories

2013-03-06 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13229 ___ ___

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

2013-03-06 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'd like to take care of this at Python. At least for posix (someone else can deal with the windows side if they want). I just stumbled upon an extension module at work that someone wrote specifically because os.listdir consumed way too much ram by

[issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff)

2013-03-06 Thread Piotr Dobrogost
Changes by Piotr Dobrogost p...@bugs.python.dobrogost.net: -- nosy: +piotr.dobrogost ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17322 ___ ___

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

2013-03-06 Thread Tim Golden
Tim Golden added the comment: IIRC Nick Coghlan had put a bit of work into this a few months ago as an external module with a view to seeing if it got traction before putting anything into the stdlib. Might be worth pinging him, or looking to see what he'd done. Can't remember the keywords to

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

2013-03-06 Thread Éric Araujo
Éric Araujo added the comment: Nick’s lib is called walkdir. See bitbucket, readthedocs, possibly hg.python.org. (FTR Antoine’s OO abstraction is pathlib) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11406

[issue10712] 2to3 fixer for deprecated unittest method names

2013-03-06 Thread Berker Peksag
Berker Peksag added the comment: I've converted Ezio's patch to Mercurial format, updated the lib2to3 documentation and added tests for assertRegexpMatches and assertRaisesRegexp aliases[1]. [1] http://docs.python.org/3.4/library/unittest.html#deprecated-aliases -- components: +2to3

[issue12768] docstrings for the threading module

2013-03-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: I haven't read the patch in detail but I think the reference to Java's threading model could probably be discarded. First, I don't know if it's still true, second, I don't think anyone cares :) -- nosy: +pitrou stage: needs patch - patch review

[issue17366] os.chdir win32

2013-03-06 Thread Dave Humphries
Dave Humphries added the comment: Hi Amaury, As I can't reopen the bug I will have to add it here (or open a new bug report). The issue was about the string used in os.chdir() particularly. While this is expected behaviour in a python string it is not expected behaviour from a well formed file

[issue12768] docstrings for the threading module

2013-03-06 Thread Eli Bendersky
Eli Bendersky added the comment: I haven't read the patch in detail but I think the reference to Java's threading model could probably be discarded. First, I don't know if it's still true, second, I don't think anyone cares :) I agree. It could be a remnant of a time where the threading

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

2013-03-06 Thread Charles-François Natali
Charles-François Natali added the comment: IIRC Nick Coghlan had put a bit of work into this a few months ago as an external module with a view to seeing if it got traction before putting anything into the stdlib. Might be worth pinging him, or looking to see what he'd done. Can't remember

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

2013-03-06 Thread Tim Golden
Tim Golden added the comment: OK, sorry for the noise then; I had the idea that it was doing something with iterators/generators. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11406 ___

[issue17369] Message.get_filename produces exception if the RFC2231 encoding is ill-formed

2013-03-06 Thread R. David Murray
New submission from R. David Murray: m = message_from_string(Content-Disposition: attachment; filename*0*=can't decode this filename) m.get_filename() Traceback (most recent call last): File stdin, line 1, in module File /home/rdmurray/python/p32/Lib/email/message.py, line 752, in

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

2013-03-06 Thread Gregory P. Smith
Gregory P. Smith added the comment: right he has a separate issue open tracking the walkdir stuff in issue13229. I saw it first before finding this issue which is exactly what I wanted. :) -- ___ Python tracker rep...@bugs.python.org

[issue16754] Incorrect shared library extension on linux

2013-03-06 Thread Roumen Petrov
Roumen Petrov added the comment: This is issue introduced with implementation of SOABI. Build of standard extensions is protected by following code: - class PyBuildExt(build_ext): def __init__(self, dist): build_ext.__init__(self, dist) self.failed = [] def

[issue13564] ftplib and sendfile()

2013-03-06 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: The transfer won't be faster mainly because it's really I/O bound. But it will use less CPU, only because you're making less syscalls. Have you actually measured this? -- ___ Python tracker

[issue17361] use CC to test compiler flags in setup.py

2013-03-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 33208a574875 by Stefan Krah in branch '3.3': Issue #17361: Use cc from sysconfig for testing flags. http://hg.python.org/cpython/rev/33208a574875 -- nosy: +python-dev ___ Python tracker

[issue17361] use CC to test compiler flags in setup.py

2013-03-06 Thread Stefan Krah
Stefan Krah added the comment: Thanks for the patch. Should be fixed. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17361

[issue17370] PEP should not if it has been superseded

2013-03-06 Thread Brandon Craig Rhodes
New submission from Brandon Craig Rhodes: A friend (@theomn on Twitter) was just working off of PEP-333 when I mentioned to him that PEP-, and he had never heard of it, and he expressed the wish that PEPs would have a banner or something at the top if there is a more recent version of

[issue17370] PEP should note if it has been superseded

2013-03-06 Thread Brandon Craig Rhodes
Brandon Craig Rhodes added the comment: (Corrected not to note in the title and went with enhancement) -- title: PEP should not if it has been superseded - PEP should note if it has been superseded type: - enhancement ___ Python tracker

[issue17370] PEP should note if it has been superseded

2013-03-06 Thread Brandon Craig Rhodes
Brandon Craig Rhodes added the comment: The original inspiration: https://twitter.com/theomn/status/309468740611891200 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17370 ___

[issue17370] PEP should note if it has been superseded

2013-03-06 Thread Owen Nelson
Changes by Owen Nelson onel...@gmail.com: -- nosy: +Owen.Nelson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17370 ___ ___ Python-bugs-list

[issue16754] Incorrect shared library extension on linux

2013-03-06 Thread Dave Malcolm
Dave Malcolm added the comment: For reference, quoting PEP 3149: sysconfig.get_config_var('SO') '.cpython-32mu.so' -- nosy: +dmalcolm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16754

[issue17371] Mismatch between Python 3.3 build environment and distutils compiler support

2013-03-06 Thread Hc.Z
New submission from Hc.Z: My python environment is Python3.3 in Windows 7 32-bit. I was installing Pandas package from source code, through Microsoft Visual C++ 2008 Express is installed in my computer, the installation process still failed and report a Unable to find vcvarsall.bat error. I

[issue17369] Message.get_filename produces exception if the RFC2231 encoding is ill-formed

2013-03-06 Thread karl
karl added the comment: r.david.murray, how did you enter the first without a syntax error? import email.message m = message_from_string(Content-Disposition: attachment; filename*0*=can't decode this filename) File stdin, line 1 m = message_from_string(Content-Disposition:

[issue17369] Message.get_filename produces exception if the RFC2231 encoding is ill-formed

2013-03-06 Thread R. David Murray
R. David Murray added the comment: Heh. I used in the original, and edited it when I posted it for conciseness. Sigh. My apologies. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17369

[issue17369] Message.get_filename produces exception if the RFC2231 encoding is ill-formed

2013-03-06 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- components: +email nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17369 ___ ___

[issue17138] XPath error in xml.etree.ElementTree

2013-03-06 Thread karl
karl added the comment: http://docs.python.org/3/library/xml.etree.elementtree.html#supported-xpath-syntax 20.5.2. XPath support This module provides limited support for XPath expressions for locating elements in a tree. The goal is to support a small subset of the abbreviated syntax; a full

[issue17371] Mismatch between Python 3.3 build environment and distutils compiler support

2013-03-06 Thread Hc.Z
Hc.Z added the comment: My python environment is Python3.3 in Windows 7 32-bit. I was installing Pandas package from source code, through Microsoft Visual C++ 2008 Express is installed in my computer, the installation process still failed and report a Unable to find vcvarsall.bat error. I

[issue15605] Explain sphinx documentation building in devguide

2013-03-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: I initially had a bit of the same confusion as Daniel, and hence agree on clarifying. I have more comments on 7.6. Building the documentation. 1. You need to have Python 2.4 or higher installed. Until 3.x docs can be built with 3.x, (and I just verified that

[issue17372] provide pretty printer for xml.etree.ElementTree

2013-03-06 Thread Eric Snow
New submission from Eric Snow: minidom already has something like this: http://docs.python.org/3/library/xml.dom.minidom.html#xml.dom.minidom.Node.toprettyxml This is something that appears to have almost made it in quite a while ago: http://effbot.org/zone/element-lib.htm#prettyprint

[issue17373] Add inspect.Signature.from_callable()

2013-03-06 Thread Eric Snow
New submission from Eric Snow: While working on a subclass of inspect.Signature, I realized that inspect.signature is treated as the constructor. So subclassing isn't so simple. At first I considered adding an extra parameter to inspect.signature allowing different Signature classes. Not