[issue20420] BufferedIncrementalEncoder violates IncrementalEncoder interface

2014-01-31 Thread Walter Dörwald
Walter Dörwald added the comment: I dug up an ancient email about that subject: >>> However, I've discovered that BufferedIncrementalEncoder.getstate() >>> doesn't match the specification (i.e. it returns the buffer, not an >>> int). However this class is

[issue20520] Readline test in test_codecs is broken

2014-02-05 Thread Walter Dörwald
Walter Dörwald added the comment: "\n \r\n \r \u2028".split() should have been "\n \r\n \r \u2028".split(" "), i.e. a list of different line ends. > The purpose of these tests is not entirely clear, so I'm not sure that it is > properly grasped t

[issue20520] Readline test in test_codecs is broken

2014-02-05 Thread Walter Dörwald
Walter Dörwald added the comment: True, here's an updated patch. -- Added file: http://bugs.python.org/file33933/fix_linetests2.diff ___ Python tracker <http://bugs.python.org/is

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-08-12 Thread Walter Dörwald
Changes by Walter Dörwald : -- nosy: -doerwalter ___ Python tracker <http://bugs.python.org/issue2636> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7138] elementtree segfaults on invalid xml declaration

2009-10-15 Thread Walter Dörwald
Walter Dörwald added the comment: Here is a stacktrace of the crash with the system Python 2.6.1 on Mac OS X 10.6.1: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x00010100 0x7fff810f96b8 in XML_SetEncoding () (gdb) bt #0

[issue7185] csv reader utf-8 BOM error

2009-10-22 Thread Walter Dörwald
Walter Dörwald added the comment: http://docs.python.org/library/csv.html#module-csv states: This version of the csv module doesn’t support Unicode input. Also, there are currently some issues regarding ASCII NUL characters. Accordingly, all input should be UTF-8 or printable ASCII to be safe

[issue7185] csv reader utf-8 BOM error

2009-10-22 Thread Walter Dörwald
Walter Dörwald added the comment: Then the solution should simply be to use "utf-8-sig" as the encoding, instead of "utf-8". -- ___ Python tracker <http://bu

[issue7267] format method: c presentation type broken

2009-11-10 Thread Walter Dörwald
Walter Dörwald added the comment: Done: issue 7300. -- ___ Python tracker <http://bugs.python.org/issue7267> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7300] Unicode arguments in str.format()

2009-11-10 Thread Walter Dörwald
New submission from Walter Dörwald : str.format() doesn't handle unicode arguments: Python 2.6.4 (r264:75706, Oct 27 2009, 15:18:04) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information

[issue7309] crasher in str(Exception())

2009-11-16 Thread Walter Dörwald
Walter Dörwald added the comment: >> I'm not sure what the functions should do when start and end are >> out of range. > > I think the best approach would be to prevent these values to be out of > range in the first place. The start and end values should be clipped,

[issue7651] Python3: guess text file charset using the BOM

2010-01-09 Thread Walter Dörwald
Walter Dörwald added the comment: IMHO this is the wrong approach. As Martin v. Löwis suggested here http://mail.python.org/pipermail/python-dev/2010-January/094841.html the best solution would be a new codec (which he named sniff), that autodetects the encoding on reading. This doesn&#

[issue5640] Wrong print() result when unicode error handler is not 'strict'

2009-04-01 Thread Walter Dörwald
Walter Dörwald added the comment: I can confirm this problem in the current version in the py3k branch. This seems to be a problem in the CJK codecs. Assigning to Hye Shik Chang. -- assignee: -> hyeshik.chang nosy: +doerwalter, hyeshik.chang stage: -> needs

[issue5640] Wrong print() result when unicode error handler is not 'strict'

2009-04-03 Thread Walter Dörwald
Walter Dörwald added the comment: Indeed this patch does fix the bug. Go ahead and check it in. -- ___ Python tracker <http://bugs.python.org/issue5640> ___ ___

[issue5723] Incomplete json tests

2009-04-08 Thread Walter Dörwald
Walter Dörwald added the comment: test_quopri has a decorator that calls a test using both the C and Python version of the tested function. This decorator looks like this: def withpythonimplementation(testfunc): def newtest(self): # Test default implementation testfunc(self

