[issue10980] http.server Header Unicode Bug

2011-01-22 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: I have a critical bugfix that should make it into Python 3.2 even when it's in release candidate state. Currently http.server.BaseHTTPServer encodes headers with ASCII charset. This is at least in violation with PEP which

[issue10980] http.server Header Unicode Bug

2011-01-22 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Georg Brandl signed off the commit and Python 3.2 will ship with the HTTP server accepting latin1 bytes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10980

[issue2226] Small _abcoll Bugs / Oddities

2008-03-03 Thread Armin Ronacher
Changes by Armin Ronacher: -- components: Library (Lib) nosy: aronacher severity: normal status: open title: Small _abcoll Bugs / Oddities versions: Python 3.0 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2226

[issue2226] Small _abcoll Bugs / Oddities

2008-03-03 Thread Armin Ronacher
New submission from Armin Ronacher: _abcoll.py references intertools.chain but doesn't import it. This breaks Set subclasses. Additionally the abstract base classes don't provide the right hand operator callbacks or how you want to call them. So __add__ is there but __radd__ not which

[issue2246] itertools.groupby() leaks memory with circular reference

2008-03-06 Thread Armin Ronacher
Changes by Armin Ronacher: -- nosy: +aronacher __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2246 __ ___ Python-bugs-list mailing list Unsubscribe: http

[issue1810] AST compile() patch

2008-03-22 Thread Armin Ronacher
Changes by Armin Ronacher [EMAIL PROTECTED]: -- nosy: +aronacher __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1810 __ ___ Python-bugs-list mailing list Unsubscribe

[issue2460] Ellipsis not copyable

2008-03-22 Thread Armin Ronacher
New submission from Armin Ronacher [EMAIL PROTECTED]: Currently python raises an exception if one tries to copy or deepcopy Ellpisis. The former is usually no problem but if an ellipsis ends up on an object and becomes deepcopied this is pretty annoying. The patch provided adds Ellipsis

[issue9368] Const-Correctness for Method Calls

2010-07-24 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: The following patch changes some parts of the public C API for const correctness which would help C++ programmers. The original patch was provided by neXyon on irc.freenode.net. It does not produce any compiler warnings on GCC

[issue9775] Multiprocessing, logging and atexit play not well together

2010-09-04 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: It's hard to say what exactly is to blame here, but I will try to outline the problem as good as I can and try to track it down: A library of mine is using a Thread that is getting entries from a multiprocessing.Queue

[issue9775] Multiprocessing, logging and atexit play not well together

2010-09-04 Thread Armin Ronacher
Changes by Armin Ronacher armin.ronac...@active-4.com: -- keywords: +patch Added file: http://bugs.python.org/file18746/9775-fix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9775

[issue9775] Multiprocessing, logging and atexit play not well together

2010-09-04 Thread Armin Ronacher
Changes by Armin Ronacher armin.ronac...@active-4.com: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9775 ___ ___ Python

[issue9775] Multiprocessing, logging and atexit play not well together

2010-09-04 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: This also affects 2.7, I just worked on 2.6 because this is where I encountered the issue. As for 2.7: please try explaining again what specific issue the patch is meant to resolve? What monkey-patching are you referring to? What

[issue9775] Multiprocessing, logging and atexit play not well together

2010-09-04 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Put the stuff from an older version back in with a monkeypatch and you will see the issue again. There are certainly many more ways to trigger that issue, that was just the easiest. I will try to create a simpler test case

[issue9867] Interrupted system calls are not retried on OS X

2010-09-15 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: Currently Python does not check fread and other IO calls for EINTR. This usually is not an issue, but on OS X a continued program will be sent an SIGCONT signal which causes fread to be interrupted. Testcase: mitsuh...@nausicaa

[issue9867] Interrupted system calls are not retried

2010-09-16 Thread Armin Ronacher
Changes by Armin Ronacher armin.ronac...@active-4.com: -- versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9867 ___ ___ Python

[issue9867] Interrupted system calls are not retried

2010-09-16 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: One could argue of course that every user of Python should handle EINTR, but that's something I think should be solved in the IO library because very few people know that one is supposed to restart syscalls on EINTR on POSIX systems

[issue9867] Interrupted system calls are not retried

2010-09-16 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Interestingly even PHP handles that properly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9867

[issue9867] Interrupted system calls are not retried

