[issue40787] Mysql + unittest crash
New submission from Lucas : environment: win10 cmd, python 3.8 32-bit, mysql, unittest description: When restoring a database through mysql in a unittest function, the command prompt freezes before giving the result of the test, and I am forced to close it to quit. steps to replicate: Have mysql installed, create a database with some content, dump the latter in a file, create a unit test using python's unittest with at least two test functions, and restore the file in one of them. -- components: Library (Lib) messages: 370039 nosy: lgerosa priority: normal severity: normal status: open title: Mysql + unittest crash type: crash versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue40787> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40787] Mysql + unittest crash
Lucas added the comment: While trying to simplify my program for you, I found that the problem was caused by a very specific interaction of one of the functions that was being tested with the restore command, which did not happen when I tried to rule this problem out in other ways. Anyways, thank you for your time. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue40787> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40787] Mysql + unittest crash
Lucas added the comment: The problem was that I didn't close the 1st connection to the database and then made another request, which had to wait for the 1st to close, to be exact. -- ___ Python tracker <https://bugs.python.org/issue40787> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46101] argparse: using parents & subcommands, options can be ignored
New submission from Lucas Cimon : Hi! Here is some minimal code reproducing the issue: import argparse common_opts_parser = argparse.ArgumentParser(add_help=False) common_opts_parser.add_argument("--endpoint", choices=("prod", "dev"), default="dev") parser = argparse.ArgumentParser(parents=[common_opts_parser]) subparsers = parser.add_subparsers(required=True) subcmd_cmd = subparsers.add_parser("subcmd", parents=[common_opts_parser]) subcmd_cmd.add_argument("--debug", action="store_true") print(parser.parse_args()) Everything works fine / as expected when specifying the common optional arg last: $ ./bug_repro.py subcmd --endpoint=dev Namespace(endpoint='dev', debug=False) However when specifying the --endpoint between the program and the subcommand, the value provided is ignored: $ ./bug_repro.py --endpoint=dev subcmd Namespace(endpoint=None, debug=False) I have a PR ready to fix that. -- components: Library (Lib) messages: 408711 nosy: Lucas Cimon priority: normal severity: normal status: open title: argparse: using parents & subcommands, options can be ignored type: behavior versions: Python 3.11 ___ Python tracker <https://bugs.python.org/issue46101> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46101] argparse: using parents & subcommands, options can be ignored
Change by Lucas Cimon : -- keywords: +patch pull_requests: +28364 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30146 ___ Python tracker <https://bugs.python.org/issue46101> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38584] argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help
Lucas Cimon added the comment: This was resolved by https://github.com/python/cpython/pull/28050 -- message_count: 4.0 -> 5.0 pull_requests: +28366 status: open -> closed pull_request: https://github.com/python/cpython/pull/28050 ___ Python tracker <https://bugs.python.org/issue38584> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46101] argparse: using parents & subcommands, options can be ignored
Lucas Cimon added the comment: The GitHub PR is ready for reviewing. -- ___ Python tracker <https://bugs.python.org/issue46101> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9750] sqlite3 iterdump fails on column with reserved name
Lucas Sinclair added the comment: I just encountered this issue today. So, it's been several months, will the patch be merged into the master branch ? Or will this never be fixed ? -- nosy: +xapple ___ Python tracker <http://bugs.python.org/issue9750> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9750] sqlite3 iterdump fails on column with reserved name
Lucas Sinclair added the comment: Sure, I can have a try at it and address the issues you pointed out. The URL to the guidelines you provided gives a 404. In what form exactly would you like the patch to be ? I wouldn't mind either adding to the test suite, but I'm not sure how to do that. -- ___ Python tracker <http://bugs.python.org/issue9750> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)
Lucas Sinclair added the comment: I'm on 10.7.2, with XCode is 4.2 and the problem is still present. The command "ggc -v" produces the following output: gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00) The command "./configure --with-pydebug && make -j2" fails with the following output: Assertion failed: (compact->utf8_length == 0), function _PyUnicode_CheckConsistency, file Objects/unicodeobject.c, line 381. make: *** [sysconfig] Abort trap: 6 The only solution seems to be to install macports and use it to get a more recent gcc like Oleg Plakhotnyuk suggested. -- nosy: +xapple ___ Python tracker <http://bugs.python.org/issue13241> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)
Lucas Sinclair added the comment: I just cloned cpython today. The output of "hg summary" is: parent: 73351:2bec7c452b39 tip Fix C89 incompatibility. branch: default commit: (clean) update: (current) -- ___ Python tracker <http://bugs.python.org/issue13241> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)
Lucas Sinclair added the comment: Well the configure parameters suggested by Michael Foord worked. I was able to build cpython on a mac. But I could not have guessed how to make it work. Shouldn't these instructions be added here http://docs.python.org/devguide/ ? Shouldn't the latest version of OS X be included in the list of *nix systems that cpython is checked to build on ? -- ___ Python tracker <http://bugs.python.org/issue13241> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9750] sqlite3 iterdump fails on column with reserved name
Lucas Sinclair added the comment: My patch contains two new dump tests which originally fail, and the fixes to the code that makes them pass. -- Added file: http://bugs.python.org/file23629/issue9750.patch ___ Python tracker <http://bugs.python.org/issue9750> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13583] sqlite3.Row doesn't support slice indexes
New submission from Lucas Sinclair : When using the sqlite3.Row object as a row factory, one can access the resulting rows by index (such as row[1]) or by name (such as row['b']). However, the slice functionality is lost, as doing row[0:2] raises the error: "slices not implemented, yet" Here is a patch that fixes this, I implemented it and I added the corresponding unit test. -- files: sqlrowslice.patch keywords: patch messages: 149251 nosy: xapple priority: normal severity: normal status: open title: sqlite3.Row doesn't support slice indexes type: feature request versions: Python 2.6, Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23919/sqlrowslice.patch ___ Python tracker <http://bugs.python.org/issue13583> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9634] Add timeout parameter to Queue.join()
New submission from Kelly Lucas : I've seen quite a few people requesting to add a timeout value to the Queue.join() method, as it seems like a nice feature to have when waiting for queue's to finish. Please add a feature so that Queue.join() will issue a self.all_tasks_done.release() when the timeout value is reached. -- components: Library (Lib) messages: 114257 nosy: kdlucas priority: normal severity: normal status: open title: Add timeout parameter to Queue.join() versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue9634> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9634] Add timeout parameter to Queue.join()
Changes by Kelly Lucas : -- versions: +Python 3.1 -Python 2.7 ___ Python tracker <http://bugs.python.org/issue9634> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9634] Add timeout parameter to Queue.join()
Kelly Lucas added the comment: Here are a few that I saw: http://stackoverflow.com/questions/1564501/add-timeout-argument-to-pythons-queue-join http://www.eggheadcafe.com/software/aspnet/36145181/max-time-threads.aspx http://efreedom.com/Question/1-1564501/Add-timeout-argument-to-python-s-Queue-join -- ___ Python tracker <http://bugs.python.org/issue9634> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9634] Add timeout parameter to Queue.join()
Kelly Lucas added the comment: This is easy enough to implement by subclassing the Queue class and overriding join(), so it's not a big deal. Just seems like it would be a nice thing to have. -- ___ Python tracker <http://bugs.python.org/issue9634> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38584] argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help
New submission from Lucas Cimon : The test I am going to add to test_argparse.py: def test_whitespace_help(self): parser = self._get_parser() parser.add_argument( '--foo2', action='store_true', help=' ') parser.add_argument( 'bar2', type=float, help=' ') parser.format_help() # raises an IndexError -- components: Library (Lib) messages: 355336 nosy: Lucas Cimon priority: normal severity: normal status: open title: argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue38584> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38584] argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help
Change by Lucas Cimon : -- keywords: +patch pull_requests: +16448 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16917 ___ Python tracker <https://bugs.python.org/issue38584> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38586] logging: handlers names are not set when using fileConfig
New submission from Lucas Cimon : The logging.Handler .name property is not set when the logging configuration is loaded with logging.fileConfig -- components: Library (Lib) messages: 355338 nosy: Lucas Cimon priority: normal severity: normal status: open title: logging: handlers names are not set when using fileConfig versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue38586> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38586] logging: handlers names are not set when using fileConfig
Change by Lucas Cimon : -- keywords: +patch pull_requests: +16450 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16918 ___ Python tracker <https://bugs.python.org/issue38586> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38584] argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help
Lucas Cimon added the comment: Thanks for the feedbacks paul.j3 ! I totally agree it would be best to test all formatter classes. I modified the new test to do so. I think I should probably place this test somewhere else in test_argparse.py, but I'm having trouble figuring out where exactly... I just updated the PR and moved the new test to the TestOptionalsHelpVersionActions class. About the best fix, I think a fix to _split_lines() would be more complex. It needs to return a list, so we would make it return [''] in that case ? That would be a bit strange. What do you think ? :) -- ___ Python tracker <https://bugs.python.org/issue38584> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True
Lucas Cimon added the comment: Reporting a duplicate / superseder with the following bug: parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(required=True) subparsers.add_parser('foo') parser.parse_args() Raising: TypeError: sequence item 0: expected str instance, NoneType found It has already been reported in https://bugs.python.org/issue29298 with an interesting solution by Greg Minshall. -- nosy: +Lucas Cimon ___ Python tracker <https://bugs.python.org/issue33109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29298] argparse fails with required subparsers, un-named dest, and empty argv
Change by Lucas Cimon : -- nosy: +Lucas Cimon nosy_count: 7.0 -> 8.0 pull_requests: +24884 pull_request: https://github.com/python/cpython/pull/26278 ___ Python tracker <https://bugs.python.org/issue29298> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True
Lucas Cimon added the comment: Sorry, the fix was by Mathias Ettinger: elif isinstance(argument, _SubParsersAction): return '{%s}' % ','.join(map(str, argument.choices)) I submitted a PR with this patch and a corresponding unit test: https://github.com/python/cpython/pull/26278 -- ___ Python tracker <https://bugs.python.org/issue33109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35720] Memory leak in Modules/main.c:pymain_parse_cmdline_impl when using the CLI flag
New submission from Lucas Cimon : Hi. I think I have found a minor memory leak in Modules/main.c:pymain_parse_cmdline_impl. When the loop in the pymain_read_conf function in this same file calls pymain_init_cmdline_argv a 2nd time, the pymain->command buffer of wchar_t is overriden and the previously allocated memory is never freed. I haven't written any code test to reproduce this, but it can be tested easily with gdb: ``` gdb -- bin/python3 -c pass start b Modules/main.c:587 b pymain_clear_pymain c c ``` You'll see that PyMem_RawMalloc is called twice without pymain->command ever being freed in pymain_clear_pymain. I have a patch coming as PR on GitHub I'd be glad to have your feedback on this issue and my proposal for a fix. Regards. -- messages: 333499 nosy: Lucas Cimon priority: normal severity: normal status: open title: Memory leak in Modules/main.c:pymain_parse_cmdline_impl when using the CLI flag ___ Python tracker <https://bugs.python.org/issue35720> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31952] Weird behavior on tupple item assignment
New submission from Lucas Bertoldo : Basically, I typed: >>> m = (list(), list()) then I got, this, as expected: >>> m[0] += [1] Traceback (most recent call last): File "", line 1, in m[0] += [1] TypeError: 'tuple' object does not support item assignment but, when I checked the variable... >>> m ([1], []) - Saying the least, one can kind of assing a value to a tuple of lists and get the expected result, but with the trackback still showing up. -- components: Interpreter Core files: python bug.png messages: 305613 nosy: Lucas Bertoldo priority: normal severity: normal status: open title: Weird behavior on tupple item assignment type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47252/python bug.png ___ Python tracker <https://bugs.python.org/issue31952> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31952] Weird behavior on tupple item assignment
Change by Lucas Bertoldo : -- versions: +Python 2.7, Python 3.5 ___ Python tracker <https://bugs.python.org/issue31952> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34016] Bug in sort()
New submission from Lucas Sampaio : lista4 = input().split() print(lista4) lista4.sort() print(lista4) Input = 6 8 10 Output: 6 8 10 ['6', '8', '10'] ['10', '6', '8'] a bug occurs when setting the 10 -- messages: 320843 nosy: lucassdssampaio priority: normal severity: normal status: open title: Bug in sort() type: behavior versions: Python 3.6 ___ Python tracker <https://bugs.python.org/issue34016> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34016] Bug in sort()
Lucas Sampaio added the comment: same code with another input type is list lista4 = input().split() print(lista4) lista4.sort() print(lista4) 6 8 9 ['6', '8', '9'] ['6', '8', '9'] lista4 = input().split() print(lista4) lista4.sort() print(lista4) 10 11 12 ['10', '11', '12'] ['10', '11', '12'] but if you put a 9 <https://bugs.python.org/issue34016> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34016] Bug in sort()
Lucas Sampaio added the comment: ok, I got it lista4 = input().split() print(lista4) lista4.sort() print(lista4) print(type(lista4[2])) 6 8 10['6', '8', '10'] ['10', '6', '8'] ok, I got it 2018-07-01 18:05 GMT-03:00 Tim Peters : > > Tim Peters added the comment: > > Lucas, as Mark said you're sorting _strings_ here, not sorting integers. > Please study his reply. As strings, "10" is less than "9", because "1" is > less than "9". > > >>> "10" < "9" > True > >>> 10 < 9 > False > > -- > nosy: +tim.peters > > ___ > Python tracker > <https://bugs.python.org/issue34016> > ___ > -- ___ Python tracker <https://bugs.python.org/issue34016> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)
Lucas Sinclair added the comment: I agree to close the issue. I tried following the steps proposed here: http://docs.python.org/devguide/ And typed these two commands on a OS X 10.8.1 with XCode and command line tools installed. $ hg clone http://hg.python.org/cpython. $ run ./configure --with-pydebug && make -j2 Python built perfectly. -- ___ Python tracker <http://bugs.python.org/issue13241> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11175] allow argparse FileType to accept encoding and errors arguments
Lucas Maystre added the comment: Here's an attempt at implementing this (my first contribution). Some notes: - I tried to keep `__repr__()` backwards compatible. It would have been easier to inherit from `_AttributeHolder`, but maybe this might break some things... - I added some test cases for `__repr__()`, but that's it. I don't think there's any other sensible test to do, as we're really just passing stuff to `open()` - not sure about the style, especially line breaks... -- keywords: +patch nosy: +lum Added file: http://bugs.python.org/file27674/filetype11175.patch ___ Python tracker <http://bugs.python.org/issue11175> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11175] allow argparse FileType to accept encoding and errors arguments
Lucas Maystre added the comment: OK, as discussed offline with Petri I'll put some tests to ensure that open() is called the right way (using unittest.mock.patch). -- ___ Python tracker <http://bugs.python.org/issue11175> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11175] allow argparse FileType to accept encoding and errors arguments
Lucas Maystre added the comment: Alright, here's a version with more tests (unittest.mock is awesome!). I think it tests exactly what it should (and no more), i.e. that the arguments are correctly passed to `open`. -- Added file: http://bugs.python.org/file27729/filetype11175.patch ___ Python tracker <http://bugs.python.org/issue11175> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11175] allow argparse FileType to accept encoding and errors arguments
Lucas Maystre added the comment: Is there something I can do something to move this forward? -- ___ Python tracker <http://bugs.python.org/issue11175> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11175] allow argparse FileType to accept encoding and errors arguments
Lucas Maystre added the comment: OK, I'll give it a try. -- ___ Python tracker <http://bugs.python.org/issue11175> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11175] allow argparse FileType to accept encoding and errors arguments
Lucas Maystre added the comment: Added some documentation for the patch. Let me know what you think. -- Added file: http://bugs.python.org/file28139/filetype11175.patch ___ Python tracker <http://bugs.python.org/issue11175> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11175] allow argparse FileType to accept encoding and errors arguments
Lucas Maystre added the comment: As per Ezio's comment, changed "l1" to "utf-8" in the example of the doc. -- Added file: http://bugs.python.org/file28195/filetype11175.patch ___ Python tracker <http://bugs.python.org/issue11175> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11175] allow argparse FileType to accept encoding and errors arguments
Lucas Maystre added the comment: Sorry for the little glitches you had to fix, I wonder why I didn't catch them. Anyways, thanks Petri! -- ___ Python tracker <http://bugs.python.org/issue11175> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11416] netrc module does not handle multiple entries for a single host
Lucas Hoffmann added the comment: What is the status of this issue? On version 3.3 I still can not get more than one entry per host. The stopping issue #12009 seems to be closed. (Sorry, if I violate some etiquette by bumping this, just tell me.) -- nosy: +luc ___ Python tracker <http://bugs.python.org/issue11416> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29430] zipfile: invalid link
New submission from Lucas Moeskops: The ZipFile documentation shows a link to the PKZip Application Node. This link, with address "https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT"; goes to a "Page Not Found" document. -- messages: 286847 nosy: lucasmus priority: normal severity: normal status: open title: zipfile: invalid link versions: Python 3.6 ___ Python tracker <http://bugs.python.org/issue29430> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10109] itertools.product with infinite iterator cause MemoryError.
Lucas Wiman added the comment: I realize this is an old (and closed!) thread, but here are a few notes from running into this issue recently, working on a search problem with infinite iterators. First, note that yegle's recursive solution is not correct, since it exhausts the iterators: >>> def product(*args): ... if len(args) == 1: ... for i in args[0]: ... yield [i] ... else: ... for i in args[0]: ... for j in product(*args[1:]): ... j.append(i) ... yield j ... >>> >>> assert len(list(itertools.product(*[iter(range(2)) for _ in range(10)]))) >>> == 2 ** 10 >>> assert len(list(product(*[iter(range(2)) for _ in range(10)]))) == 2 ** 10 Traceback (most recent call last): File "", line 1, in AssertionError This is fairly tricky to get right, and even a correct fully-lazy solution requires each iterator to eventually be fully stored in memory. For that reason, Sumudu's MemoryError is not something that can be easily escaped, though it can be delayed. For infinite iterators, the naive "lexicographic" solution to product(count(0), count(0)) would never get to 1 on the first iterator, yielding (0, 0), (0, 1), (0, 2), ... To fully explore the space, the user needs to think about how to iterate over that space, so IMO keeping infinite iterators as invalid arguments to itertools.product makes sense. -- nosy: +Lucas Wiman ___ Python tracker <http://bugs.python.org/issue10109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27623] int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero
Lucas Morales added the comment: This is actually a problem in Objects/longobject.c, in the _PyLong_AsByteArray function. It should have given an overflow error, because -1 cannot be encoded in 0 bytes. -- nosy: +lucasem ___ Python tracker <http://bugs.python.org/issue27623> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27808] os.waitpid does not return (0, 0) when child has not exited (FreeBSD)
New submission from Casey Lucas: I'm not sure if this a Python issue or a FreeBSD issue but the return value from os.waitpid is not reliably (0,0) on FreeBSD when the WNOHANG is used and the child process has not yet exited. Python docs say that the return value will be (0,0) but this is not the case. I believe it is because the FreeBSD implementation of waitpid writes an uninitialized value to the status field when a child process is not available. See also: http://stackoverflow.com/questions/38984449/is-status-value-from-os-waitpid-unreliable-when-os-wnohang-is-used-under-freebsd Maybe this is just a documentation issue? Or does the C code in the Python library need to handle this case? -- components: FreeBSD, Library (Lib) files: waitpid_test.py messages: 273167 nosy: Casey Lucas, koobs priority: normal severity: normal status: open title: os.waitpid does not return (0,0) when child has not exited (FreeBSD) versions: Python 2.7, Python 3.4 Added file: http://bugs.python.org/file44161/waitpid_test.py ___ Python tracker <http://bugs.python.org/issue27808> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int"
Changes by Lucas Hoffmann : -- nosy: +luc ___ Python tracker <https://bugs.python.org/issue14376> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10109] itertools.product with infinite iterator cause MemoryError.
Lucas Wiman added the comment: It is quite thrifty with memory compared to the size of the search space O(n*k) memory for a search space of size O(n**k). I think a reasonable expectation for itertools.product is that it should _eventually_ reach any element in the search space. The only way to maintain that expectation for infinite iterators would be be to use a Cantor-style zig-zag enumeration. Even for your example of searching over a single infinite iterator, you could end up exploring dates in the order (2010, 0), (2011, 0), (2012, 0), ... by switching the ordering of inputs. You'd never hit the rare date unless it happened on the first day of a year. There's no way to have special behavior _only_ for infinite iterators, since an infinite iterator is indistinguishable from a long-finite one due to the halting problem, so this would require changing the behavior for finite iterators too. While the output ordering is not explicitly documented, the current search order is probably depended on by plenty of existing programs, and has less surprise than a Cantor enumeration. So the only use case where the lazy enumeration matters is if: 1. You have one or more _very_ large iterators. 2. You _do not care_ what order they are searched in, or even if all possible tuples appear in the output. 3. Despite not caring about the output ordering, you still only want a few examples. I'm struggling to think of cases where that would come up. -- ___ Python tracker <http://bugs.python.org/issue10109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6447] PATCH: typo (English) in subprocess module
New submission from Lucas Prado Melo : I am pretty sure this patch is alright. -- nosy: +lucaspmelo ___ Python tracker <http://bugs.python.org/issue6447> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6467] raw_input() doesn't work as expected when it gets multiple ^D
New submission from Lucas Prado Melo : -- $ cat raw_input_test.py s = '' try: while True: c = raw_input() print c s += c except EOFError: pass $ python raw_input_test.py test^D^Dtes ^D $ python --version Python 2.7a0 $ bash --version GNU bash, version 3.2.48(1)-release (i486-pc-linux-gnu) Copyright (C) 2007 Free Software Foundation, Inc. -- Surprisingly, though: -- $ python raw_input_test.py > output test^D^D^D $ cat output test -- ^D = Press Ctrl+D I am using Ubuntu 9.04 (Jaunty Jackalope). -- components: IO messages: 90443 nosy: lucaspmelo severity: normal status: open title: raw_input() doesn't work as expected when it gets multiple ^D versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue6467> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5870] subprocess.DEVNULL
Lucas Prado Melo added the comment: -1 on this one. It is not a portable decision (only *nix OSes do have /dev/null). Also, why would we want it as a default constant? The subprocess module would need to open /dev/null every time. Despite that, I can't see how would someone use the redirection of errors to /dev/null through a python script and, at the same time, make it seem not a bad practice at all. -- nosy: +lucaspmelo ___ Python tracker <http://bugs.python.org/issue5870> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6567] Isn't inf almost equal to inf?
New submission from Lucas Prado Melo : When we use TestCase.assertAlmostEqual to compare two float('inf') objects, the result is that float('inf') is not almost equal to float('inf'). I believe this is a bug. I tested against r74195 of Python 3.2 and against Python 2.6.2. -- messages: 90902 nosy: lucaspmelo severity: normal status: open title: Isn't inf almost equal to inf? versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue6567> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6567] Isn't inf almost equal to inf?
Changes by Lucas Prado Melo : -- versions: +Python 3.2 ___ Python tracker <http://bugs.python.org/issue6567> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6567] Isn't inf almost equal to inf?
Changes by Lucas Prado Melo : -- components: +Tests ___ Python tracker <http://bugs.python.org/issue6567> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6567] Isn't inf almost equal to inf?
Changes by Lucas Prado Melo : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue6567> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6567] Make inf be almost equal to inf
Lucas Prado Melo added the comment: I would like to ask as a feature request that "inf" be almost equal to "inf". I wrote a program with a timeline class that had a method to tell the time of the last event registered into it such that some events would be positioned at the infinite when they wouldn't occur. I did generic tests that would receive any output from this method and compare to the expected result through unittest.TestCase.assertAlmostEqual(). Notice, though, that I couldn't just pick assertEqual() to do this job because the time of the last event would be defined through a series of calculations. Despite that, I believe that everything which is equal to anything else would definitely be almost equal too. Thus, it would be nice to check for equality before checking for almost-equality to define whether two objects are almost equal. -- status: closed -> open title: Isn't inf almost equal to inf? -> Make inf be almost equal to inf type: behavior -> feature request ___ Python tracker <http://bugs.python.org/issue6567> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo added the comment: I've written a patch. Hope you like it :) -- keywords: +patch nosy: +conf Added file: http://bugs.python.org/file14136/pydocs.diff ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo added the comment: The same patch with whitespaces. Is it ok now? -- Added file: http://bugs.python.org/file14137/pydocs.diff ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Changes by Lucas Prado Melo : Removed file: http://bugs.python.org/file14136/pydocs.diff ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Changes by Lucas Prado Melo : Removed file: http://bugs.python.org/file14137/pydocs.diff ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo added the comment: A new patch with an unit test and with whitespaces. -- Added file: http://bugs.python.org/file14138/pydocs.diff ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo added the comment: Ok. New patch that passes the unit tests and with a new unit test covering inexistant nested modules. -- Added file: http://bugs.python.org/file14140/pydocs.diff ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Changes by Lucas Prado Melo : Removed file: http://bugs.python.org/file14138/pydocs.diff ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo added the comment: by the way, I was not acquainted with this unit test thing... sorry -- ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo added the comment: I didn't understand what you mean: what should be shown when pydoc tries to generate documentation for a module with the bad import 'import test.i_dont_exist.neither_do_i'? I am not a native english speaker, so please excuse me if you don't understand something I've written or the other way around. -- ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo added the comment: Thanks :) It seems that the error message carried by the ImportError object comes from Python/import.c:1504. What should we do: a) Edit Python/import.c b) Change the ImportError object c) Anything else. -- ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo added the comment: Take a look at the output: $ python pydoc.py test.pydoc_badimport2 problem in test.pydoc_badimport2 - : No module named i_dont_exist.neither_do_i This is different from what you expected. How do we change this output? (I was talking about this issue in the last message) -- ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo added the comment: I had lots of stuff to do lately, sorry it took me so long to answer. Here is the patch as we intended, but there is a bug yet. What if the non-existent imported module has the same name of the module itself? $ cat pydoc_badimport3.py import this_doesnt_exist.pydoc_badimport3 $ pydoc pydoc_badimport3 I tested this possibility, and I found out that there is a bug in this situation yet: pydoc still tells the user that the module couldn't be found. -- Added file: http://bugs.python.org/file14172/pydocs.diff ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Changes by Lucas Prado Melo : Removed file: http://bugs.python.org/file14140/pydocs.diff ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo added the comment: Hey guys, I did a patch about this one. I didn't do many tests but I guess it is ok (it works like I think it should). What do you think? -- keywords: +patch nosy: +conf Added file: http://bugs.python.org/file14281/peek.diff ___ Python tracker <http://bugs.python.org/issue5811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo added the comment: Oops I overlooked I minor flaw. A second version. -- Added file: http://bugs.python.org/file14282/peek2.diff ___ Python tracker <http://bugs.python.org/issue5811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo added the comment: There's a problem with my patch... When the size of the data we want to peek is too big ( > buffer_len - start ) the cursor will move, thus there isn't a case where the peek function would work properly (except when we want to peek() just 1 byte). Couldn't we use a read() followed by a seek() instead? -- ___ Python tracker <http://bugs.python.org/issue5811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo added the comment: We could fill the buffer while moving its start point to 0. I guess this behavior would require a new function (or a new parameter to Modules/_io/bufferedio.c:_bufferedreader_fill_buffer() ). If you are ok with that I could write a patch. -- ___ Python tracker <http://bugs.python.org/issue5811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo added the comment: Here is a patch that passes all the tests (I had to change some of them though, they were expecting erroneous behaviours IMHO). The biggest problem was the read1 testing, I've tried to get the maximum of bytes less than or equal to what the user wanted while executing at most 1 raw_read()'s. I have created a new test for peek()'ing a number of bytes bigger than could possibly be stored on the buffer. -- Added file: http://bugs.python.org/file14304/peek3.diff ___ Python tracker <http://bugs.python.org/issue5811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo added the comment: Here, it's a patch that passes all the tests (I had to change some of them though, they were expecting erroneous behaviours IMHO). The biggest problem was the read1 testing, I've tried to get the maximum of bytes less than or equal to what the user wanted while executing at most 1 raw_read()'s. I have created a new test for peek()'ing a number of bytes bigger than could possibly be stored on the buffer. -- ___ Python tracker <http://bugs.python.org/issue5811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo added the comment: Ok A new patch without read1() changes. Only one test fails, a read1() test: == FAIL: test_read1 (test.test_io.PyBufferedRWPairTest) -- Traceback (most recent call last): File "/home/lucas/Codes/python-stuff/py3k/Lib/test/test_io.py", line 1139, in test_read1 self.assertEqual(pair.read1(3), b"abc") AssertionError: b'a' != b'abc' Since I've changed peek_unlocked() (which is used once by read1()), I guess there's a problem with read1() expectations about it. -- Added file: http://bugs.python.org/file14305/peek4.diff ___ Python tracker <http://bugs.python.org/issue5811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6064] Add "daemon" argument to threading.Thread constructor
Lucas Prado Melo added the comment: +1 to the py3k diff. :) Hey, I think this daemon property should be set as a keyword argument of the Thread constructor. -- nosy: +conf ___ Python tracker <http://bugs.python.org/issue6064> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo added the comment: I think this patch is ok. -- ___ Python tracker <http://bugs.python.org/issue5230> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17946] base64 encoding result should be str, not bytes
New submission from Lucas Clemente Vella: As stated in RFC 3548: Base encoding of data is used in many situations to store or transfer data in environments that, perhaps for legacy reasons, are restricted to only US-ASCII [9] data. thus, I was surprised to see, when I used base64 for the first time in python 3, that the encodig result was bytes, not str. Well, if I am encoding something to base64, I am most certainly needing it as a printable ASCII string, not as an binary byte array. Thus, I suggest that the output of: base64.b64encode(data) to be, instead, the output of: base64.b64encode(data).decode('ascii') -- components: Library (Lib) messages: 188786 nosy: Lucas.Vella priority: normal severity: normal status: open title: base64 encoding result should be str, not bytes type: enhancement versions: Python 3.3 ___ Python tracker <http://bugs.python.org/issue17946> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36647] TextTestRunner doesn't honour "buffer" argument
New submission from José Luis Segura Lucas : When using "buffer = True" in a TextTestRunner, the test result behaviour doesn't change at all. This is because TextTestRunner.stream is initialised using a decorator (_WritelnDecorator). When "buffer" is passed, the TestResult base class will try to redirect the stdout and stderr to 2 different io.StringIO objects. As the TextTestRunner.stream is initialised before that "redirection", all the "self.stream.write" calls will end using the original stream (stderr by default), and resulting in not buffering at all. -- components: Tests messages: 340398 nosy: José Luis Segura Lucas priority: normal severity: normal status: open title: TextTestRunner doesn't honour "buffer" argument type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue36647> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com