[issue5729] Allows tabs for indenting JSON output

2009-04-09 Thread Walter Dörwald
New submission from Walter Dörwald : This patchs makes it possible to use tabs for indenting the output of json.dumps(). With this patch the indent argument can now be either an integer specifying the number of spaces per indent level or a string specifying the indent string directly

[issue5108] Invalid UTF-8 ("%s") length in PyUnicode_FromFormatV()

2009-04-09 Thread Walter Dörwald
Walter Dörwald added the comment: The problem with your patch is that it calls PyUnicode_DecodeUTF8() twice. It would be better if step 1 in the code would include the %s format specifiers and step 3 would then call PyUnicode_DecodeUTF8() and put the result into the callresults buffer. BTW, I

[issue5828] Invalid behavior of unicode.lower

2009-04-24 Thread Walter Dörwald
Walter Dörwald added the comment: It *does* return u'\u1d79' for me on Python 2.5.2: >>> u'\u1d79'.lower() u'\u1d79' >>> import sys >>> sys.version '2.5.2 (r252:60911, Apr 8 2008, 18:54:00) \n[GCC 3.3.5 (Debian 1:3.3.5-13)]

[issue5828] Invalid behavior of unicode.lower

2009-04-24 Thread Walter Dörwald
Walter Dörwald added the comment: The following patch fixes the problem for me, however it breaks the test suite. The change seems to have been introduced in r66362. Assigning to Martin. -- assignee: -> loewis nosy: +loewis stage: -> patch review Added file: http://bugs.pyth

[issue5828] Invalid behavior of unicode.lower

2009-04-24 Thread Walter Dörwald
Walter Dörwald added the comment: Updated the patch (diff2.txt) as requested by Amaury. -- Added file: http://bugs.python.org/file13759/diff2.txt ___ Python tracker <http://bugs.python.org/issue5

[issue4951] failure in test_httpservers

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: There's an EnvironmentVarGuard context manager in support.py that IMHO should be used for recording changes to the environment variables. Or a new context manager that does what your patch does could be put into support.py. There might be other tests

[issue5828] Invalid behavior of unicode.lower

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: Here is a third version of the patch. AFAICT the logic of the unicode database is as follows: * If the NODELTA_MASK is not set, delta is an offset. * If NODELTA_MASK is set and delta is != 0, delta is the upper/lower/title case character. * If NODELTA_MASK is

[issue4951] failure in test_httpservers

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: Hmm, EnvironmentVarGuard seems to be broken: import os from test import support with support.EnvironmentVarGuard() as env: env.unset("HOME") env.set("HOME", "bar") print(os.environ.get("HOME")) I would have

[issue5837] support.EnvironmentVarGuard broken

2009-04-25 Thread Walter Dörwald
New submission from Walter Dörwald : support.EnvironmentVarGuard seems to be broken: import os from test import support print(os.environ.get("HOME")) with support.EnvironmentVarGuard() as env: env.unset("HOME") env.set("HOME", "foo") print(os.e

[issue5837] support.EnvironmentVarGuard broken

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: Here's a patch that changes EnvironmentVarGuard to make a copy of os.environ at the start. The set and unset methods are useless now, but I left them in for backwards compatibility. Should they be removed? -- Added file: http://bugs.pytho

[issue5837] support.EnvironmentVarGuard broken

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: That's exactly what I was thinking too. Here's the patch. Running the test suite now. -- Added file: http://bugs.python.org/file13764/diff2.txt ___ Python tracker <http://bugs.python.

[issue5837] support.EnvironmentVarGuard broken

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: If you want to restore only those environment variables that have change you somehow have to record which *do* have changed, i.e. you'd have to go through EnvironmentVarGuard again. I'm working on a patch that

[issue5837] support.EnvironmentVarGuard broken

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: OK, I'll remove the clear method (which is a new feature) and then check it in. -- ___ Python tracker <http://bugs.python.org/i

[issue5837] support.EnvironmentVarGuard broken

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: This might have something to do with the _keymap hook. -- ___ Python tracker <http://bugs.python.org/issue5837> ___ ___ Pytho

[issue5837] support.EnvironmentVarGuard broken

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: You're right checking both in unset() and __exit__() fixes the importlib failures. I'll check in the fix. -- ___ Python tracker <http://bugs.python.

[issue5837] support.EnvironmentVarGuard broken

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: Checked in: r71875 (trunk) r71876 (release26-maint) r71881 (py3k) r71885 (release30-maint) -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue5828] Invalid behavior of unicode.lower

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: I've merged your version of the patch with my changes to the test suite and regenerated the Unicode database. Attached is the resulting patch (diff4.txt) -- Added file: http://bugs.python.org/file13768/diff