2010-09-16 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Hmm. So under what conditions should it continue, and under what conditions should it raise an exception (when errno is EINTR)? EINTR indicates a temporary failure. In that case it should always retry. A common macro

[issue9867] Interrupted system calls are not retried

2010-09-16 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: The following minimal C code shows how EINTR can be handled: #include stdlib.h #include stdio.h #include errno.h #include signal.h #define BUFFER_SIZE 1024 int main() { char buffer[BUFFER_SIZE]; printf(PID = %d\n, getpid

[issue9867] Interrupted system calls are not retried

2010-09-16 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Wouldn't retrying on EINTR cause havoc when you try to interrupt a process? All your C applications are doing it, why should Python cause havok there? Check the POSIX specification on that if you don't trust me. That is: what

[issue9867] Interrupted system calls are not retried

2010-09-16 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: There is a funny story related to that though :) BSD avoids EINTR entirely and provides a more convenient approach: to restart the interrupted primitive, instead of making it fail. BSD does, but the Mach/XNU kernel combo on OS X

[issue9867] Interrupted system calls are not retried

2010-09-16 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: setting the SA_RESTART in the call to sigaction should work (on OSX HAVE_SIGACTION is defined), unless the manpage is lying. It should work, haven't tried. From what I understand on a BSD system, retrying is the default

[issue9867] Interrupted system calls are not retried

2010-09-16 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: You conveniently didn't quote the part of my message where I explained why I think there may be a problem. I understand that, but there are already cases in Python where EINTR is handled properly. In fact, quoting socketmodule.c

[issue9945] Improper locking in logging

2010-09-25 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: I found a a useless lock acquiring in the 27 maintenance branch in logging and a missing one as well: Logger.removeHandler() locks around a handler lock, however the code executed in this lock is not depending on anything

[issue9947] Weird locking in logging config system

2010-09-25 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: Another case of improper locking in logging. The stopListening() method of the logging config acquires the logging lock, but it doesn't do it early enough. In order for this function to be thread safe it would have to lock

[issue9948] findCaller is slow and loses case information on Windows

2010-09-25 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: findCaller() on loses case information on the files on Windows and has in general a really bad performance. The attached patch does not depend on filename comparisions and instead compares the object identity of the caller's

[issue9948] findCaller is slow and loses case information on Windows

2010-09-25 Thread Armin Ronacher
Changes by Armin Ronacher armin.ronac...@active-4.com: Added file: http://bugs.python.org/file19009/find-caller.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9948

[issue9948] findCaller is slow and loses case information on Windows

2010-09-25 Thread Armin Ronacher
Changes by Armin Ronacher armin.ronac...@active-4.com: Removed file: http://bugs.python.org/file19008/find-caller.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9948

[issue9948] findCaller is slow and loses case information on Windows

2010-09-26 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: 1. Users can use _srcFile = None to avoid calling findCaller() altogether, so I can't do away with the _srcFile altogether as it may cause some issues with existing code. That is very undocumented behaviour and relying

[issue4067] ast.fix_missing_locations() breaks if node doesn't have _attributes variable

2008-10-07 Thread Armin Ronacher
Armin Ronacher [EMAIL PROTECTED] added the comment: The root of the problem is that ast.AST doesn't have _fields or _attributes. I think the better solution is to add these attributes to the root class which makes it easier to work with these objects. I attached a diff for asdl_c.py which

[issue4067] ast.fix_missing_locations() breaks if node doesn't have _attributes variable

2008-10-19 Thread Armin Ronacher
Armin Ronacher [EMAIL PROTECTED] added the comment: Fixed in changeset 66973 for trunk. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4067 ___ ___ Python-bugs

[issue4067] ast.fix_missing_locations() breaks if node doesn't have _attributes variable

2008-10-19 Thread Armin Ronacher
Changes by Armin Ronacher [EMAIL PROTECTED]: -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4067

[issue4062] Reference to non-existent __version__ in ast module

2008-10-20 Thread Armin Ronacher
Armin Ronacher [EMAIL PROTECTED] added the comment: Fixed in changeset 66984. -- resolution: - fixed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4062

[issue4590] 2to3 strips trailing L for long iterals in two fixers

2008-12-08 Thread Armin Ronacher
New submission from Armin Ronacher [EMAIL PROTECTED]: I noticed that fix_long and fix_numliterals both strip trailing Ls from numbers. That's redudant, one of them should be enough. I attached a patch that removes the literal changing from the fix_long fixer. Because I'm not sure if that may

