[issue2521] ABC caches should use weak refs

2010-03-31 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Added file: http://bugs.python.org/file16713/abc_leak.patch ___ Python tracker <http://bugs.python.org/issue2521> ___ ___ Python-bugs-list m

[issue2521] ABC caches should use weak refs

2010-03-31 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: New patches uploaded. I separated out the patch to add the test case, to make it easier to test before and after applying the fix. -- Added file: http://bugs.python.org/file16714/leak_test.patch ___ Python

[issue2521] ABC caches should use weak refs

2010-03-31 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Removed file: http://bugs.python.org/file16690/abc_leak.patch ___ Python tracker <http://bugs.python.org/issue2521> ___ ___ Python-bug

[issue2810] _winreg.EnumValue fails when the registry data includes multibyte unicode characters

2010-04-01 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Attached is a file that reliably produces the "More data is available" error from _winreg.EnumValue in Python 2.6. The script triggers the error via a race condition, by modifying the value after PyEnumValue() calls RegQueryInfoKey() but befor

[issue2810] _winreg.EnumValue fails when the registry data includes multibyte unicode characters

2010-04-01 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Here's another script that causes a "More data is available" error. This one creates a key with a name that's exactly 256 characters long. (The Windows Registry Editor can't display the key either) I'm testing this on XP. N

[issue2810] _winreg.EnumValue fails when the registry data includes multibyte unicode characters

2010-04-02 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: It was never 100% clear that it ever related to multi-byte strings, so (as the original reporter) I'd prefer to continue using this bug and just update the title to: _winreg.EnumValue sometimes raises WindowsError ("More data is available"

[issue2810] _winreg.EnumValue fails when the registry data includes multibyte unicode characters

2010-04-02 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I just wrote a C program that can read the long key name just fine, so it's not a Windows API bug. -- ___ Python tracker <http://bugs.python.org/i

[issue2810] _winreg.EnumValue fails when the registry data includes multibyte unicode characters

2010-04-07 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I just found a one line example of the problem: >>> EnumValue(HKEY_PERFORMANCE_DATA, 0) Traceback (most recent call last): File "", line 1, in WindowsError: [Error 234] More data is available Other functions are also affected

[issue8334] winreg.QueryValue should return bytes, not unicode

2010-04-07 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : The Windows RegQueryValue function returns a registry value without returning the corresponding type information (e.g., REG_SZ for string, REG_BINARY for binary data, REG_DWORD for a 32-bit number, etc.). The corresponding wrapper winreg.QueryValue

[issue8334] winreg.QueryValue should return bytes, not unicode

2010-04-07 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Jumped the gun here. RegQueryValue returns ERROR_DATA_INVALID if the value isn't a string, so converting to Unicode is OK. -- status: open -> closed ___ Python tracker <http://bugs.python.or

[issue2810] _winreg.EnumValue fails when the registry data includes multibyte unicode characters

2010-04-07 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Added file: http://bugs.python.org/file16802/winreg_test.pach ___ Python tracker <http://bugs.python.org/issue2810> ___ ___ Python-bug

[issue2810] _winreg.EnumValue fails when the registry data includes multibyte unicode characters

2010-04-07 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- keywords: +patch Added file: http://bugs.python.org/file16803/winreg.patch ___ Python tracker <http://bugs.python.org/issue2

[issue2810] _winreg.EnumValue fails when the registry data includes multibyte unicode characters

2010-04-07 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Removed file: http://bugs.python.org/file16728/more_data_is_available.py ___ Python tracker <http://bugs.python.org/issue2810> ___ ___ Pytho

[issue2810] _winreg.EnumValue fails when the registry data includes multibyte unicode characters

2010-04-07 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Removed file: http://bugs.python.org/file16729/more_data_is_available2.py ___ Python tracker <http://bugs.python.org/issue2810> ___ ___ Pytho

[issue2810] _winreg.EnumValue fails when the registry data includes multibyte unicode characters

2010-04-07 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I've uploaded two patches (against trunk): one to add test cases that demonstrate this bug and another to fix the bug. -- ___ Python tracker <http://bugs.python.org/i

[issue6650] sre_parse contains a confusing generic error message

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: Thanks for the patch, LGTM assuming we don't need a test for this. Do you think the vague message could be less cryptic for users that didn't want lookbehind (or don't know what it is)? -- nosy: +ajaksu2 priority: -> low stage

[issue6700] inspect.getsource() returns incorrect source lines

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: Confirmed in trunk and py3k. Also affects inspect.getsourcelines. -- nosy: +ajaksu2 priority: -> normal stage: -> patch review ___ Python tracker <http://bugs.python.org/

[issue6878] outdated docstring in tkinter.Canvas.coords

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: I think the obvious code fix of list(map()) is less likely to cause surprises than updating the docstring to the new map in 3.x. -- keywords: +easy nosy: +ajaksu2 priority: -> low stage: -> needs patch type: ->

[issue7007] Tiny inconsistency in the orthography of "url encoded" in the doc of urllib.parse

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: Hits from py3k: Doc/library/urllib.rst:239: Convert a mapping object or a sequence of two-element tuples to a "url-encoded" Doc/library/urllib.rst:263: Convert the path component *path* from an encoded URL to the local syntax for a D

[issue7163] IDLE suppresses sys.stdout.write() return value

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: sys.stdout is a idlelib.rpc.RPCProxy in IDLE. It calls Idlelib.PyShell.PseudoFile.write -> .PyShell.write -> .OutputWindow.OutputWindow.write -> .Percolator.Percolator.insert -> ... I suppose we could mimic the return value patching PseudoFil

[issue7370] patch: BaseHTTPServer reinventing rfc822

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: Thanks for the patch. Per issue 2849, use of rfc822 should be gone from the stdlib. Please re-open if you disagree. -- nosy: +ajaksu2 priority: -> normal resolution: -> invalid stage: -> committed/rejected status: open

[issue7425] [PATCH] Improve the robustness of "pydoc -k" in the face of broken modules

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: Nice improvement. This would also solve the "help(), modules" brokenness, right? -- nosy: +ajaksu2 priority: -> normal stage: -> test needed type: -> behavior ___ Python tracker <http://bug

[issue7378] unexpected truncation of traceback

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: Patch still applies to py3k, not applying cleanly to trunk anymore. Tests pass with patch on py3k. -- nosy: +ajaksu2 priority: -> normal stage: -> patch review ___ Python tracker <http://bugs.python.org/

[issue7584] datetime.rfcformat() for Date and Time on the Internet

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: It looks like feed generators need this feature[1]. See also issue 5207 and a current implementation[2]. [1] http://validator.w3.org/feed/docs/error/InvalidRFC3339Date.html [2] http://code.google.com/p/formattime/ -- keywords: +easy nosy: +ajaksu2

[issue7865] io close() swallowing exceptions

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: Wouldn't this break code that currently works? -- nosy: +ajaksu2 priority: -> low stage: -> needs patch type: -> behavior versions: -Python 2.5 ___ Python tracker <http://bugs.pyt

[issue7842] py_compile.compile SyntaxError output

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: Change went into py3k without tests, do we want them? If so, please update Stage to "test needed". -- nosy: +ajaksu2 priority: -> normal stage: -> patch review ___ Python tracker <http://bugs.p

[issue7943] Memory leak due to circular references in ssl.SSLSocket

2010-04-08 Thread Daniel Diniz
Changes by Daniel Diniz : -- priority: -> normal stage: -> test needed ___ Python tracker <http://bugs.python.org/issue7943> ___ ___ Python-bugs-list

[issue7927] SSL socket is not closed properly

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: Confirmed on trunk. -- nosy: +ajaksu2 priority: -> normal stage: -> test needed versions: +Python 2.7 ___ Python tracker <http://bugs.python.org/

[issue4007] make clean fails to delete .a and .so.X.Y files

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: Skip, was there a patch here? I can't find it in the bug lists, so I think we both missed it? Pinging Martin in case the tracker ate the patch :) -- nosy: +ajaksu2, loewis stage: -> needs patch versions: +Python 2.7, Py

[issue8026] strftime bug when timedelta is negative

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: Confirmed on trunk, needs a simpler repro :) -- components: +Library (Lib) -None nosy: +ajaksu2 priority: -> normal stage: -> test needed versions: +Python 2.6, Python 2.7 -Python 2.5 ___ Python tracker

[issue6507] Enhance dis.dis to autocompile codestrings

2010-04-11 Thread Daniel Urban
Daniel Urban added the comment: I've made a patch, which adds a disassemble_str function to the dis module. The dis.dis function calls this function if x is a string. Added the following sentence to the documentation: "Strings are first compiled to code objects with the :func:`comp

[issue7584] datetime.rfcformat() for Date and Time on the Internet

2010-04-13 Thread Daniel Urban
Daniel Urban added the comment: I've made a patch. This patch adds a datetime_rfcformat function to datetimemodule.c which is available from Python as the datetime.rfcformat method in the datetime module. This method returns the date in RFC 3339 format: -MM-DDTHH:MM:SS[.mm]+

[issue7559] TestLoader.loadTestsFromName swallows import errors

2010-04-13 Thread Daniel Diniz
Changes by Daniel Diniz : -- stage: unit test needed -> patch review ___ Python tracker <http://bugs.python.org/issue7559> ___ ___ Python-bugs-list mai

[issue8370] change module "builtins" to "__builtin__" in __import__ documentation

2010-04-13 Thread Daniel Diniz
Changes by Daniel Diniz : -- priority: -> normal stage: -> patch review ___ Python tracker <http://bugs.python.org/issue8370> ___ ___ Python-bugs-list

[issue8297] AttributeError message text should include module name

2010-04-13 Thread Daniel Diniz
Changes by Daniel Diniz : -- nosy: +ajaksu2 stage: unit test needed -> patch review ___ Python tracker <http://bugs.python.org/issue8297> ___ ___ Python-

[issue5419] urllib.request.open(someURL).read() returns a bytes object so writing it requires binary mode

2010-04-15 Thread Daniel Haertle
Daniel Haertle added the comment: I got struck by the same feature. In addition, currently the docs are wrong in the examples (at http://docs.python.org/dev/py3k/library/urllib.request.html#examples the output of f.read() is a string instead of bytes). There I propose the change from

[issue6507] Enhance dis.dis to autocompile codestrings

2010-04-18 Thread Daniel Urban
Daniel Urban added the comment: Any chance, that my patch will be accepted? Is there a problem with it? Thanks. -- ___ Python tracker <http://bugs.python.org/issue6

[issue8498] Cannot use backlog = 0 for sockets

2010-04-22 Thread Daniel Evers
New submission from Daniel Evers : I'm trying to rewrite a server application in python that accepts exactly 1 connection. I have a previous version written in C that can call listen() on a socket with a backlog of 0 connections, but this is not possible in python. In Modules/socketmod

[issue8498] Cannot use backlog = 0 for sockets

2010-04-22 Thread Daniel Evers
Daniel Evers added the comment: Thanks for your help. I'll close the listen socket. Nevertheless I'd like to understand the check in sock_listen. The commit message is not very helpful, I agree, that's why I wrote this issue. 0 is a valid value, and I'd suggest two

[issue8498] Cannot use backlog = 0 for sockets

2010-04-24 Thread Daniel Evers
Daniel Evers added the comment: I attached a patch: The backlog is set to at least 0 instead of 1. I also added a comment that a backlog < 0 can lead to problems and doesn't make sense anyway (so if there are systems that may crash with backlog < 0 this will be avoided).

[issue8498] Cannot use backlog = 0 for sockets

2010-04-24 Thread Daniel Evers
Daniel Evers added the comment: Ah right ;) Sorry, attached the path incl. the doc string. -- Added file: http://bugs.python.org/file17066/backlog0_incl_doc.diff ___ Python tracker <http://bugs.python.org/issue8

[issue8498] Cannot use backlog = 0 for sockets

2010-04-24 Thread Daniel Evers
Daniel Evers added the comment: A second patch for the documentation of socket.listen(). -- Added file: http://bugs.python.org/file17067/socket_listen.patch ___ Python tracker <http://bugs.python.org/issue8

[issue8521] Allow some winreg functions to accept keyword arguments

2010-04-24 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : Hi Brian, It looks like you had attached to issue5774 a patch to allow OpenKey to accept keyword arguments. Just thought I'd mention that here so there's a link back to it. -- nosy: +stutzbach

[issue2521] ABC caches should use weak refs

2010-04-26 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Someone with appropriate permissions want to update the "Stage"? -- versions: +Python 2.7 ___ Python tracker <http://bugs.python.

[issue8005] datetime's comparison methods do not return NotImplemented when they should

2010-04-26 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Thomas, could you write a unit test to go along with your patch? -- ___ Python tracker <http://bugs.python.org/issue8

[issue2810] _winreg.EnumValue sometimes raises WindowsError ("More data is available")

2010-04-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- title: _winreg.EnumValue fails when the registry data includes multibyte unicode characters -> _winreg.EnumValue sometimes raises WindowsError ("More data is available") ___ Python tracker <http:/

[issue1289118] timedelta multiply and divide by floating point

2010-04-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue1289118> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue8005] datetime's comparison methods do not return NotImplemented when they should