[issue5828] Invalid behavior of unicode.lower

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: Checked in: r71894 (trunk) r71895 (release26-maint) -- ___ Python tracker <http://bugs.python.org/issue5828> ___ ___ Python-bug

[issue5828] Invalid behavior of unicode.lower

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: Checked in: r71896 (py3k) r71897 (release30-maint) -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue5828] Invalid behavior of unicode.lower

2009-04-25 Thread Walter Dörwald
Walter Dörwald added the comment: BTW, are the steps to regenerate the Unicode database documented somewhere? What I did was: cp /Volumes/ftp.unicode.org/Public/5.1.0/ucd/UnicodeData.txt . cp /Volumes/ftp.unicode.org/Public/5.1.0/ucd/CompositionExclusions.txt . cp /Volumes/ftp.unicode.org

[issue5828] Invalid behavior of unicode.lower

2009-04-25 Thread Walter Dörwald
Changes by Walter Dörwald : -- assignee: doerwalter -> loewis ___ Python tracker <http://bugs.python.org/issue5828> ___ ___ Python-bugs-list mailing list Un

[issue5849] Idle 3.01 - invalid syntec error

2009-04-26 Thread Walter Dörwald
Walter Dörwald added the comment: This is not a bug in Python. In Python 3.0 "print" is a function, so print buildConnectionString(myParams) should read print(buildConnectionString(myParams)) Closing as invalid. -- nosy: +doerwalter resolution: -> invalid

[issue5108] Invalid UTF-8 ("%s") length in PyUnicode_FromFormatV()

2009-05-03 Thread Walter Dörwald
Walter Dörwald added the comment: Checked in: r72260 (trunk) r72262 (release26-maint) r72265 (py3k) r72266 (release30-maint) -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue3739] unicode-internal encoder reports wrong length

2009-05-06 Thread Walter Dörwald
Walter Dörwald added the comment: Checked in: r72404,72406 (trunk) r72408 (py3k) As IMHO this is somewhat between a feature and a bugfix, I didn't check it into release26-maint and release30-maint. -- resolution: -> fixed status: open -

[issue1866] const arg for PyInt_FromString

2009-05-26 Thread Walter Dörwald
Walter Dörwald added the comment: The patch no longer applies cleanly to the trunk. -- nosy: +doerwalter ___ Python tracker <http://bugs.python.org/issue1

[issue2661] Mapping tests cannot be passed by user implementations

2009-05-26 Thread Walter Dörwald
Walter Dörwald added the comment: Any custom mapping class should have a repr test anyway, so IMHO it doesn't matter whether the base test has a repr test or not. The suggested fixes for TestMappingProtocol.test_fromkeys() and TestHashMappingProtocol.test_mutatingiteration() sound OK ho

[issue6213] Incremental encoder incompatibility between 2.x and py3k

2009-06-08 Thread Walter Dörwald
Walter Dörwald added the comment: This was done because the codec state is part of the return value of tell(). To have a reasonable return value (i.e. one with just the position itself) in as many cases as possible it makes sense to design the codec state in such a way, that the most common

[issue6213] Incremental encoder incompatibility between 2.x and py3k

2009-06-08 Thread Walter Dörwald
Walter Dörwald added the comment: AFAICR the difference is: 2.x may return any object in getstate(), but py3k must return a (buffered input, integer) tuple. Simply moving py3ks getstate/setstate implementation over to 2.x might do the trick

[issue6331] Add unicode script info to the unicode database