[issue3563] fix_idioms.py generates bad code

2008-12-08 Thread Armin Ronacher
Armin Ronacher [EMAIL PROTECTED] added the comment: I would drop the prefix in that case or attach it to the sorted() call. So from this code: x = foo() # perform sorting x.sort() to # perform sorting x = sorted(foo()) Makes more sense than sticking it after the sorted

[issue2734] 2to3 converts long(itude) argument to int

2008-12-08 Thread Armin Ronacher
Armin Ronacher [EMAIL PROTECTED] added the comment: This could probably be fixed by adding a `is_builtin` helper function to the fixer_util module that checks if the name is not overriden in the module. I would use something like a weak dictionary for the `find_binding` function because

[issue2356] fixer for sys.exitfunc - atexit

2008-12-08 Thread Armin Ronacher
Armin Ronacher [EMAIL PROTECTED] added the comment: Since yesterday there is a handy little helper that adds imports to files which is already used for the reduce() / intern() fixers. This makes this fix a lot easier. I attached a version that does that. However the import adder is not yet

[issue2899] Fixers find, rfind, etc in 'string' module

2008-12-08 Thread Armin Ronacher
Changes by Armin Ronacher [EMAIL PROTECTED]: -- nosy: +aronacher ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2899 ___ ___ Python-bugs-list mailing

[issue2454] sha and md5 fixer

2008-12-08 Thread Armin Ronacher
Changes by Armin Ronacher [EMAIL PROTECTED]: -- nosy: +aronacher ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2454 ___ ___ Python-bugs-list mailing

[issue2805] 2to3 doesn't correct divisions

2008-12-08 Thread Armin Ronacher
Changes by Armin Ronacher [EMAIL PROTECTED]: -- nosy: +aronacher ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2805 ___ ___ Python-bugs-list mailing

[issue2899] Fixers find, rfind, etc in 'string' module

2008-12-08 Thread Armin Ronacher
Armin Ronacher [EMAIL PROTECTED] added the comment: 2to3 could handle it, but it would be a lot of work for something unnecessary. You can use s.replace(a, b) instead of string.replace(s, a, b) since at least 2.0. ___ Python tracker [EMAIL PROTECTED] http

[issue4590] 2to3 strips trailing L for long iterals in two fixers

2008-12-08 Thread Armin Ronacher
Armin Ronacher [EMAIL PROTECTED] added the comment: Patch applied in [67679]. The tests were nearly the same, even with the same numbers :) -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org

[issue4590] 2to3 strips trailing L for long iterals in two fixers

2008-12-08 Thread Armin Ronacher
Changes by Armin Ronacher [EMAIL PROTECTED]: -- stage: patch review - committed/rejected ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4590

[issue4907] ast.literal_eval does not properly handled complex numbers

2009-01-10 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: ast.literal_eval does not properly handle complex numbers: ast.literal_eval(1j) 1j ast.literal_eval(2+1j) Traceback (most recent call last): ... ValueError: malformed string ast.literal_eval((2+1j)) Traceback (most recent call

[issue4907] ast.literal_eval does not properly handled complex numbers

2009-01-10 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: fixed patch :) Added file: http://bugs.python.org/file12675/literal-eval.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4907

[issue4907] ast.literal_eval does not properly handled complex numbers

2009-01-12 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Here a patch with unittests to correctly handle complex numbers. This does not allow the user of arbitrary add/sub expressions on complex numbers. Added file: http://bugs.python.org/file12707/literal-eval.patch

[issue4907] ast.literal_eval does not properly handled complex numbers

2009-01-13 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: literal_eval has eval() semantics and not complex() constructor semantics. It accepts what eval() accepts just without arithmetic and unsafe features. For exmaple (2 + 4j) is perfectly fine even though the complex call only supports

[issue4907] ast.literal_eval does not properly handled complex numbers

2009-01-13 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Indeed, it accepts parentheses in 2.6 now, but not in 2.5 or earlier. Why not the other way round? Somewhere there has to be a limit. And if you write down complex numbers you usually have the imaginary part after the real part

[issue4907] ast.literal_eval does not properly handled complex numbers

2009-01-13 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Fixed in rev68571. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4907

[issue4907] ast.literal_eval does not properly handled complex numbers

2009-01-13 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Why didn't you use assertRaises in place of that try/except for a test ? Could be changed. I was somewhat following this issue and just saw it being commited, but the change was being discussed. Aren't you supposed to commit