2010-04-27 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: You're right. I asked Thomas the wrong question, and the Keywords and Stage need updating. Thomas, do you still plan to submit a patch that fixes the problem? -- ___ Python tracker <http://bugs.py

[issue8005] datetime's comparison methods do not return NotImplemented when they should

2010-04-27 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Great! If you get stuck or have a question, just ask. :-) -- ___ Python tracker <http://bugs.python.org/issue8005> ___ ___

[issue8005] datetime's comparison methods do not return NotImplemented when they should

2010-04-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- keywords: -patch stage: unit test needed -> needs patch ___ Python tracker <http://bugs.python.org/issue8005> ___ ___ Python-

[issue2810] _winreg.EnumValue sometimes raises WindowsError ("More data is available")

2010-04-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- assignee: -> stutzbach keywords: +needs review stage: needs patch -> patch review ___ Python tracker <http://bugs.python.org/

[issue6672] Add Mingw recognition to pyport.h to allow building extensions

2010-04-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- components: +Windows stage: -> patch review ___ Python tracker <http://bugs.python.org/issue6672> ___ ___ Python-bugs-list mai

[issue5553] Py_LOCAL_INLINE(type) doesn't actually inline except using MSC

2010-04-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- assignee: -> stutzbach priority: -> low stage: -> needs patch type: -> performance versions: +Python 3.2 -Python 2.7, Python 3.0, Python 3.1 ___ Python tracker <http://bugs.pytho

