[issue12672] Some problems in documentation extending/newtypes.html

2011-08-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: -pitrou ___ Python tracker <http://bugs.python.org/issue12672> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12744] inefficient pickling of long integers on 64-bit builds

2011-08-12 Thread Antoine Pitrou
New submission from Antoine Pitrou : On a 64-bit Linux machine (where C `long` is 64 bits): >>> len(pickle.dumps(2**30)) 8 >>> len(pickle.dumps(2**31)) 16 >>> len(pickle.dumps(2**62)) 25 >>> len(pickle.dumps(2**63)) 14 This is because the old text protocol i

[issue11564] pickle not 64-bit ready

2011-08-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: This patch contains assorted improvements for 64-bit compatibility of the pickle module. The protocol still doesn't support >4GB bytes or str objects, but at least its behaviour shouldn't be misleading anymore. -- keywords: +patch sta

[issue12731] python lib re uses obsolete sense of \w in full violation of UTS#18 RL1.2a

2011-08-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12731> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12737] str.title() is overzealous by upcasing combining marks inappropriately

2011-08-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +haypo, loewis stage: -> needs patch versions: +Python 3.3 ___ Python tracker <http://bugs.python.org/issue12737> ___ _

[issue12746] normalization is affected by unicode width

2011-08-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +haypo, lemburg ___ Python tracker <http://bugs.python.org/issue12746> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12740] Add struct.Struct.nmemb

2011-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: I had never heard of "nmemb". "nmembers" would be less cryptic. The patch needs a "versionadded" directive in the docs. -- nosy: +pitrou ___ Python tracker <

[issue12745] Python2 or Python3 page

2011-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: It is a wiki page, so you can edit it yourself (you probably need to register, though). If you think your modifications would be too drastic, perhaps you want to launch a discussion on the python-dev mailing-list about that page and its current contents

[issue12744] inefficient pickling of long integers on 64-bit builds

2011-08-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +alexandre.vassalotti ___ Python tracker <http://bugs.python.org/issue12744> ___ ___ Python-bugs-list mailing list Unsub

[issue9552] ssl build under Windows always rebuilds OpenSSL

2011-08-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.o

[issue12731] python lib re uses obsolete sense of \w in full violation of UTS#18 RL1.2a

2011-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > However, because the \w&c issues are bigger, Java addressed the tr18 RL1.2a > issues differently, this time by creating a new compilation flag called > UNICODE_CHARACTER_CLASSES (with corresponding embedded "(?U)" regex flag.) >

[issue12744] inefficient pickling of long integers on 64-bit builds

2011-08-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue12729] Python lib re cannot handle Unicode properly due to narrow/wide bug

2011-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Here's why I say that Python uses UTF-16 not UCS-2 on its narrow builds. > Perhaps someone could tell me why the Python documentation says it uses > UCS-2 on a narrow build. There's a disagreement on that point between several developers.

[issue12729] Python lib re cannot handle Unicode properly due to narrow/wide bug

2011-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > There are occasions when you want to do string slicing, often of the form: > > pos = my_str.index(x) > endpos = my_str.index(y) > substring = my_str[pos : endpos] > > To me that suggests that if UTF-8 is used then it may be worth >

[issue12749] lib re cannot match non-BMP ranges (all versions, all builds)

2011-08-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I have private builds that are 2.7 and 3.2, but those are both narrow. > I do not have a 3.3 build. Should I? I don't know if you *should*. But you can make one easily by passing "--with-wide-unicode

[issue12729] Python lib re cannot handle Unicode properly due to narrow/wide bug

2011-08-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > The UTF-8 codec described by RFC 2279 didn't say so, so, since our > > codec was following RFC 2279, it was producing valid UTF-8. With RFC > > 3629 a number of things changed in a non-backward compatible way. > > Therefor

[issue12740] Add struct.Struct.nmemb

2011-08-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > It looks like the choice is between s.nmembers and len(s). I thought > about len(s), but since Struct.pack() returns a bytes object, this > might be confusing. I agree there's a risk of confusion between len()-number-of-elements and size()-n

[issue12751] Use macros for surrogates in unicodeobject.c