[issue2514] new AST init breaks on Store and other fieldless Nodes

2008-03-30 Thread Armin Ronacher
New submission from Armin Ronacher [EMAIL PROTECTED]: #2505 adds a new init to the ast nodes that allows initialization of the fields directory from the constructor. Unfortunately there are nodes where fields is None (_ast.Store and others) and the constructor didn't take care

[issue3530] ast.NodeTransformer bug

2008-08-16 Thread Armin Ronacher
Armin Ronacher [EMAIL PROTECTED] added the comment: This is actually not a bug. copy_location does not work recursively. For this example it's more useful to use the fix_missing_locations function which traverses the tree and copies the locations from the parent node to the child nodes

[issue3689] listreverseiterator has a decreasing len()

2008-08-26 Thread Armin Ronacher
Armin Ronacher [EMAIL PROTECTED] added the comment: Just for the record. This original discussion for this bug is here: http://article.gmane.org/gmane.comp.python.devel/96925 -- nosy: +aronacher ___ Python tracker [EMAIL PROTECTED] http

[issue6247] should we include argparse

2009-09-14 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Why does this have to go into the standard library? People that want to use it can still install it from PyPI. -sys.maxint from me. -- nosy: +aronacher ___ Python tracker rep

[issue6247] should we include argparse

2009-09-14 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: @Armin: Doesn't that argument apply to *any* library proposed for inclusion in the standard library? By which logic we should never add anything to the standard library ever again. That's what I say. Do not add anything

[issue6247] should we include argparse

2009-09-14 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: I can respect that viewpoint. So what do you propose to do with existing modules like optparse that aren't required to make platform independent applications and are out of date and basically unmaintained? One option would

[issue6247] should we include argparse

2009-09-14 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: It must be convenient to operate in an environment where you can install new software so easily Armin. Trust me, it is. For others (including me), the actual package installation is the least of our hassles and anything

[issue6945] pprint.pprint does not pprint unsortable dicts in Python 3

2009-09-19 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: Currently pprint does not work on dicts it cannot sort. Because in Python 3 sorted(x.items()) is no longer guaranteed to work a new sorting solution has to be found. -- messages: 92862 nosy: aronacher severity: normal

[issue6945] pprint.pprint does not pprint unsortable dicts in Python 3

2009-09-20 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Yes. Appears to be related. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6945

[issue3976] pprint._safe_repr is not general enough in one instance

2009-09-20 Thread Armin Ronacher
Changes by Armin Ronacher armin.ronac...@active-4.com: -- nosy: +aronacher ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3976 ___ ___ Python-bugs

[issue6945] pprint.pprint does not pprint unsortable dicts in Python 3

2009-09-20 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Duplicate of #3976 -- resolution: - duplicate ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6945

[issue6945] pprint.pprint does not pprint unsortable dicts in Python 3

2009-09-20 Thread Armin Ronacher
Changes by Armin Ronacher armin.ronac...@active-4.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6945 ___ ___ Python

[issue3976] pprint._safe_repr is not general enough in one instance

2009-09-20 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: @Georg: Instead of catching a TypeError i would rather call __gt__ / __lt__ directly and check for NotImplemented. Python 2.x did not catch TypeErrors either. -- ___ Python tracker rep

[issue3976] pprint._safe_repr is not general enough in one instance