[issue4295] closing stdout in a child process on cygwin means that process doesn't receive bytes from stdin anymore. I think.

2010-04-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- resolution: -> works for me stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.o

[issue808164] socket.close() doesn't play well with __del__

2010-04-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- assignee: -> stutzbach versions: +Python 2.7, Python 3.2 -Python 2.5 ___ Python tracker <http://bugs.python.org/issue

[issue7079] file_close() ignores return value of close_the_file

2010-04-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- keywords: +needs review stage: -> patch review ___ Python tracker <http://bugs.python.org/issue7079> ___ ___ Python-bugs-lis

[issue7079] file_close() ignores return value of close_the_file

2010-04-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- assignee: gregory.p.smith -> stutzbach stage: patch review -> unit test needed ___ Python tracker <http://bugs.python.org/

[issue8005] datetime's comparison methods do not return NotImplemented when they should

2010-04-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- assignee: -> stutzbach ___ Python tracker <http://bugs.python.org/issue8005> ___ ___ Python-bugs-list mailing list Unsubscri

[issue8005] datetime's comparison methods do not return NotImplemented when they should

2010-04-27 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Thanks for pointing that out. For what it's worth, if I understand the documentation correctly the goal is to prevent the following misleading comparisons: date with time datetime with date datetime with time datetime w/ timezone with datetim