2011-08-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: > HIGH_SURROGATE and LOW_SURROGATE require that their ordinal argument > has been preproceed to fit in [0; 0x]. I added this requirement in > the comment of these macros. The macros should preprocess the argument themselves. It will make the

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: The proposed resolution looks ok. Another possibility is simply to use .lower() if the string is an unicode string, since that will bypass the C locale. -- nosy: +pitrou stage: test needed -> patch rev

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2011-08-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I think the 4 macros: > #define _Py_UNICODE_ISSURROGATE > #define _Py_UNICODE_ISHIGHSURROGATE > #define _Py_UNICODE_ISLOWSURROGATE > #define _Py_UNICODE_JOIN_SURROGATES > are quite straightforward and can avoid using the trailing _

[issue12763] test_posix failure on OpenIndiana

2011-08-16 Thread Antoine Pitrou
New submission from Antoine Pitrou : http://www.python.org/dev/buildbot/all/builders/x86%20OpenIndiana%203.x/builds/1826/steps/test/logs/stdio == ERROR: test_get_and_set_scheduler_and_param (test.test_posix.PosixTester

[issue12555] PEP 3151 implementation

2011-08-16 Thread Antoine Pitrou
Changes by Antoine Pitrou : Added file: http://bugs.python.org/file22913/524e47d8b878.diff ___ Python tracker <http://bugs.python.org/issue12555> ___ ___ Python-bug

[issue12763] test_posix failure on OpenIndiana

2011-08-16 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- type: performance -> behavior ___ Python tracker <http://bugs.python.org/issue12763> ___ ___ Python-bugs-list mailing list Un

[issue12555] PEP 3151 implementation

2011-08-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch with latest changes from the PEP. The implementation is now complete. -- ___ Python tracker <http://bugs.python.org/issue12

[issue12765] test_packaging failure under Snow Leopard

2011-08-16 Thread Antoine Pitrou
New submission from Antoine Pitrou : http://www.python.org/dev/buildbot/all/builders/AMD64%20Snow%20Leopard%202%203.x/builds/789/steps/test/logs/stdio -- assignee: eric.araujo components: Library (Lib), Tests messages: 142220 nosy: eric.araujo, pitrou priority: release blocker severity

[issue12766] strange interaction between __slots__ and class-level attributes

2011-08-16 Thread Antoine Pitrou
New submission from Antoine Pitrou : >>> class Foo: ...__slots__ = ['foo'] ...foo = None ... >>> x = Foo() >>> x.foo >>> x.foo = 5 Traceback (most recent call last): File "", line 1, in AttributeError: 'Foo' object att

[issue12766] strange interaction between __slots__ and class-level attributes

2011-08-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > This sort of thing is true of any slotted class with class attributes: > > >>> class X: > ... __slots__ = () > ... foo = None > ... > >>> X().foo = "hello" > Traceback (most recent call last): &

[issue12766] strange interaction between __slots__ and class-level attributes

2011-08-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > So would you prefer to see > > >>> x.foo > Traceback (most recent call last): > File "", line 1, in > AttributeError: foo > >>> x.foo = 5 > >>> x.foo > 5 > ? No, I would prefer to se

[issue12766] strange interaction between __slots__ and class-level attributes

2011-08-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I'm afraid that's not (easily) possible. Using __slots__ implicitly > gives classes attributes, so what you are seeing is the effect of > toying with that. It's not really possible to pretend there are > different attributes on the

[issue12720] Expose linux extended filesystem attributes

2011-08-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think the functions should: - accept both str and bytes for keys and values; when it's an str, encoding it using the FS encoding - return str for attribute names, using the FS encoding - return bytes for attribute values, although returning str mig

[issue12767] document threading.Condition.notify

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I asked the user who reported this documentation omission what he's > using the 'n' argument for. His reply: > > "Yes I am using the n parameter, it is mainly to implement a > subclass of Queue that supports "bulk&

[issue12760] Add create mode to open()

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: The "#ifdef O_EXCL" in the source code is probably very old. Copying a message I posted on python-ideas: O_EXCL is a POSIX standard. It is also supported under Windows by the _open/_wopen compatibility functions (which we use for file I/O). Prob

