[issue13500] Hitting EOF gets cmd.py into a infinite EOF on return loop
Garrett Cooper yaneg...@gmail.com added the comment: Here's a unittest patch for the py3k branch. {{{ 1 items passed all tests: 32 tests in test.test_cmd.samplecmdclass 32 tests in 19 items. 32 passed and 0 failed. Test passed. doctest (test.test_cmd) ... 32 tests with zero failures test_file_with_missing_final_nl (__main__.TestAlternateInput) ... ok test_input_reset_at_EOF (__main__.TestAlternateInput) ... ok -- Ran 2 tests in 0.000s OK }}} -- Added file: http://bugs.python.org/file24257/python-issue13500-test.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13500 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12600] Support parameterized TestCases in unittest
Mark Diekhans ma...@kermodei.com added the comment: Allowing loadTestsFromTestCase() to take either a testCaseClass or a (testCaseClass, param) tuple, where the param is then past to the __init__ function might do the trick. One param is sufficient, since it can be a container for any number of params. This allows more fields to be added to the tuple for some future, unforeseen need. An container object for class and parameters would be a bit more structured than a tuple. A factory function would be the most flexible, however it seems to go against the class introspection for discovering tests. Then again, I don't know the code very well. R. David Murray rep...@bugs.python.org writes: R. David Murray rdmur...@bitdance.com added the comment: Maybe we could add a recipe for doing this to the load_tests docs? I don't think that load_tests is going to be more readable, though, since it doesn't allow you to put the parameterization next to the class you are parameterizing (unless you do some additional hackery). But yes, if anything else is done a concrete API proposal is the first requirement. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12600 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12600 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8285] IDLE not smart indenting correctly in nested statements
Cherniavsky Beni b...@google.com added the comment: Mark: customizing tabs to be anything but 8 spaces is inadvisable with Python, because Python always parses them as 8. Sooner or later one would mix tabs and spaces and the result would be really painful to debug. -- nosy: +cben ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8285 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13792] The os.execl call doesn't give programs exit code
Kay Hayen kayha...@gmx.de added the comment: Does the Python standard library not offer anything that does replace with current process code with another? I checked with subprocess, and admittedly it's not that. Does Win32 API offer nothing for that? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13792 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8285] IDLE not smart indenting correctly in nested statements
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8285 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13804] Python library structure creates hard to read code when using higher order functions
New submission from Martin Häcker spamfaen...@gmx.de: Code that uses higher order methods is often the clearest description of what you want to do. However since the higher order methods in python (filter, map, reduce) are free functions and aren't available on collection classes as methods, using them creates really hard to read code. For example, if I want to get an attribute out of an array of objects and concatenate the results it's two steps, get the attributes out of the object, then concatenate the results. Without higher order methods its like this. Uses three lines, intermediate variable is quite clear, but hard to compose and hard to abstract out parts of it. self.questions = [] for topic in self.topics: self.questions.append(topic.questions) if I want to do it with higher order functions there's really two ways, do it in one step with reduce: self.questions = reduce(lambda memo, topic: memo + topic.questions, self.topics, []) Or use two steps with the operator module self.questions = reduce(operator.add, map(operator.attrgetter('questions'), self.topics), []) Of these thee first still couples two steps into one lambda, while the second one decoples everything nicely but is a total train wreck to read, as you need to constantly jump back and forth in the line to understand what it does. Having map and reduce defined on collections would not only make it drastically shorter but also allows you to read it from front to back in one go. (Ok, there is still the caveat that the assignment is in the front instead of at the end, but hey) self.questions = self.topics.map(attrgetter('questions')).reduce(add, []) That would be nicely separated into individual steps that exactly describe what each step is actually doing, is easy to abstract over and actually very succinct. -- messages: 151435 nosy: dwt priority: normal severity: normal status: open title: Python library structure creates hard to read code when using higher order functions type: enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12415] Missing: How to checkout the Doc sources
Ezio Melotti ezio.melo...@gmail.com added the comment: +The documentation sources are part of the main :ref:`CPython Mercurial +repository setup`. I think documentation sources is a bit vague. If the goal is enable people to find those files, IMHO it would be better to state explicitly that there are bunch of rst files in the Doc/ directory that comes with cpython and that they are used to build the online documentation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12415 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13799] Base 16 should be hexadecimal in Unicode HOWTO
Ezio Melotti ezio.melo...@gmail.com added the comment: Do you mean the base 16 in this sentence: A code point is an integer value, usually denoted in base 16.? Why would hexadecimal be better than base 16? -- assignee: docs@python - ezio.melotti nosy: +ezio.melotti versions: -Python 2.6, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13799 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13792] The os.execl call doesn't give programs exit code
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: No. On Windows the only way to start a new executable is to create a new process (with the CreateProcess function, which all spawn* and exec* functions ultimately call), and this yields a new PID. This is a fundamental difference with unix, where the only way to create a process is to clone the current one with fork(). And yes, this makes launchers more difficult to write on Windows. For a discussion see the paragraph Process Launching in http://www.python.org/dev/peps/pep-0397/ -- nosy: +amaury.forgeotdarc resolution: - invalid status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13792 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13805] [].sort() should return self
New submission from Martin Häcker spamfaen...@gmx.de: [].sort() returns None which means you can't chain it. So for example someDict.keys().sort()[0] doesn't work but you have to use sorted(someDict.keys())[0] instead which is harder to read as you have to read the line not from the beginning to the end but jump back and forth in it to understand it (which gets progressively harder as the individual parts of it get longer / more complex). -- messages: 151439 nosy: dwt priority: normal severity: normal status: open title: [].sort() should return self type: enhancement versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13805 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13805] [].sort() should return self
Martin Häcker spamfaen...@gmx.de added the comment: It really should return self. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13805 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13805] [].sort() should return self
Ezio Melotti ezio.melo...@gmail.com added the comment: This is by design. Methods that mutate the object return None. Methods that create a new object return the new object. list.sort sorts the list in place, so it returns None. -- nosy: +ezio.melotti resolution: - rejected stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13805 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13805] [].sort() should return self
Ezio Melotti ezio.melo...@gmail.com added the comment: See also http://docs.python.org/faq/design.html#why-doesn-t-list-sort-return-the-sorted-list -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13805 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12600] Support parameterized TestCases in unittest
Nick Coghlan ncogh...@gmail.com added the comment: Back on topic... While I can see the advantage of parameterisation at the level of individual tests, I'm not at all clear on the benefits at the TestCase level. For CPython's own test suite, if we want to share tests amongst multiple test cases, we just use ordinary inheritance. You get parameterisation pretty much for free with that approach: class _BaseTest(object): # Tests go here # setUp and tearDown often go here, too class FooTestCase(_BaseTest, TestCase): # Parameter settings go here class BarTestCase(_BaseTest, TestCase): # Parameter settings go here If you want to get data-driven about it, you can also do dynamic TestCase creation based on a sequence of parameter sets. So, absent a compelling explanation for why the ordinary inheritance mechanisms aren't adequate, I'd be in favour of closing this one. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12600 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Thanks Nick. Looking through this discussion it looks as though you encountered all the confusing bits that I ran into (dup_buffer, ownership issues, reference counting and so forth.) Good work. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10181 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13781] gzip module does the wrong thing with an os.fdopen()'ed fileobj
Nadeem Vawda nadeem.va...@gmail.com added the comment: Attached is a fix for 3.x. -- keywords: +patch Added file: http://bugs.python.org/file24258/gzip-fdopen.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13781 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)
Stefan Krah stefan-use...@bytereef.org added the comment: Thanks for the comments. Most of them should be easy to fix. Nick Coghlan rep...@bugs.python.org wrote: [...] expose the Py_buffer len field as memoryview.size instead of memoryview.len (to reduce confusion with len(memoryview) and to encourage a conceptual link with sys.getsizeof()). I agree with this. The best thing is probably to have both versions work in 3.3 and remove memoryview.len in 3.4 (or later). As noted in the review, I also think fixing #12384 should be fairly straightforward and it would be nice to have that working when the change is applied. tobytes() currently calls PyBuffer_ToContiguous(..., 'C') from Objects/abstract.c. Since the function repeatedly calls PyBuffer_GetPointer(), it has this comment: /* XXX : This is not going to be the fastest code in the world several optimizations are possible. */ So if the fix for tobytes() should go in, I'd like to use the copy_buffer() function from _testbuffer.c. PyBuffer_ToContiguous() would need to be fixed separately. test_buffer.py already asserts that for each result, result.tolist() and result.tobytes() match the results obtained from PyBuffer_GetPointer(indices) (See: test_buffer.py:779), so I'm not worried about using the same implementation in the tests as in the production code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10181 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
STINNER Victor victor.stin...@haypocalc.com added the comment: Patch version 8: the whole test suite now pass successfully. The remaining question is if CryptoGen should be used instead of the weak LCG initialized by gettimeofday() and getpid(). According to Martin von Loewis, we must link statically Python to advapi32.dll. It should speed up the startup. -- Added file: http://bugs.python.org/file24259/random-8.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -460,6 +460,13 @@ These environment variables influence Py option. +.. envvar:: PYTHONHASHSEED + + If this is set, it is used as a fixed seed for the Unicode randomized hash: + number in range [0; 4294967295]. The value 0 disables the Unicode randomized + hash. + + .. envvar:: PYTHONIOENCODING If this is set before running the interpreter, it overrides the encoding used diff --git a/Include/pythonrun.h b/Include/pythonrun.h --- a/Include/pythonrun.h +++ b/Include/pythonrun.h @@ -246,6 +246,8 @@ typedef void (*PyOS_sighandler_t)(int); PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int); PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t); +/* Random */ +PyAPI_FUNC(int) _PyOS_URandom (void *buffer, Py_ssize_t size); #ifdef __cplusplus } diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -376,6 +376,12 @@ typedef struct { PyAPI_DATA(PyTypeObject) PyUnicode_Type; PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; +typedef struct { +Py_hash_t prefix; +Py_hash_t suffix; +} _Py_unicode_hash_secret_t; +PyAPI_DATA(_Py_unicode_hash_secret_t) _Py_unicode_hash_secret; + #define PyUnicode_Check(op) \ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS) #define PyUnicode_CheckExact(op) (Py_TYPE(op) == PyUnicode_Type) diff --git a/Lib/json/__init__.py b/Lib/json/__init__.py --- a/Lib/json/__init__.py +++ b/Lib/json/__init__.py @@ -31,7 +31,9 @@ Encoding basic Python object hierarchies Compact encoding:: import json - json.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',', ':')) + from collections import OrderedDict + mydict = OrderedDict([('4', 5), ('6', 7)]) + json.dumps([1,2,3,mydict], separators=(',', ':')) '[1,2,3,{4:5,6:7}]' Pretty printing:: diff --git a/Lib/os.py b/Lib/os.py --- a/Lib/os.py +++ b/Lib/os.py @@ -761,23 +761,6 @@ try: except NameError: # statvfs_result may not exist pass -if not _exists(urandom): -def urandom(n): -urandom(n) - str - -Return a string of n random bytes suitable for cryptographic use. - - -try: -_urandomfd = open(/dev/urandom, O_RDONLY) -except (OSError, IOError): -raise NotImplementedError(/dev/urandom (or equivalent) not found) -bs = b -while len(bs) n: -bs += read(_urandomfd, n - len(bs)) -close(_urandomfd) -return bs - # Supply os.popen() def popen(cmd, mode=r, buffering=-1): if not isinstance(cmd, str): diff --git a/Lib/packaging/create.py b/Lib/packaging/create.py --- a/Lib/packaging/create.py +++ b/Lib/packaging/create.py @@ -311,8 +311,11 @@ class MainProgram: 'package_data', 'extra_files'): if not(name in self.data and self.data[name]): continue -fp.write('%s = %s\n' - % (name, '\n'.join(self.data[name]).strip())) +data = self.data[name] +if name == extra_files: +data.sort() +data = '\n'.join(data).strip() +fp.write('%s = %s\n' % (name, data)) fp.write('\nresources =\n') for src, dest in self.data['resources']: fp.write('%s = %s\n' % (src, dest)) diff --git a/Lib/packaging/tests/test_create.py b/Lib/packaging/tests/test_create.py --- a/Lib/packaging/tests/test_create.py +++ b/Lib/packaging/tests/test_create.py @@ -150,16 +150,16 @@ class CreateTestCase(support.TempdirMana mymodule scripts = my_script bin/run -extra_files = Martinique/Lamentin/dady +extra_files = Alexander +Flora +Martinique/Lamentin/bro +Martinique/Lamentin/dady Martinique/Lamentin/mumy Martinique/Lamentin/sys -Martinique/Lamentin/bro +Pom +README +pyxfoil/fengine.so setup.py -README -Pom -Flora -Alexander -pyxfoil/fengine.so resources =
[issue13703] Hash collision security issue
STINNER Victor victor.stin...@haypocalc.com added the comment: Hum, test_runpy fails something with a segfault and/or a recursion limit because of my hack to rerun regrtest.py to set PYTHONHASHSEED environment variable. The fork should be defined if main() of regrtest.py is called directly. Example: diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -258,7 +258,7 @@ def main(tests=None, testdir=None, verbo findleaks=False, use_resources=None, trace=False, coverdir='coverage', runleaks=False, huntrleaks=False, verbose2=False, print_slow=False, random_seed=None, use_mp=None, verbose3=False, forever=False, - header=False, failfast=False, match_tests=None): + header=False, failfast=False, match_tests=None, allow_fork=False): Execute a test suite. This also parses command-line options and modifies its behavior @@ -559,6 +559,11 @@ def main(tests=None, testdir=None, verbo except ValueError: print(Couldn't find starting test (%s), using all tests % start) if randomize: +hashseed = os.getenv('PYTHONHASHSEED') +if (not hashseed and allow_fork): +os.environ['PYTHONHASHSEED'] = str(random_seed) +os.execv(sys.executable, [sys.executable] + sys.argv) +return random.seed(random_seed) print(Using random seed, random_seed) random.shuffle(selected) @@ -1809,4 +1814,4 @@ if __name__ == '__main__': # change the CWD, the original CWD will be used. The original CWD is # available from support.SAVEDCWD. with support.temp_cwd(TESTCWD, quiet=True): -main() +main(allow_fork=True) As Antoine wrote on IRC, regrtest.py should be changed later. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12600] Support parameterized TestCases in unittest
R. David Murray rdmur...@bitdance.com added the comment: I'd still like to see a recipe for creating parameterized test cases via load_tests added to the docs. It may be relatively obvious how to do it once you think of it, but it isn't obvious to a relative newcomer that you *can* do it, and it would make a great example of how load_tests can be used. (The current example is very trivial since it just re-implements the default behavior, and while that's useful, it doesn't really demonstrate the power of load_tests). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12600 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13411] Hashable memoryviews
Changes by Stefan Krah stefan-use...@bytereef.org: -- dependencies: +Problems with Py_buffer management in memoryobject.c (and elsewhere?) resolution: fixed - remind status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13411 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13411] Hashable memoryviews
Stefan Krah stefan-use...@bytereef.org added the comment: Reopening as a reminder that it isn't fixed yet in http://hg.python.org/features/pep-3118 . -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13411 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12600] Add example of using load_tests to parameterise Test Cases
Nick Coghlan ncogh...@gmail.com added the comment: I agree with David, so switching this over to a docs enhancement request. -- assignee: - docs@python components: +Documentation nosy: +docs@python title: Support parameterized TestCases in unittest - Add example of using load_tests to parameterise Test Cases versions: +Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12600 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13589] Aifc low level serialization primitives fix
Oleg Plakhotnyuk oleg...@gmail.com added the comment: I have absolutely no idea :-) I just covered every line of code with tests. Some bugs prevented me from do it, so I fixed them. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13804] Python library structure creates hard to read code when using higher order functions
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Did you consider list comprehension? self.questions = sum((topic.questions for topic in self.topics), []) -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13803] Under Solaris, distutils doesn't include bitness in the directory name
Jesús Cea Avión j...@jcea.es added the comment: Proposed patch for Python 2.7: --- util.py.old 2011-12-12 01:34:04.412234183 +0100 +++ util.py 2012-01-17 15:15:23.262257886 +0100 @@ -12,6 +12,7 @@ from distutils.spawn import spawn from distutils import log from distutils.errors import DistutilsByteCompileError +import platform def get_platform (): Return a string that identifies the current platform. This is used @@ -76,6 +77,7 @@ if release[0] = 5: # SunOS 5 == Solaris 2 osname = solaris release = %d.%s % (int(release[0]) - 3, release[2:]) +machine += .%s %platform.architecture()[0] # fall through to standard osname-release-machine representation elif osname[:4] == irix: # could be irix64! return %s-%s % (osname, release) So now the directory is named like lib.solaris-2.10-i86pc.32bit-2.7. Please, review. I will commit it to 2.7, 3.1, 3.2 and 3.3 in a few days. -- assignee: tarek - jcea stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13803 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13695] type specific to type-specific
Boštjan Mejak bostjan.me...@gmail.com added the comment: Well, actually, it's the only correct way to write it (i-th). This is a simple orthographical error that was made. Ezio, please fix those two additional typos. And Georg, stop being such a wise-ass. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13695 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13804] Python library structure creates hard to read code when using higher order functions
Martin Häcker spamfaen...@gmx.de added the comment: Yes - however it has the same problem as the higher order version in the python libraries that to read it you need to constantly jump back and forth in the line. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13796] use 'text=...' to define the text attribute of and xml.etree.ElementTree.Element
patrick vrijlandt patrick.vrijla...@gmail.com added the comment: Hi, Did you look at lxml (http://lxml.de)? from lxml.builder import E from lxml import etree tree = etree.ElementTree( E.Hello( Good morning!, E.World(How do you do, humour = excellent), Fine, E.Goodbye(), ), ) print(etree.tostring(tree, pretty_print=True).decode()) # output, even more prettified Hello Good morning! World humour=excellent How do you do /World Fine Goodbye/ /Hello By the way, your Element enhancement is buggy, because all newly create elements will share the same attrib dictionary (if attrib is not given). Notice that Donald Duck will be sad; by the time we print even Hello is sad. import xml.etree.ElementTree as etree class Element(etree.Element): def __init__(self, tag, attrib={}, **extra): super().__init__(tag) self.tag = tag self.attrib = attrib self.attrib.update(extra) self.text = self.attrib.pop('text', None) self.tail = self.attrib.pop('tail', None) self._children = [] if __name__ == '__main__': test = Element('Hello',) test2 = Element('World',{'humour':'excelent'},text = 'How do you do', tail=Fine) test3 = Element('Goodbye', humour='sad') test4 = Element('Donaldduck') test.append(test2) test.append(test3) test.append(test4) tree = etree.ElementTree(test) print(etree.tostring(test, encoding=utf-8, method=xml)) Hello humour=sad World humour=excelentHow do you do/WorldFine Goodbye humour=sad / Donaldduck humour=sad / /Hello' The correct idiom would be: def __init__(self, tag, attrib=None, **extra): if attrib is None: attrib = {} super().__init__(tag) Cheers, Patrick 2012/1/16 Pedro Andres Aranda Gutierrez rep...@bugs.python.org Pedro Andres Aranda Gutierrez paag...@gmail.com added the comment: Touché :-) I was just frustrated because my XMLs never have tail or text as attributes and I wanted to have more compact code... On Mon, Jan 16, 2012 at 12:14 PM, patrick vrijlandt rep...@bugs.python.org wrote: patrick vrijlandt patrick.vrijla...@gmail.com added the comment: I agree the Element syntax is sometimes awkward. But how would you represent text or tail attributes within this enhanced element? animal name=cat tail=yes comes to mind ... -- nosy: +patrick.vrijlandt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13796 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13796 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13796 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13806] Audioop decompression frames size check fix
New submission from Oleg Plakhotnyuk oleg...@gmail.com: According to documentation (http://docs.python.org/library/audioop.html), adpcm2lin, alaw2lin and ulaw2lin are using 'width' argument to represent output frames width. However, in audioop.c module there are checks that are raising exceptions if input frames length is not multiple of 'width'. I have replaced checking of 'len' to match 'size' with checking of 'len*size' to match 'size' in order to retain only basic length validity checks. -- components: Library (Lib) files: audioop_size_check.patch keywords: patch messages: 151459 nosy: Oleg.Plakhotnyuk, ezio.melotti, sandro.tosi priority: normal severity: normal status: open title: Audioop decompression frames size check fix type: behavior versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24260/audioop_size_check.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13806 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13681] Aifc read compressed frames fix
Changes by Oleg Plakhotnyuk oleg...@gmail.com: Removed file: http://bugs.python.org/file24112/aifc_compression.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13681 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13681] Aifc read compressed frames fix
Oleg Plakhotnyuk oleg...@gmail.com added the comment: Ok, I have opened issue 13806 with audioop fix alone. However, I cannot change current issue's dependencies to reflect that current issue depends on issue 13806. Could anyone do this for me please? -- Added file: http://bugs.python.org/file24261/aifc_compression.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13681 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12705] Make compile('1\n2\n', '', 'single') raise an exception instead of silently truncating?
Meador Inge mead...@gmail.com added the comment: The attached patch fixes this be checking what is left in the input buffer after parsing. Anything but trailing whitespace and comments triggers the exception. Ignoring trailing whitespace and comments makes sense, but it is also somewhat required. Trailing comments are common in doctests: doctest.testfile('test_doctest.txt', raise_on_error=True) ... # doctest: +ELLIPSIS and trailing whitespace is used by the codeop heuristics. Here is an example of the new exception: compile('1 + 2\n3 + 4\n', '','single') Traceback (most recent call last): File stdin, line 1, in module File , line 1 1 + 2 ^ SyntaxError: multiple statements found while compiling a single statement Tested on Fedora 15; no regressions. -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file24262/issue12705-0.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13807] logging.Handler.handlerError() may raise AttributeError in traceback.print_exception()
New submission from Thomas Ryschawy thomasotto.rysch...@emerson.com: It seems to be known that in case of a Windows GUI app that isn’t connected to a console sys.stderr can be None. See the Note on http://docs.python.org/py3k/library/sys.html: Under some conditions stdin, stdout and stderr as well as the original values __stdin__, __stdout__ and __stderr__ can be None. It is usually the case for Windows GUI apps that aren’t connected to a console and Python apps started with pythonw. In combination with logging this leads to an issue similar to issue #5971. In my case sys.stderr is None and File: lib\logging\__init__.py, Class: Handler, Method: handleError raises AttributeError: 'NoneType' object has no attribute 'write'. A 'simple' solution would be to check if sys.stderr is not None. In case it is None handleError must not call traceback.print_exception() and not directly write to sys.stderr. -- components: Library (Lib) files: traceback.txt messages: 151462 nosy: ThomasRyschawy priority: normal severity: normal status: open title: logging.Handler.handlerError() may raise AttributeError in traceback.print_exception() type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file24263/traceback.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13807 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13807] logging.Handler.handlerError() may raise AttributeError in traceback.print_exception()
Changes by Thomas Ryschawy thomasotto.rysch...@emerson.com: Removed file: http://bugs.python.org/file24263/traceback.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13807 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13807] logging.Handler.handlerError() may raise AttributeError in traceback.print_exception()
Changes by Thomas Ryschawy thomasotto.rysch...@emerson.com: Added file: http://bugs.python.org/file24264/traceback.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13807 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13691] pydoc help (or help('help')) claims to run a help utility; does nothing
Éric Araujo mer...@netwok.org added the comment: Just a heads-up: I’ll be offline between January 19 and the end of the month, so don’t worry if you make a patch and it’s not reviewed immediately (at least not by me, other developers may do it :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13691 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13691] pydoc help (or help('help')) should show the doc for help
Changes by Éric Araujo mer...@netwok.org: -- title: pydoc help (or help('help')) claims to run a help utility; does nothing - pydoc help (or help('help')) should show the doc for help ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13691 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13589] Aifc low level serialization primitives fix
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f715c4a5a107 by Antoine Pitrou in branch '3.2': Issue #13589: Fix some serialization primitives in the aifc module. http://hg.python.org/cpython/rev/f715c4a5a107 New changeset b039965b0066 by Antoine Pitrou in branch 'default': Issue #13589: Fix some serialization primitives in the aifc module. http://hg.python.org/cpython/rev/b039965b0066 New changeset 8fac90d0f4cd by Antoine Pitrou in branch '2.7': Issue #13589: Fix some serialization primitives in the aifc module. http://hg.python.org/cpython/rev/8fac90d0f4cd -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13804] Python library structure creates hard to read code when using higher order functions
Éric Araujo mer...@netwok.org added the comment: I think this discussion would be more useful on the python-ideas mailing list. The request (adding map to sequences) will probably be rejected*, but you have a good chance to get an explanation for this design choice by Guido van Rossum or one of the old-timer core devs. *I think so because of str.join: people have said that they would prefer a list operation, but it’s always been denied because it would put the burden on any sequency type to implement the method, whereas with a str method then all iterables and iterators are supported for free. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13589] Aifc low level serialization primitives fix
Antoine Pitrou pit...@free.fr added the comment: I've finally committed the patch, thank you! -- resolution: - fixed stage: - committed/rejected status: open - closed versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13794] Copyright Year - Change it to 2012 please
Éric Araujo mer...@netwok.org added the comment: Websites that Python devs can work on are updated, now the request should go to the pydotorg mailing list or webmaster email address. -- nosy: +eric.araujo resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13794 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13681] Aifc read compressed frames fix
Changes by Antoine Pitrou pit...@free.fr: -- dependencies: +Audioop decompression frames size check fix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13681 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Éric Araujo mer...@netwok.org added the comment: #13712 contains a patch for test_packaging. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13803] Under Solaris, distutils doesn't include bitness in the directory name
Éric Araujo mer...@netwok.org added the comment: OK. from distutils.spawn import spawn from distutils import log from distutils.errors import DistutilsByteCompileError +import platform Please put that import higher up (with the other “import X”, before the “from X import Y”). +machine += .%s %platform.architecture()[0] One space after the % operator please. I will commit it to 2.7, 3.1, 3.2 and 3.3 in a few days. Not to 3.1, this is not a security issue. -- versions: -Python 2.6, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13803 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6727] ImportError when package is symlinked on Windows
Éric Araujo mer...@netwok.org added the comment: (3.1 doesn’t get non-security bug fixes either) -- versions: -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12415] Missing: How to checkout the Doc sources
Éric Araujo mer...@netwok.org added the comment: I think documentation sources is a bit vague. I don’t know. I probably wrote it under the assumption that the audience of this doc was developers, who already know that programmers don’t write HTML manually but generate it, and just need to know where to find the sources. To a C programmer wanting to fix a bug, we just say “the sources for X are in Include and Modules”, and it’s enough. Thinking about it, the assumption is probably bad. Sometimes we have to explain to new contributors where to find a Python module in the repo and how to write a test, so it would probably be better to explain more. Here’s my draft, feel free to improve my patch with it (there may be duplication) and commit the result when you two are in agreement while I’ll be offline. The documentation in HTML, PDF or epub format is generated from text files written using the :ref:`reStructuredText format markup and contained in the :ref:`CPython Mercurial repository setup`. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12415 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
STINNER Victor victor.stin...@haypocalc.com added the comment: #13712 contains a patch for test_packaging. It doesn't look related to randomized hash function. random-8.patch contains a fix to test_packaging. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13806] Audioop decompression frames size check fix
Antoine Pitrou pit...@free.fr added the comment: Well, you should just replace these calls with audioop_check_size() instead. Apparently the checks were blindly added in issue7673. By the way, I'm surprised audioop accepts unicode strings... :/ -- nosy: +haypo, pitrou versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13806 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Éric Araujo mer...@netwok.org added the comment: #13712 contains a patch for test_packaging. It doesn't look related to randomized hash function. Trust me. (If you read the whole report you’ll see why it looks unrelated: instead of sorting things like your patch does mine addresses a more serious behavior bug). random-8.patch contains a fix to test_packaging. I know, but mine is a bit better. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12705] Make compile('1\n2\n', '', 'single') raise an exception instead of silently truncating?
Éric Araujo mer...@netwok.org added the comment: I don’t understand why some two-liners are allowed (like class X:\n pass). The doc says “a single interactive statement”. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13787] PyCode_New not round-trippable (TypeError)
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: co_freevars and co_cellvars are the last arguments of the function. Your co_what2.py version of the script is correct, but co_what.py has a different order. -- nosy: +amaury.forgeotdarc resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13787 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11805] package_data only allows one glob per-package
Éric Araujo mer...@netwok.org added the comment: Here are patches for CPython and the d2 repo. There is no doc update as the setupscript page still talks about setup.py and the setupcfg spec does not mention package_data at all (the negationists resources-promoters at work :), so this can wait for my big doc updates. The changes to test_command_{build_py,sdist} are unrelated, I just found some fixes to do after grepping for package_data and I’ll commit them separately. Please review. (I’ll be offline until the end of the month FYI, but I’ll commit after that.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11805 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11805] package_data only allows one glob per-package
Changes by Éric Araujo mer...@netwok.org: -- keywords: +patch Added file: http://bugs.python.org/file24265/fix-package_data-multivalue-cpy33.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11805 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11805] package_data only allows one glob per-package
Changes by Éric Araujo mer...@netwok.org: Added file: http://bugs.python.org/file24266/fix-package_data-multivalue-d2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11805 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11805] package_data only allows one glob per-package
Éric Araujo mer...@netwok.org added the comment: Note that my proposed syntax does not allow something equivalent to {'': [etc.]} in distutils, i.e. package data for top-level modules. I think this is okay: modules should not install data in their installation dir. I don’t think it was widely used, but maybe I should ask on distutils-sig or survey setup.py scripts on PyPI to be sure. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11805 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11240] Running unit tests in a command line tool leads to infinite loop with multiprocessing on Windows
Chris Jones ch...@chrisejones.com added the comment: You can work around this issue by using: python.exe -c import nose; nose.main() instead of nosetests Note that nose.main() with no args parses sys.argv -- nosy: +Chris.Jones ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11240 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13695] type specific to type-specific
Georg Brandl ge...@python.org added the comment: Once you start contributing anything useful, I will start treating it as such. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13695 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12705] Make compile('1\n2\n', '', 'single') raise an exception instead of silently truncating?
Meador Inge mead...@gmail.com added the comment: On Tue, Jan 17, 2012 at 10:56 AM, Éric Araujo rep...@bugs.python.org wrote: I don’t understand why some two-liners are allowed (like class X:\n pass). The doc says “a single interactive statement”. Because a single statement can be multiple lines (as is the case for compound statements). Look at the grammar for a single input statement (interactive_input): http://docs.python.org/dev/reference/toplevel_components.html#interactive-input. This issue is really about multiple statements and not multiple lines. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12705] Make compile('1\n2\n', '', 'single') raise an exception instead of silently truncating?
Georg Brandl ge...@python.org added the comment: Because a class statement is one statement (it is a compound statement, but still just one). The docs don't talk about lines :) A single interactive statement is what you can enter at the interactive prompt in one line, or more than one line with only secondary prompts from the second line on. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13804] Python library structure creates hard to read code when using higher order functions
Daniel Stutzbach stutzb...@google.com added the comment: If I'm understanding Martin Häcker's code correctly, the list comprehension equivalent is: self.questions = [topic.questions for topic in self.topics] The reduce() variants are not only much harder to read, but they will take O(n**2) operations because they create an O(n) list O(n) times. -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13703] Hash collision security issue
Jim Jewett jimjjew...@gmail.com added the comment: To be more explicit about Martin A. Lemburg's msg151121 (which I agree with): Count the collisions on a single lookup. If they exceed a threshhold, do something different. Martin's strawman proposal was threshhold=1000, and raise. It would be just as easy to say whoa! 5 collisions -- time to use the alternative hash instead (and, possibly, to issue a warning). Even that slight tuning removes the biggest objection, because it won't ever actually fail. Note that the use of a (presumably stronger 2nd) hash wouldn't come into play until (and unless) there was a problem for that specific key in that specific dictionary. For the normal case, nothing changes -- unless we take advantage of the existence of a 2nd hash to simplify the first few rounds of collision resolution. (Linear probing is more cache-friendly, but also more vulnerable to worst-case behavior -- but if probing stops at 4 or 8, that may not matter much.) For quick scripts, the 2nd hash will almost certainly never be needed, so startup won't pay the penalty. The only down side I see is that the 2nd (presumably randomized) hash won't be cached without another slot, which takes more memory and shouldn't be done in a bugfix release. -- nosy: +Jim.Jewett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5689] Support xz compression in tarfile module
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Ping. Windows buildbots are still failing with MemoryError because of this preset=9. The patch looks good to me as well. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5689 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13727] Accessor macros for PyDateTime_Delta members
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 463acb73fd79 by Amaury Forgeot d'Arc in branch 'default': Issue #13727: Add 3 macros to access PyDateTime_Delta members: http://hg.python.org/cpython/rev/463acb73fd79 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13727] Accessor macros for PyDateTime_Delta members
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13787] PyCode_New not round-trippable (TypeError)
Mahmoud Hashemi mak...@gmail.com added the comment: Yes, I knew it was an issue with crossed wires somewhere. The Python 2 code doesn't translate well to Python 3 because the function signature changed to add kwargonlycount. And I guess the argument order is substantially different, too, as described in Objects/codeobject.c#l291. Thanks for clearing that up, though, Mahmoud -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13787 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13808] url for Tutor mailing list is broken
New submission from Tshepang Lekhonkhobe tshep...@gmail.com: faq.rst: correct url is http://mail.python.org/mailman/listinfo/tutor -- components: Devguide messages: 151488 nosy: ezio.melotti, tshepang priority: normal severity: normal status: open title: url for Tutor mailing list is broken ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13808] url for Tutor mailing list is broken
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 471f70b0b6b0 by Ezio Melotti in branch 'default': #13808: fix a link and specify the IRC server. http://hg.python.org/devguide/rev/471f70b0b6b0 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13808] url for Tutor mailing list is broken
Ezio Melotti ezio.melo...@gmail.com added the comment: Fixed, thanks for the report! -- assignee: - ezio.melotti resolution: - fixed stage: - committed/rejected status: open - closed type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13808 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13809] bz2 does not work when threads are disabled
New submission from Amaury Forgeot d'Arc amaur...@gmail.com: In bz2.py, import threading prevents the bz2 module from working when threads are not enabled. The attached patch removes the limitation and provides a fake lock object. I don't know if this should be backported to 3.2. -- components: Library (Lib) files: bz2_nothread.patch keywords: patch messages: 151491 nosy: amaury.forgeotdarc priority: normal severity: normal stage: patch review status: open title: bz2 does not work when threads are disabled type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file24267/bz2_nothread.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13809 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13809] bz2 does not work when threads are disabled
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +nadeem.vawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13809 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13809] bz2 does not work when threads are disabled
Georg Brandl ge...@python.org added the comment: Isn't there already a dummy lock in dummy_threading? -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13809 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13809] bz2 does not work when threads are disabled
Nadeem Vawda nadeem.va...@gmail.com added the comment: As Georg suggested, it would be better to use dummy_threading.RLock, rather than providing our own implementation. The test in the patch fails when I try to run it on a no-thread build. support.import_fresh_module seems to treat the absence of the threading module as an error, and returns None instead of allowing the bz2 module to recover from the ImportError. We needn't worry about 3.2. It still uses the old all-C implementation, which has its threading dependencies protected by #ifdefs. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13809 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.
Antoine Pitrou pit...@free.fr added the comment: Hmm something else: currently the atexit funcs are only called when the main interpreter exits, but that doesn't really make sense: if I register a function from a sub-interpreter, why would it execute correctly from another interpreter? All kind of fun things can happen... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6531 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset eb47af6e9e22 by Antoine Pitrou in branch '3.2': Test running of code in a sub-interpreter http://hg.python.org/cpython/rev/eb47af6e9e22 New changeset a108818aaa0d by Antoine Pitrou in branch 'default': Test running of code in a sub-interpreter http://hg.python.org/cpython/rev/a108818aaa0d -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6531 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.
Antoine Pitrou pit...@free.fr added the comment: Here is a patch for subinterp-wise atexit functions. (I haven't got any specific test for the crash but the patch adds a test and it works) -- keywords: +patch stage: - patch review Added file: http://bugs.python.org/file24268/atexitsubinterps.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6531 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13809] bz2 does not work when threads are disabled
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 2fb93282887a by Nadeem Vawda in branch 'default': Issue #13809: Make bz2 module work with threads disabled. http://hg.python.org/cpython/rev/2fb93282887a -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13809 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13809] bz2 does not work when threads are disabled
Nadeem Vawda nadeem.va...@gmail.com added the comment: Fix committed. For the test, it turns out we can get the desired behavior by telling import_fresh_module to block the threading module directly, instead of blocking _thread. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13809 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13810] refer people to Doc/Makefile when not using 'make' to build main documentation
New submission from Tshepang Lekhonkhobe tshep...@gmail.com: this is regarding documenting.rst: The url for checking out Sphinx from svn has been outdated for a while, so I think it would be better to refer people to Doc/Makefile for the correct urls, instead of having to keep updating this file on each change. This applies to the other modules in that section (which are currently up-to-date): * docutils * jinja2 * Pygments -- components: Devguide messages: 151499 nosy: ezio.melotti, tshepang priority: normal severity: normal status: open title: refer people to Doc/Makefile when not using 'make' to build main documentation ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13810 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12705] Make compile('1\n2\n', '', 'single') raise an exception instead of silently truncating?
Éric Araujo mer...@netwok.org added the comment: Thank you both for fixing my incomplete understanding. Meador, unless you want a review from another core dev, I think you can just go ahead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13763] rm obsolete reference in devguide
Tshepang Lekhonkhobe tshep...@gmail.com added the comment: I included both suggestions in the latest patch. -- Added file: http://bugs.python.org/file24269/rm-obsolete-reference2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13763 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13763] rm obsolete reference in devguide
Éric Araujo mer...@netwok.org added the comment: I really think there is no bug. We don’t have to explain why Mercurial or hg are named so. The current text merely says that “hg”, which is the name of the executable, is commonly used as a short form of “Mercurial”. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13763 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13763] Potentially hard to understand wording in devguide
Éric Araujo mer...@netwok.org added the comment: Adding a native speaker for confirmation. -- nosy: +terry.reedy title: rm obsolete reference in devguide - Potentially hard to understand wording in devguide ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13763 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10278] add time.wallclock() method
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset bb10cd354e49 by Victor Stinner in branch 'default': Close #10278: Add time.wallclock() function, monotonic clock. http://hg.python.org/cpython/rev/bb10cd354e49 -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10278 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format an incorrect alignment option doesn't make fill char and onself absent
New submission from py.user port...@yandex.ru: http://docs.python.org/py3k/library/string.html#format-specification-mini-language The fill character can be any character other than ‘{‘ or ‘}’. The presence of a fill character is signaled by the character following it, which must be one of the alignment options. If the second character of format_spec is not a valid alignment option, then it is assumed that both the fill character and the alignment option are absent. '{0:x10d}'.format(1) 'x1' '{0:xx10d}'.format(1) Traceback (most recent call last): File stdin, line 1, in module ValueError: Invalid conversion specification -- messages: 151505 nosy: py.user priority: normal severity: normal status: open title: In str.format an incorrect alignment option doesn't make fill char and onself absent ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format an incorrect alignment option doesn't make fill char and onself absent
Changes by py.user port...@yandex.ru: -- components: +Interpreter Core type: - behavior versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10278] add time.wallclock() method
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 1de276420470 by Victor Stinner in branch 'default': Issue #10278: fix a typo in the doc http://hg.python.org/cpython/rev/1de276420470 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10278 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format an incorrect alignment option doesn't make fill char and onself absent
Eric V. Smith e...@trueblade.com added the comment: What is the expected output, and why? I think the error message might be incorrect, possibly it should be invalid format specifier. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13812] multiprocessing package doesn't flush stderr on child exception
New submission from Jon Brandvein jon.brandv...@gmail.com: When a child process exits due to an exception, a traceback is written, but stderr is not flushed. Thus I see a header like Process 1:\n, but no traceback. I don't have a development environment or any experience with Mecurial, so I'm afraid there's no patch, but it's a one-liner. In /Lib/multiprocess/process.py :: Process._bootstrap except: exitcode = 1 import traceback sys.stderr.write('Process %s:\n' % self.name) sys.stderr.flush() traceback.print_exc() Append a sys.stderr.flush() to the suite. It surprised me that flushing was even necessary. I would've thought that the standard streams would all be closed just before the process terminated, regardless of exit status. But I observe that unless I explicitly flush stdout and stderr before terminating, the output is lost entirely, even if the exit is not abnormal. This isn't the desired behavior, is it? -- components: Library (Lib) messages: 151508 nosy: brandj priority: normal severity: normal status: open title: multiprocessing package doesn't flush stderr on child exception type: behavior versions: Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13812 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13812] multiprocessing package doesn't flush stderr on child exception
Jon Brandvein jon.brandv...@gmail.com added the comment: (Er, that should be /Lib/multiprocessing/process.py :: Process._bootstrap of course.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13812 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format an incorrect alignment option doesn't make fill char and onself absent
py.user port...@yandex.ru added the comment: absent fill char and align option: '{0:10d}'.format(1) ' 1' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13781] gzip module does the wrong thing with an os.fdopen()'ed fileobj
Gregory P. Smith g...@krypto.org added the comment: thanks that looks good. As far as fixing this for 2.7 goes, i don't like the _sound_ of it because it is gross... But i'm actually okay with having special case code in the gzip module that rejects 'fdopen' as an actual filename and uses '' instead in that case. It is VERY unlikely that anyone ever intentionally wants to use that as a filename. Anything more than that (changing the actual 'fdopen' string for example) seems too invasive and might break someone's doctests and does genuinely make it more difficult to see what a fdopened file object is from its repr. -- assignee: - gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13781 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13803] Under Solaris, distutils doesn't include bitness in the directory name
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 284550d0d8ae by Jesus Cea in branch '2.7': Closes #13803: Under Solaris, distutils doesn't include bitness in the directory name http://hg.python.org/cpython/rev/284550d0d8ae New changeset eed73b16e71f by Jesus Cea in branch '3.2': Closes #13803: Under Solaris, distutils doesn't include bitness in the directory name http://hg.python.org/cpython/rev/eed73b16e71f New changeset 8d0ccb4ad206 by Jesus Cea in branch 'default': MERGE: Closes #13803: Under Solaris, distutils doesn't include bitness in the directory name http://hg.python.org/cpython/rev/8d0ccb4ad206 -- nosy: +python-dev resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13803 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13803] Under Solaris, distutils doesn't include bitness in the directory name
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 2ec4ab2a6f65 by Jesus Cea in branch '2.7': Emergency fix for #13803 bootstrap issue: Under Solaris, distutils doesn't include bitness in the directory name http://hg.python.org/cpython/rev/2ec4ab2a6f65 New changeset 9d62f5aa35ff by Jesus Cea in branch '3.2': Emergency fix for #13803 bootstrap issue: Under Solaris, distutils doesn't include bitness in the directory name http://hg.python.org/cpython/rev/9d62f5aa35ff New changeset 4a6e0b6d493b by Jesus Cea in branch 'default': MERGE: Emergency fix for #13803 bootstrap issue: Under Solaris, distutils doesn't include bitness in the directory name http://hg.python.org/cpython/rev/4a6e0b6d493b -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13803 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13665] TypeError: string or integer address expected instead of str instance
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset b4d9243d16c9 by Ezio Melotti in branch '3.2': #13665: s/string/bytes/ in error message. http://hg.python.org/cpython/rev/b4d9243d16c9 New changeset 0c0ffebfccb0 by Ezio Melotti in branch 'default': #13665: merge with 3.2. http://hg.python.org/cpython/rev/0c0ffebfccb0 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13665] TypeError: string or integer address expected instead of str instance
Changes by Ezio Melotti ezio.melo...@gmail.com: -- assignee: - ezio.melotti resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13665 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13803] Under Solaris, distutils doesn't include bitness in the directory name
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 4074439c3894 by Jesus Cea in branch '2.7': Yet another emergency fix for #13803 bootstrap issue: Under Solaris, distutils doesn't include bitness in the directory name http://hg.python.org/cpython/rev/4074439c3894 New changeset 37efae3bf912 by Jesus Cea in branch '3.2': Yet another emergency fix for #13803 bootstrap issue: Under Solaris, distutils doesn't include bitness in the directory name http://hg.python.org/cpython/rev/37efae3bf912 New changeset afdce2e2f98d by Jesus Cea in branch 'default': MERGE: Yet another emergency fix for #13803 bootstrap issue: Under Solaris, distutils doesn't include bitness in the directory name http://hg.python.org/cpython/rev/afdce2e2f98d -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13803 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13813] sysconfig.py and distutils/util.py redundancy
New submission from Jesús Cea Avión j...@jcea.es: During development of patch for issue #13803, I found redundancy between sysconfig.py and distutils/util.py. The functions are the same, and the return values must be the same too. So programmers *MUST* remember to change both sources in sync. This redundancy must be trimmed. This is not strictly a bugfix, so could be not adequate for 2.7/3.2, but applying for 3.2 at least would easy future merges. -- assignee: tarek components: Distutils keywords: easy messages: 151516 nosy: eric.araujo, jcea, tarek priority: normal severity: normal status: open title: sysconfig.py and distutils/util.py redundancy type: enhancement versions: Python 2.7, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13813 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13803] Under Solaris, distutils doesn't include bitness in the directory name
Jesús Cea Avión j...@jcea.es added the comment: A trivial check-in causing a nightmare at 5AM just hours before a day-long offline trip :-). Eric, could you possibly review the committed version?. I can't use platform.architecture() because bootstrap issues. For instance: http://www.python.org/dev/buildbot/all/builders/x86%20OpenIndiana%202.7/builds/828/steps/compile/logs/stdio Moreover, there are function redundancy between distutils/util.py and sysconfig.py, and the return value must be consistent. This is just created issue13813. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13803 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13803] Under Solaris, distutils doesn't include bitness in the directory name
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 147ad02875fa by Jesus Cea in branch '3.2': And yet another emergency fix for #13803 bootstrap issue: Under Solaris, distutils doesn't include bitness in the directory name http://hg.python.org/cpython/rev/147ad02875fa New changeset 582274636446 by Jesus Cea in branch 'default': MERGE: And yet another emergency fix for #13803 bootstrap issue: Under Solaris, distutils doesn't include bitness in the directory name http://hg.python.org/cpython/rev/582274636446 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13803 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com