[issue808164] socket.close() doesn't play well with __del__

2010-04-27 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: The purpose of calling .close() in __del__ is to close the socket when the owner is destroyed yet the program is still running. This prevents the socket from staying open if some other part of the program has somehow acquired a reference to it. telnetlib

[issue2810] _winreg.EnumValue sometimes raises WindowsError ("More data is available")

2010-04-27 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Thank for the feedback. I'll revise the patch tomorrow based on your code-cleanup suggestions. To answer your question about the thread and explain why the test sometimes passes: The goal of test_changing_value is to try to trigger a race condition

[issue7584] datetime.rfcformat() for Date and Time on the Internet

2010-04-28 Thread Daniel Urban
Daniel Urban added the comment: Is anyone still interested in this? Is there a problem with my patch? Thanks. -- ___ Python tracker <http://bugs.python.org/issue7

[issue7584] datetime.rfcformat() for Date and Time on the Internet

2010-04-28 Thread Daniel Urban
Daniel Urban added the comment: > My Python code as well as your patch doesn't specify that "Z" must be > present when time zone offset is unknown or absent, Yes, that is because RFC 3339 explicitly says (in 4.3.) that -00:00 is "differs semantically from an offset

[issue2810] _winreg.EnumValue sometimes raises WindowsError ("More data is available")