2009-06-23 Thread Walter Dörwald
New submission from Walter Dörwald : This patch adds a function unicodedata.script() that returns information about the script of the Unicode character. -- components: Unicode files: unicode-script.diff keywords: patch messages: 89642 nosy: doerwalter severity: normal status: open title

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-06-23 Thread Walter Dörwald
Walter Dörwald added the comment: http://bugs.python.org/6331 is a patch that adds unicode script info to the unicode database. -- nosy: +doerwalter ___ Python tracker <http://bugs.python.org/issue2

[issue6331] Add unicode script info to the unicode database

2009-06-24 Thread Walter Dörwald
Walter Dörwald added the comment: Martin v. Löwis wrote: > Martin v. Löwis added the comment: > > I think the patch is incorrect: the default value for the script > property ought to be Unknown, not Common (despite UCD.html saying the > contrary; see UTR#24 and Scripts.txt).

[issue6331] Add unicode script info to the unicode database

2009-06-24 Thread Walter Dörwald
Changes by Walter Dörwald : Added file: http://bugs.python.org/file14356/unicode-script-2.diff ___ Python tracker <http://bugs.python.org/issue6331> ___ ___ Python-bug

[issue6331] Add unicode script info to the unicode database

2009-06-25 Thread Walter Dörwald
Walter Dörwald added the comment: I was comparing apples and oranges: The 229 entries for the trunk where for an UCS2 build (the patched version was UCS4), with UCS4 there are 317 entries for the trunk. size unicodedata.o gives: __TEXT __DATA __OBJC others dec hex 13622 587057 0

[issue6331] Add unicode script info to the unicode database

2009-07-01 Thread Walter Dörwald
Walter Dörwald added the comment: Here is a new version that includes a new function scriptl() that returns the script name in lowercase. -- Added file: http://bugs.python.org/file14418/unicode-script-3.diff ___ Python tracker <h

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Walter Dörwald
Walter Dörwald added the comment: > > I’d be grateful if someone could post links to discussion > > about the removal of codecs like hex and rot13 > r55932 (~3 years ago): That was my commit. ;) > Thanks for the link. Do you have a pointer to the PEP or ML thread > d

[issue8848] Deprecate or remove "U" and "U#" formats of Py_BuildValue()

2010-06-02 Thread Walter Dörwald
Walter Dörwald added the comment: The code for case 's'/'z' in py3k is indeed the same as for case 'U'. The patch looks good to me. IMHO removing 'U' should only be done once Py2 is dead. -- ___ Python tr

[issue8848] Deprecate or remove "U" and "U#" formats of Py_BuildValue()

2010-06-07 Thread Walter Dörwald
Walter Dörwald added the comment: Yes, I think you should apply the patch. -- ___ Python tracker <http://bugs.python.org/issue8848> ___ ___ Python-bugs-list m

[issue29095] Compiling Python 3.6 from source on MacOS X Sierra

2016-12-28 Thread Walter Dörwald
New submission from Walter Dörwald: I'm trying to compile Python 3.6 from source on MacOS X Sierra. However it seems that the _ssl module doesn't get built. Attached is the complete output. Note that I have openssl installed via homebrew: ~/ ▸ brew list openssl /usr/local/Cell

[issue29095] Compiling Python 3.6 from source on MacOS X Sierra