2009-09-20 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Eg, something like this: class safe_key(object): __slots__ = ('obj',) def __init__(self, obj): self.obj = obj def __eq__(self, other): return self.obj.__eq__(other.obj) def __lt__(self, other

[issue11573] Improve Unicode Documentation with Known Caveats

2011-03-16 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: The documentation should explain some of the common problems with Unicode on Python 3. * locale's affect the text default encoding * SSH clients can set the locale on a remote server * filesystem encoding is set by the SSH

[issue11574] Unicode Fallback Encoding on Python 3.3

2011-03-16 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: Right now Python happily falls back to ASCII if it can not parse your LC_CTYPE or something similar happens. Instead of falling back to ASCII it would be better if it falls back to UTF-8. Alternatively it should at least give

[issue11574] Unicode Fallback Encoding on Python 3.3

2011-03-16 Thread Armin Ronacher
Changes by Armin Ronacher armin.ronac...@active-4.com: -- assignee: - loewis nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11574

[issue6210] Exception Chaining missing method for suppressing context

2011-03-16 Thread Armin Ronacher
Changes by Armin Ronacher armin.ronac...@active-4.com: -- nosy: +aronacher ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6210 ___ ___ Python-bugs

[issue11682] PEP 380 reference implementation for 3.3

2011-10-07 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: A little bit of input on this issue. Considering that exceptions are now getting keyword arguments for things like import errors and other things for attributes I would find it much better if StopIteration would follow

[issue415492] Compiler generates relative filenames

2011-10-16 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: The reason why this is a problem: $ cat test.py def foo(): pass import test, os, inspect os.chdir('/') inspect.getsource(test) 'def foo():\npass\n' But import test, os, inspect os.chdir('/') inspect.getsource(test

[issue10980] http.server Header Unicode Bug

2011-11-18 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: 2.7 does not suffer from this since 2.7 does not support unicode in headers. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10980

[issue12575] add a AST validator

2011-07-16 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: I see what you did there :P -- nosy: +aronacher ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12575

[issue14711] Remove os.stat_float_times

2012-05-03 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: Is there a specific reason this is still around? Originally that was to make it possible to upgrade to Python 2.3 or whenever that was introduced. I don't think anyone still uses that. -- messages: 159859 nosy

[issue16148] Implement PEP 424

2012-10-06 Thread Armin Ronacher
Armin Ronacher added the comment: Reviewed and applied. Looks good. -- nosy: +aronacher ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16148

[issue16148] Implement PEP 424

2012-10-06 Thread Armin Ronacher
Changes by Armin Ronacher armin.ronac...@active-4.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16148 ___ ___ Python

[issue5284] platform.linux_distribution() improperly documented

2009-02-16 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: platform.linux_distribution() was added in 2.6 as an alias for platform.dist(). However the documentation lists platform.dist() as an alias for platform.linux_distribution() and there is no information that the latter appered

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-02-19 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: In 2.6 a deprecation warning was added if `object.__new__` was called with arguments. Per se this is fine, but the detection seems to be faulty. The following code shows the problem: class A(object): ... def __new__(self

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-02-19 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: The problem seems to be caused by tp_new being slot_tp_new which then invokes whatever __new__ in the class dict is. I'm not so sure what would be the solution to this. One could of course check if tp_new is either object_new

[issue5381] json need object_pairs_hook

2009-02-27 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Motivation: Yes. JSON says it's unordered. However Hashes in Ruby are ordered since 1.9 and they were since the very beginning in JavaScript and PHP. -- nosy: +aronacher ___ Python

[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: @Georg * eval()ing the repr() will not construct the dict in the same order The alternative would be a list of dicts inside the constructor call, but that feels ugly. defaultdict from the same module is not evaluable at all, so I

[issue5401] mimetypes.MAGIC_FUNCTION implementation clusterfuck

2009-03-01 Thread Armin Ronacher
New submission from Armin Ronacher armin.ronac...@active-4.com: Sorry for the harsh words, but when I found that code I nearly freaked out. For all those years I was using from mimetypes import guess_type until today I found out that this has horrendous performance problems due to the fact

[issue5401] mimetypes.MAGIC_FUNCTION performance problems

2009-03-01 Thread Armin Ronacher
Changes by Armin Ronacher armin.ronac...@active-4.com: -- title: mimetypes.MAGIC_FUNCTION implementation clusterfuck - mimetypes.MAGIC_FUNCTION performance problems ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5401

[issue1355826] shutil.move() does not preserve ownership

2009-03-02 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: While this is surprising, this is documented behavior: If the destination is on the current filesystem, then simply use rename. Otherwise, copy src (with copy2()) to the dst and then remove src. And copy2() uses copystat() and does

[issue5405] There is no way of determining which ABCs a class is registered against

2009-03-02 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: I don't think this can be solved. Not only do registered classes not show up (which could be fixed by providing something like inspect.getfakemro) but ABCs can also perform duck-type checks. For example a class with an __iter__

[issue5405] There is no way of determining which ABCs a class is registered against

2009-03-02 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: I suppose it would be a good idea to fix part of that problem in Sphinx (and probably also in pydoc) by adding something like :implements: MutableMapping in the docstring. So that this is explicitly added to the docstring

[issue5397] PEP 372: OrderedDict

2009-03-02 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Maybe premature optimization but maybe it would make sense to implement __eq__ like this: def __eq__(self, other): if isinstance(other, OrderedDict): if not dict.__eq__(self, other): return False

[issue5397] PEP 372: OrderedDict

2009-03-03 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Please no. We just decided to *not* extend the API. The PEP originally had a well designed list of dict API extensions that already provided exactly that. If we really want to provide access to that, we can roll back to where we

[issue5397] PEP 372: OrderedDict

2009-03-03 Thread Armin Ronacher
Armin Ronacher armin.ronac...@active-4.com added the comment: Please no. We just decided to *not* extend the API. The PEP originally had a well designed list of dict API extensions that already provided exactly that. If we really want to provide access to that, we can roll back to where we

[issue5397] PEP 372: OrderedDict

2009-03-03 Thread Armin Ronacher
Changes by Armin Ronacher armin.ronac...@active-4.com: ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5397 ___ ___ Python-bugs-list mailing list Unsubscribe

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-06 Thread Armin Ronacher
New submission from Armin Ronacher: I just noticed through looking through someone else's WSGI framework that wsgiref is incorrectly handling URL handling. It does not go through the WSGI coding dance in the wsgiref.utils.request_uri function. Testcase through werkzeug: from wsgiref.util

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-10 Thread Armin Ronacher
Armin Ronacher added the comment: Which version and bugfix release are you using? You can reproduce it against the current development version of Python 3. What is werkzeug and what does it have to do with stdlib urllib? Werkzeug is a WSGI implementation. An stdlib test cannot depend

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-10 Thread Armin Ronacher
Armin Ronacher added the comment: What it currently returns: from wsgiref.util import request_uri request_uri({ ... 'wsgi.url_scheme': 'http', ... 'SCRIPT_NAME': '', ... 'PATH_INFO': '/\xe2\x98\x83', ... 'SERVER_PORT': '80', ... 'SERVER_NAME': 'localhost' ... }) 'http://localhost/%C3%A2

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-11 Thread Armin Ronacher
Armin Ronacher added the comment: Two things wrong with your example: a) PATH_INFO on Python 3 must not be bytes b) PATH_INFO on Python 3 must be latin1 transfer encoded. See unicode_to_wsgi and wsgi_to_bytes functions in PEP . -- ___ Python

[issue20839] pkgutil.get_loader throws deprecation warning due to internal deprecation

2014-03-02 Thread Armin Ronacher
New submission from Armin Ronacher: pkgutil.get_loader calls pkgutil.find_loader which calls importlib.find_loader The latter logs a deprecation warning about it being replaced by importlib.util.find_spec. This is a regression in 3.4 as far as I can see. -- keywords: 3.4regression

[issue20839] pkgutil.get_loader throws deprecation warning due to internal deprecation

2014-03-03 Thread Armin Ronacher
Armin Ronacher added the comment: This also happens with the latest hg version. I could not make an isolated test case unfortunately but it happens on the flask testsuite if run on 3.4. -- ___ Python tracker rep...@bugs.python.org http

[issue21235] importlib's spec module create algorithm is not exposed

2014-04-15 Thread Armin Ronacher
New submission from Armin Ronacher: 3.4 deprecates load_module on the loaders and now proposes to use create_module (optionally) and exec_module. Unfortunately for external callers these interfaces are not useful because you need to reimplement _SpecMethods.create and a whole bunch of other

[issue21235] importlib's spec module create algorithm is not exposed

2014-04-15 Thread Armin Ronacher
Armin Ronacher added the comment: On further investigation that is not even enough yet due to the new locking mechanism. I'm not even sure if exposing _SpecMethods would be enough. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue21235] importlib's spec module create algorithm is not exposed

2014-04-15 Thread Armin Ronacher
Armin Ronacher added the comment: I'm not sure myself what I need right now. I personally have avoided importlib/imp entirely for my code and I roll with manual module creation because it is most stable between 2.6 - 3.4 but it's getting more complicated to work because of all the new

[issue21235] importlib's spec module create algorithm is not exposed

2014-04-15 Thread Armin Ronacher
Armin Ronacher added the comment: Also mostly unrelated importlib now does something I have never seen an ABC do: the ABC has create_module but concrete implementations mostly have that function entirely absent. That should probably be reconsidered as it's super confusing

[issue21288] hashlib.pbkdf2_hmac Hash Constructor

2014-04-17 Thread Armin Ronacher
New submission from Armin Ronacher: Is there a specific reason why hashlib.pbkdf2_hmac now has a completely inconsistent API with the rest of the stdlib? So far the concept in both hashlib and hmac has been to accept hash constructors as parameters. As such you would expect the API to look

  1   2   >