2010-04-28 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Attached is a new test-case patch. -- Added file: http://bugs.python.org/file17122/winreg_test.patch ___ Python tracker <http://bugs.python.org/issue2

[issue2810] _winreg.EnumValue sometimes raises WindowsError ("More data is available")

2010-04-28 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Removed file: http://bugs.python.org/file16802/winreg_test.pach ___ Python tracker <http://bugs.python.org/issue2810> ___ ___ Python-bug

[issue2810] _winreg.EnumValue sometimes raises WindowsError ("More data is available")

2010-04-29 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: In the updated patch I uploaded yesterday, I increased the loop count from 100 to 1000 and it still runs virtually instantly. I also added a comment stating that the test is trying to trigger a race condition

[issue7079] file_close() ignores return value of close_the_file

2010-04-29 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Removed file: http://bugs.python.org/file15076/fileobject.diff ___ Python tracker <http://bugs.python.org/issue7079> ___ ___ Python-bug

[issue7079] file_close() ignores return value of close_the_file

2010-04-29 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Removed file: http://bugs.python.org/file15077/crash.py ___ Python tracker <http://bugs.python.org/issue7079> ___ ___ Python-bugs-list mailin

[issue7079] file_close() ignores return value of close_the_file

2010-04-29 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Added file: http://bugs.python.org/file17130/file_close_test.patch ___ Python tracker <http://bugs.python.org/issue7079> ___ ___ Python-bug

[issue7079] file_close() ignores return value of close_the_file

2010-04-29 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Added file: http://bugs.python.org/file17131/file_close.patch ___ Python tracker <http://bugs.python.org/issue7079> ___ ___ Python-bug

[issue7079] file_close() ignores return value of close_the_file

2010-04-29 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I reworked my test script into a unit test. Thanks for pointing me to test_file2k.py. I leveraged the infrastructure that was already there. I've also uploaded a new patch that uses tabs instead of spaces, to match the rest of fileobj

[issue808164] socket.close() doesn't play well with __del__

2010-04-29 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: How do I write a unit test to check that socket.__del__ doesn't refer to any globals? -- ___ Python tracker <http://bugs.python.org/iss