2016-12-29 Thread Walter Dörwald
Walter Dörwald added the comment: No, neither CFLAGS nor LDFLAGS are set, the only "FLAGS" environment variable I have set is ARCHFLAGS='-arch x86_64' (I can't remember why). However unsetting this variable doesn't change the result. --

[issue29095] Compiling Python 3.6 from source on MacOS X Sierra

2016-12-29 Thread Walter Dörwald
Walter Dörwald added the comment: OK, I've set CFLAGS and LDFLAGS as you suggested. However the ssl module still doesn't get built. Attached is the new build log (Python3.6-build2.log) -- Added file: http://bugs.python.org/file46073/Python3.6-

[issue29095] Compiling Python 3.6 from source on MacOS X Sierra

2016-12-29 Thread Walter Dörwald
Walter Dörwald added the comment: OK, with the fixed CFLAGS definition I do indeed get a working ssl module. I wonder whether the link Ned posted should be put into the README file. Anyway I think the issue can be closed. Thanks for the help

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Walter Dörwald
Walter Dörwald added the comment: The point of using a function is to allow the function special hanling of the encoding name, which goes beyond a simple map lookup, i.e. you could do the following: import codecs def search_function(encoding): if not encoding.startswith("a

[issue19834] Unpickling exceptions pickled by Python 2

2014-12-04 Thread Walter Dörwald
Changes by Walter Dörwald : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue19834> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue22998] inspect.Signature and default arguments

2014-12-04 Thread Walter Dörwald
New submission from Walter Dörwald: inspect.Signature.bind() doesn't add values for parameters that are unspecified but have a default value. The documentation at https://docs.python.org/3/library/inspect.html#inspect.BoundArguments.arguments includes an example how to add default values

[issue22998] inspect.Signature and default arguments

2014-12-04 Thread Walter Dörwald
Walter Dörwald added the comment: The following doesn't work:: import inspect def foo(*args, **kwargs): return (args, kwargs) # Code from https://docs.python.org/3/library/inspect.html#inspect.BoundArguments.arguments to fill in the defaults sig = inspect.signatur

[issue22998] inspect.Signature and default arguments

2014-12-09 Thread Walter Dörwald
Walter Dörwald added the comment: The updated code in the documentation still doesn't set the * and ** parameters. I would have preferred the following code: for param in sig.parameters.values(): if param.name not in ba.arguments: if param.kind is inspect.Parameter.VAR_POSIT

[issue23232] 'codecs' module functionality + its docs -- concerning custom codecs, especially non-string ones

2015-01-27 Thread Walter Dörwald
Walter Dörwald added the comment: That analysis seems correct to me. Stateless and stream codecs were the original implementation. 2006 I implemented incremental codecs: http://bugs.python.org/issue1436130 The intent was to have stateful codecs that can work with iterators and generators

[issue24474] Accidental exception chaining in inspect.Signature.bind()

2015-06-19 Thread Walter Dörwald
New submission from Walter Dörwald: When an exception is raised by inspect.Signature.bind() in some cases the exception has a StopIteration as its __context__: import inspect try: inspect.signature(lambda x:None).bind() except Exception as exc: print(repr(exc)) print(repr(exc

[issue7267] format method: c presentation type broken in 2.7

2015-11-09 Thread Walter Dörwald
Walter Dörwald added the comment: Don't worry, I've switched to using Python 3 in 2012, where this isn't a problem. ;) -- ___ Python tracker <http://bugs.py

[issue26151] str(bytes) does __repr__() instead of __str__()

2016-01-19 Thread Walter Dörwald
Walter Dörwald added the comment: > Who's talking about latin-1 in Python3? Of course str() needs to return > decode('utf-8'). So that would mean that: print(b"\xff") will always fail! -- nosy: +doerwalter __

[issue26151] str(bytes) does __repr__() instead of __str__()

2016-01-19 Thread Walter Dörwald
Walter Dörwald added the comment: But this leads to uninspectable objects. -- ___ Python tracker <http://bugs.python.org/issue26151> ___ ___ Python-bugs-list m

[issue19100] Use backslashreplace in pprint

2015-03-31 Thread Walter Dörwald
Walter Dörwald added the comment: The linked code at https://github.com/vadmium/python-iview/commit/68b0559 seems strange to me: try: text.encode(encoding, textio.errors or "strict") except UnicodeEncodeError: text = text.encode(encoding, errors).decod

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Walter Dörwald
Walter Dörwald added the comment: The patch does indeed fix the segmentation fault. However the exception message looks confusing: TypeError: don't know how to handle UnicodeEncodeError in error callback -- ___ Python tracker

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Walter Dörwald
Walter Dörwald added the comment: Looks much better. However shouldn't: exc->ob_type->tp_name be: Py_TYPE(exc)->tp_name (although there are still many spots in the source that still use ob_type->tp_name) -- ___ Pyth

[issue28281] Remove year limits from calendar

2016-09-27 Thread Walter Dörwald
Walter Dörwald added the comment: I don't think that's necessary. What's the use case for this? And if we want to to this, wouldn't it be better to enhance datetime, so that this use case is supported too? -- ___ P

<    1   2