[issue12760] Add create mode to open()

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Well, I'd rather have this flag called 'x', to be consistent with > glibc's fopen(): > > """ >c (since glibc 2.3.3) > Do not make the open operation, or subsequent read and write &

[issue12775] immense performance problems related to the garbage collector

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: As Charles-François said: it would be nice to know which Python version you are using. Also, if you could test with 2.7 or 3.2 and the standard json module (or the latest simplejson if you prefer). Also, while Python's performance is not always excellen

[issue12777] Inconsistent use of VOLUME_NAME_* with GetFinalPathNameByHandle

2011-08-18 Thread Antoine Pitrou
New submission from Antoine Pitrou : In the implementation of nt._getfinalpathname() (in posixmodule.c) we have: /* We have a good handle to the target, use it to determine the target path name. */ buf_size = Py_GetFinalPathNameByHandleW(hFile, 0, 0, VOLUME_NAME_NT

[issue12775] immense performance problems related to the garbage collector

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The bug note contains a test script. You just have to generate a huge > JSON-blob, or allocate 1 GB or so and pickle it down to file and > replace the cjson.decode to pickle.loads, pickle is about 20 times > faster without GC. You can't s

[issue12777] Inconsistent use of VOLUME_NAME_* with GetFinalPathNameByHandle

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: That's slightly off-topic, but is it enough to strip the leading '\\?\' (and replace 'UNC' with '\'), or are there other things to watch out for? -- ___ Python tracker

[issue12778] JSON-serializing a large container takes too much memory

2011-08-18 Thread Antoine Pitrou
New submission from Antoine Pitrou : On a 8GB RAM box (more than 6GB free), serializing many small objects can eat all memory, while the end result would take around 600MB on an UCS2 build: $ LANG=C time opt/python -c "import json; l = [1] * (100*1024*1024); encoded = json.dumps(l)"

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Correct. We can't touch Python 3.1, 2.6, or earlier because those are all in > security-only mode, and unless a specific security related issue is > identified, the change should not be made there. That's just life (a recent > similar

[issue12775] immense performance problems related to the garbage collector

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: > So overall it looks like it's less of a problem in newer versions of > Python. We are phasing out the software that is deployed on Debian > Lenny so it's a problem that will go away. I don't think I have any > objections wit

[issue12765] test_packaging failure under Snow Leopard

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Bill is the owner of that buildbot. -- nosy: +janssen ___ Python tracker <http://bugs.python.org/issue12765> ___ ___ Python-bug

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > It means someone upgrading from 2.6 to 2.7 will see sys.platform change > > from "linux3" to "linux2". That breaks compatibility. > > No, it doesn't. Code that works on 2.6 and Linux 3 will likely support > bo

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > Then, let's just advise that all code follow the same path and use > > sys.platform.startswith() (which is really not a difficult change to > > make). > > Antoine, please accept that people want better backwards compatibilit

[issue12778] JSON-serializing a large container takes too much memory

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: This patch does the trick. -- keywords: +patch Added file: http://bugs.python.org/file22942/jsonacc.patch ___ Python tracker <http://bugs.python.org/issue12

[issue5845] rlcompleter should be enabled automatically

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Interestingly, there's already the following code in Modules/main.c: if ((Py_InspectFlag || (command == NULL && filename == NULL && module == NULL)) && isatty(fileno(stdin))) { PyObject *v; v = Py

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > Really, it's not difficult to understand that code testing for "linux2" > > will stop working when "linux3" gets released. > > This doesn't matter. People will still complain. And, as there is an > obvi

[issue5845] rlcompleter should be enabled automatically

2011-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Updated patch (not using Mercurial, looks like I haven’t enough > bandwidth to push all those changesets). I think there's a bug in the way you are detecting interactive mode: $ ./python -c "import sys; print(sys.stdin

[issue12720] Expose linux extended filesystem attributes

2011-08-18 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +neologix ___ Python tracker <http://bugs.python.org/issue12720> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The suggested change removes the compile time information from > the platform string, so that information needs to be preserved > in a new attribute. -1 on any new platform identification attribute. We already have too many of them, and there'

[issue11564] pickle not 64-bit ready

2011-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I have tried running the tests on a machine with 12GB of RAM, but when I do > so, > the new tests get skipped saying "not enough memory", even when I specify "-M > 11G" > on the command-line. How much does it say is re

[issue11564] pickle not 64-bit ready

2011-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I'd be glad to do so, but I'm not sure what the aim of the "dryrun" flag is. > Do you want to make it the default that precisionbigmem tests are skipped, > unless the decorator invocation explicitly specifies dryrun=False? No,

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2011-08-19 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +benjamin.peterson, ncoghlan type: behavior -> feature request versions: -Python 2.7 ___ Python tracker <http://bugs.python.org/issu

[issue12682] Meaning of 'accepted' resolution as documented in devguide

2011-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would say I find "accepted" little useful in practice. Removing it would avoid the confusion with its various (intended or not) meanings. -- nosy: +pitrou ___ Python tracker <http://bugs.python.o

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Please reread the quoted sentence: > > The *compile time* version information needs to be preserved. Then please give it a very explicit name, such as "sys.build_platform" or "sys.compile_time_version_info". We don't want

[issue12784] Concatenation of strings returns the wrong string

2011-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Have you tried with other large files? Or on another system? -- nosy: +pitrou ___ Python tracker <http://bugs.python.org/issue12

[issue12778] JSON-serializing a large container takes too much memory

2011-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I actually looked into doing this for issue #12134, but it didn't seem > so simple; Since C has no yield, I think the iterator would need to > maintain its own stack to keep track of where it is in the object tree > it's encoding..

[issue12784] Concatenation of strings returns the wrong string

2011-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Note how the ascii codes for the faulty characters only differ by one > bit, and only the 5th least significant bit. This looks very much like a hardware issue. Python usually does nothing special with the 5th bit of characters. Also, the IO syst

[issue12778] JSON-serializing a large container takes too much memory

2011-08-19 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue12786] subprocess wait() hangs when stdin is closed

2011-08-19 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +neologix type: resource usage -> behavior ___ Python tracker <http://bugs.python.org/issue12786> ___ ___ Python-bugs-lis

[issue11564] pickle not 64-bit ready

2011-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > D'oh. I just realized why the -M option wasn't being recognized - I had > passed it > after the actual test name, so it was being treated as another test instead > of an > option. Sorry for the confusion :/ > >

[issue12213] BufferedRandom, BufferedRWPair: issues with interlaced read-write

2011-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think your expectations for BufferedRWPair are wrong. You should not use BufferedRWPair with the same underlying stream (that's the whole point of BufferedRWPair). -- ___ Python tracker <http://bugs.py

[issue12778] JSON-serializing a large container takes too much memory

2011-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > It would just need to call a given callable (fp.write) at regular > intervals and that would be enough to C-accelerate dump(). > > True, but that would just special case dump(), just like dumps() is > special-cased now. Ideally JSON

[issue12213] BufferedRandom, BufferedRWPair: issues with interlaced read-write

2011-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch. -- stage: -> patch review Added file: http://bugs.python.org/file22950/bufrandom.patch ___ Python tracker <http://bugs.python.org/issu

[issue12788] test_email fails with -R

2011-08-19 Thread Antoine Pitrou
New submission from Antoine Pitrou : $ ./python -m test -R 3:2 test_email [1/1] test_email beginning 5 repetitions 12345 Warning -- sys.path was modified by test_email test test_email failed -- Traceback (most recent call last): File "/home/antoine/cpython/default/Lib/test/test_

[issue12791] reference cycle with exception state not broken by generator.close()

2011-08-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: The problem is probably that the frame keeps the last execution state around, and since the exception itself has a reference to a frame, a cycle is created. Note that it doesn't happen if you catch the GeneratorExit that gets raised inside the generat

[issue12791] reference cycle with exception state not broken by generator.close()

2011-08-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch. -- keywords: +patch Added file: http://bugs.python.org/file22961/genexcstate.patch ___ Python tracker <http://bugs.python.org/issue12

[issue12791] reference cycle with exception state not broken by generator.close()

2011-08-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the report, fixed. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue12213] BufferedRandom: issues with interlaced read-write

2011-08-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: This should be fixed for BufferedRandom. As I said, I don't think BufferedRWPair is buggy. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> pending title: BufferedRandom, BufferedRWPair: issues with i

[issue12213] BufferedRandom: issues with interlaced read-write

2011-08-20 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- title: BufferedRandom, BufferedRWPair: issues with interlaced read-write -> BufferedRandom: issues with interlaced read-write ___ Python tracker <http://bugs.python.org/issu

[issue12213] BufferedRandom: issues with interlaced read-write

2011-08-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think it can be closed now. -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue12213> ___ ___ Py

[issue12555] PEP 3151 implementation

2011-08-20 Thread Antoine Pitrou
Changes by Antoine Pitrou : Added file: http://bugs.python.org/file22966/aa9e276a791d.diff ___ Python tracker <http://bugs.python.org/issue12555> ___ ___ Python-bug

[issue12555] PEP 3151 implementation

2011-08-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: New patch incorporating Ezio's comments and synchronized with latest default. -- ___ Python tracker <http://bugs.python.org/is

[issue12796] total_ordering goes into infinite recursion when NotImplemented is returned

2011-08-20 Thread Antoine Pitrou
New submission from Antoine Pitrou : This small test file exhibits the issue. When @total_ordering is not applied, the '<' operator raises TypeError as expected. When @total_ordering is applied, there is an infinite recursion error. -- components: Library (Lib) fil

[issue12797] io.FileIO and io.open should support openat

2011-08-20 Thread Antoine Pitrou
New submission from Antoine Pitrou : Right now it is painful to integrate openat() with the normal IO classes. You have to figure out the low-level flags yourself (i.e. replicate the logic and error handling from the FileIO constructor), then replicate the open() logic yourself (because you

[issue12797] io.FileIO and io.open should support openat

2011-08-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: > A third idea is to find a way to override the low-level open() > function (the one that returns a fd). Why not. It would e.g. allow to use CreateFile under Windows (the hg guys do this in order to change the "sharing" mode to somet

[issue12783] test_posix failure on FreeBSD 6.4: test_get_and_set_scheduler_and_param

2011-08-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sounds fine to me. -- ___ Python tracker <http://bugs.python.org/issue12783> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12799] realpath not resolving symbolic links under Windows

2011-08-20 Thread Antoine Pitrou
New submission from Antoine Pitrou : >From a look at the code, realpath() does not seem to resolve symlinks under >Windows, even though we have the _getfinalpathname function to do that. Please indulge with me if I'm wrong :) -- components: Library (Lib) messages:

[issue12797] io.FileIO and io.open should support openat

2011-08-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I believe openat is new to POSIX (mandatory as of POSIX 2008). For > example, it's not currently in OS X and apparently was first added to > FreeBSD in 8.0. So it would have to be checked by configure and > documented as platform-dependent.

[issue12801] C realpath not used by os.path.realpath

2011-08-20 Thread Antoine Pitrou
New submission from Antoine Pitrou : We have our own quirky implementation of C realpath() in posixpath.py. It would probably be simpler, safer and more efficient to simply call the POSIX function instead (but it most be exposed somewhere, by posixmodule.c I suppose). -- components

[issue1298813] sysmodule.c: realpath() is unsafe

2011-08-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: The latest POSIX versions (*) allow NULL to be passed for the target memory area, meaning that realpath() will allocate as much memory as necessary by itself. This essentially does the same thing as canonicalize_file_name(), but in a standard way rather than

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-20 Thread Antoine Pitrou
New submission from Antoine Pitrou : Windows error 3 is returned when a directory path doesn't exist, but 267 is returned when an existing path is not a directory. This corresponds straight to the definition of ENOTDIR, but Python translates it to EINVAL: >>> os.listdir("x

[issue12803] SSLContext.load_cert_chain() should accept a password argument

2011-08-21 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: -> patch review versions: +Python 3.3 -Python 3.1, Python 3.2 ___ Python tracker <http://bugs.python.org/issu

[issue12817] test_multiprocessing: io.BytesIO() requires bytearray buffers

2011-08-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Antoine, is it correct that io.BytesIO should only be used with bytearray > buffers? BytesIO does a copy of the original object, it does not touch the original buffer. -- ___ Python tracker

[issue11564] pickle not 64-bit ready

2011-08-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > Can you replace "_2G" with "_4G" in the decorator for that test? > > When I do that, it pushes the memory usage for the test up to 16GB, which is > beyond what the machine can handle. When I tried with 2.5G (_2G * 5 // 4)

[issue9893] Removing the Misc/Vim/ files

2011-08-22 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: -pitrou ___ Python tracker <http://bugs.python.org/issue9893> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12678] test_packaging and test_distutils failures under Windows

2011-08-22 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: -pitrou ___ Python tracker <http://bugs.python.org/issue12678> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6560] socket sendmsg(), recvmsg() methods

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: > However, in doing this, I noticed that these methods will, at best, > work during the time between connection and the socket going secure > and were not added to the list of methods that the SSL is documented > as exposing. Perhaps we should jus

[issue6560] socket sendmsg(), recvmsg() methods

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: > That's the part I'm questioning though. I'm not clear why you'd ever do > that instead of doing everything on the original socket before invoking > ssl.wrap_socket. > > What I missed on the original patch before committin

[issue12817] test_multiprocessing: io.BytesIO() requires bytearray buffers

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Please also see issue5231. -- ___ Python tracker <http://bugs.python.org/issue12817> ___ ___ Python-bugs-list mailing list Unsub

[issue5231] Change format of a memoryview

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Or go all the way and make memoryview take any flag: > > a = array.array('i', [1,2,3]) > m = memoryview(a, getbuf=PyBUF_SIMPLE) This is good for testing, but Python developers shouldn't have to kno

[issue9993] shutil.move fails on symlink source

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Looks good to me. -- ___ Python tracker <http://bugs.python.org/issue9993> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5231] Change format of a memoryview

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Hmm, indeed. How about: > > 1) memoryview(a, format='B') > > Shadows a builtin function; annoying syntax highlighting in current Vim. > > 2) memoryview(a, fmt='B') > > I'm fully expecting a comment about

[issue5231] Change format of a memoryview

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: > However, requiring an explicit two-step process for any other casting > (i.e. take a 1-D view, then a shaped view of that flat 1-D view) also > sounds reasonable. > > So I agree with Victor that 1-D bytes -> any shape/format and any >

[issue11657] multiprocessing_{send,recv}fd fail with fds > 256

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: > For 3.3, it may be relevant that send/recvmsg are now available via > the socket API (see #6560) I think sendfds/recvfds helper methods could be added to the socket type, so that programmers don't have to get the incantations right by themselves

[issue11657] multiprocessing_{send,recv}fd fail with fds > 256

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Now that I think of it, it would be nice to add some simple tests for recvfd and sendfd in test_multiprocessing. (also, when os.dup2() is available, you can easily generate an arbitrary big file descriptor

[issue11657] multiprocessing_{send,recv}fd fail with fds > 256

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: I committed a patch with some tests. Thank you! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would add it in test_exceptions, since errno mapping is ultimately used by exceptions. -- ___ Python tracker <http://bugs.python.org/issue12

[issue12823] Broken link in "SSL wrapper for socket objects" document

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would simply remove the link, or point it to a similar document -- keywords: +easy nosy: +pitrou stage: -> needs patch versions: +Python 2.7, Python 3.2, Python 3.3 -Python 3.1 ___ Python tracker &l

[issue12822] NewGIL should use CLOCK_MONOTONIC if possible.

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch is ok on the principle, but we do need a check that CLOCK_MONOTONIC is supported at build time. -- nosy: +pitrou ___ Python tracker <http://bugs.python.org/issue12

[issue6560] socket sendmsg(), recvmsg() methods

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: The OS X buildbots show some failures: http://www.python.org/dev/buildbot/all/builders/AMD64%20Snow%20Leopard%202%203.x -- ___ Python tracker <http://bugs.python.org/issue6

<    7   8   9   10   11   12   13   14   15   16   >