[issue7584] datetime.rfcformat() for Date and Time on the Internet

2010-04-29 Thread Daniel Urban
Daniel Urban added the comment: > I do not think that -00:00 or +00:00 will be invalid Atom timestamp, > but to implement parser of rfc3339 timestamp, Z handling is still > needed. I can easily imagine people making wrong assumption that > parsing 00:00 at the end would be enoug

[issue7584] datetime.rfcformat() for Date and Time on the Internet

2010-04-30 Thread Daniel Urban
Daniel Urban added the comment: > The point is that your implementation doesn't allow people to generate > 'Z'-ending timestamp if they need a subset of rfc3339. That is exactly right. Do you have any suggestion, how to do that? Maybe an optional argument to the rfcfor

[issue1641] asyncore delayed calls feature

2010-04-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I like the idea of leveraging the sched module. It encapsulates the priority queue, allowing the user to be agnostic to the underlying data structure. If someday we have a data structure in the collections module that provides an efficient delete-key

[issue5553] Py_LOCAL_INLINE(type) doesn't actually inline except using MSC

2010-04-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Attached is a patch. The diff to configure is just what autoconf produces as a result of the diff to configure.in. With the patch, pyconfig.h will: - do nothing if the compiler supports the "inline" keyword - #define inline to __inline or __i

[issue5553] Py_LOCAL_INLINE(type) doesn't actually inline except using MSC

2010-04-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I should add that the patch is against the py3k branch, since it's too late for performance improvements to land in trunk. -- ___ Python tracker <http://bugs.python.org/i

[issue8628] Incorrect numbers.Complex.imag documentation

2010-05-05 Thread Daniel Urban
New submission from Daniel Urban : The current documentation of the imag abstract property of numbers.Complex is this: "Abstract. Retrieves the Real component of this number." Of course the imag attribute is the imaginary component, not the real. -- assignee: d...@python

[issue8645] PyUnicode_AsEncodedObject is undocumented

2010-05-07 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : PyUnicode_AsEncodedObject is undocumented. It has the same signature as PyUnicode_AsEncodedString, although they do slightly different things based on a brief source code inspection (I'm not clear on what that difference is though). -- ass

[issue8646] PyUnicode_EncodeDecimal is undocumented

2010-05-07 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : PyUnicode_EncodeDecimal is undocumented (although it's referenced in passing in the documentation for PyLong_FromUnicode). There's a lengthy comment in unicodeobject.h describing PyUnicode_EncodeDecimal, which could be converted more or les

[issue8647] PyUnicode_GetMax is undocumented

2010-05-07 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : Here's the relevant signature: /* Get the maximum ordinal for a Unicode character. */ PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void); -- assignee: d...@python components: Documentation messages: 105206 nosy: d...@python, stutzbach priority: n

[issue8648] The UTF-7 codec functions are undocumented

2010-05-07 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : The UTF-7 codec functions are undocumented: PyUnicode_DecodeUTF7Stateful PyUnicode_DecodeUTF7 PyUnicode_EncodeUTF7 -- assignee: d...@python components: Documentation messages: 105207 nosy: d...@python, stutzbach priority: normal severity: normal

[issue8649] Py_UNICODE_* functions are undocumented

2010-05-07 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : Python provides several functions for manipulating raw Py_UNICODE strings, but they aren't documented. Below are their signatures. PyAPI_FUNC(size_t) Py_UNICODE_strlen(const Py_UNICODE *u); PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcpy( Py_UNICOD

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-07 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : Currently, Python can be built with an internal Unicode representation of UCS2 or UCS4. To prevent extension modules compiled with the wrong Unicode representation from linking, unicodeobject.h #defines many of the Unicode functions. For example

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-07 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- keywords: +patch Added file: http://bugs.python.org/file17248/unicode.patch ___ Python tracker <http://bugs.python.org/issue8

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-07 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Forcing the compile-time and link-time encodings to match is tricky. The goal is: - Allow Unicode-agnostic modules to link, regardless of unicode settings - Cause a link failure if the unicode settings are mismatched for a module that pokes into

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-07 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Adding people to the Nosy List who participated in the original thread on python-ideas, several months ago. Hope you don't mind. :-) -- nosy: +gvanrossum, scoder, zooko ___ Python tracker

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-07 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I've been thinking about this a bit more. There are three types of symbols in unicodeobject.h: 1. Functions that are always safe to use 2. Functions that are only safe if the module is compiled with the same Unicode settings as Python 3. Structure

[issue8659] ABS(x) == 0 can be simplified to x == 0

2010-05-07 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : I noticed that in longobject.c, there are a few spots that take the absolute value of an int before comparing the int to 0. There's no -0 for C integers, so the absolute value isn't necessary. I traced back through the commit history, and it

[issue8659] ABS(x) == 0 can be simplified to x == 0

2010-05-07 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- keywords: +needs review ___ Python tracker <http://bugs.python.org/issue8659> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue8660] py3k weakref documentation mentions the long built-in type

2010-05-08 Thread Daniel Urban
New submission from Daniel Urban : There is a sentence in the weakref module's documentation: "Other built-in types such as tuple and long do not support weak references even when subclassed" But there is no "long" type in py3k. -- assignee: d...@python

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-08 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Sat, May 8, 2010 at 5:03 AM, Marc-Andre Lemburg wrote: > If you can propose a different method of reliably protecting against > mixed Unicode build module loads, that would be great. We could then > get rid off the wrapping altogether. The follo

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-08 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Sat, May 8, 2010 at 10:16 AM, Marc-Andre Lemburg wrote: > Are you sure this doesn't get optimized away in practice ? I'm sure it doesn't get optimized away by gcc 4.3, where I tested it. :) > Sure, though, I don't see how this

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-08 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Sat, May 8, 2010 at 8:07 AM, Martin v. Löwis wrote: > 1. add a flag to PyModuleDef, indicating whether the module was built in > UCS-2 or UCS-4 mode. Then let the interpreter refuse the load the module, > instead of having the dynamic linker d

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-08 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Sat, May 8, 2010 at 11:02 AM, Martin v. Löwis wrote: > Did you mean to include the hunk from msg105295 as part of the patch? > If so, wouldn't that defeat the whole point of the patch? My intention is to offer two compilation modes to extens

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-08 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Sat, May 8, 2010 at 11:20 AM, Martin v. Löwis wrote: > I'd rather modify PyModuleDef_Base, to include a flags field, and > perhaps put the api version into it, as well. That's an ABI change, > unfortunately, but such a flags field

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-08 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Sat, May 8, 2010 at 11:35 AM, Marc-Andre Lemburg wrote: > One of the more important cases you are missing is the > argument parser in Python: Thanks. I've had my head buried in c-api/unicode.html and unicodeobject.h. > Py_UNICODE *x;

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-05-08 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: In Unicode-agnostic mode, instead of leaving Py_UNICODE, PyUnicodeObject, and many functions undefined, I wonder if it would be sufficient to declare Py_UNICODE like this: struct PY_UNICODE_TYPE; typedef struct PY_UNICODE_TYPE Py_UNICODE; That would allow

[issue6507] Enhance dis.dis to autocompile codestrings

2010-05-08 Thread Daniel Urban
Daniel Urban added the comment: Done. Attached new patch as issue6507_2_priv.diff. -- Added file: http://bugs.python.org/file17265/issue6507_2_priv.diff ___ Python tracker <http://bugs.python.org/issue6

[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-05-08 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : Using a UCS2 Python on a platform with a 32-bit wchar_t, the following code throws an exception (but should not): >>> ctypes.c_wchar('\u1') Traceback (most recent call last): File "", line 1, in TypeError: one character

<    2   3   4   5   6   7   8   9   10   11   >