[issue38487] expat infinite loop

2019-10-15 Thread Marcos Dione
New submission from Marcos Dione : I'm trying to add external entities support to xmltodict[1]. For that I extended the handler to have a ExternalEntityRefHandler handler. After reading a couple of files, the script lock in a tight loop. I ran the script with gdb (!!) and found that expat

[issue36100] int() and float() should accept any isnumeric() digit

2019-02-24 Thread Marcos Dione
Marcos Dione added the comment: Thanks for all the examples, I'm convinced. -- resolution: -> not a bug stage: -> resolved status: open -> closed versions: +Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <https://bug

[issue36100] int() and float() should accept any isnumeric() digit

2019-02-24 Thread Marcos Dione
New submission from Marcos Dione : Following https://blog.lerner.co.il/pythons-str-isdigit-vs-str-isnumeric/, we have this: Python 3.8.0a1+ (heads/master:001fee14e0, Feb 20 2019, 08:28:02) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "licens

[issue33671] Efficient zero-copy for shutil.copy* functions (Linux, OSX and Win)

2018-06-13 Thread Marcos Dione
Marcos Dione added the comment: Thanks Gianpaolo for pushing for this. Great job. -- ___ Python tracker <https://bugs.python.org/issue33671> ___ ___ Python-bug

[issue26826] Expose new copy_file_range() syscall in os module.

2018-05-25 Thread Marcos Dione
Marcos Dione <mdi...@grulic.org.ar> added the comment: I'm really sorry, but I don't have time to continue with this (new daughter!). Can someone else pick it up? -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue28273] Make os.waitpid() option parameter optional.

2016-09-25 Thread Marcos Dione
Changes by Marcos Dione <mdi...@grulic.org.ar>: -- components: +Library (Lib) type: -> enhancement versions: +Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue28273] Make os.waitpid() option parameter optional.

2016-09-25 Thread Marcos Dione
New submission from Marcos Dione: According to the documentation, the second parameter for os.waitpid(), called options, must be most of the time 0. So why not make it the default value? The attached patch implements the proposed change, which is API compatible with current usages

[issue28019] itertools.count() falls back to fast (integer) mode when step rounds to 1

2016-09-08 Thread Marcos Dione
Changes by Marcos Dione <mdi...@grulic.org.ar>: -- versions: +Python 3.3, Python 3.4 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue28019] itertools.count() falls back to fast (integer) mode when step rounds to 1

2016-09-08 Thread Marcos Dione
Marcos Dione added the comment: New patch following comments from SilentGhost. -- Added file: http://bugs.python.org/file44467/fix_28019.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue28019] itertools.count() falls back to fast (integer) mode when step rounds to 1

2016-09-08 Thread Marcos Dione
Changes by Marcos Dione <mdi...@grulic.org.ar>: -- versions: +Python 3.3, Python 3.4 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue28019] itertools.count() falls back to fast (integer) mode when step rounds to 1

2016-09-08 Thread Marcos Dione
Marcos Dione added the comment: Here's a first approach on fixing this bug. I'm not sure how to handle the case where step=1.0. -- keywords: +patch Added file: http://bugs.python.org/file44466/fix_28019.diff ___ Python tracker <

[issue28019] itertools.count() falls back to fast (integer) mode when step rounds to 1

2016-09-08 Thread Marcos Dione
New submission from Marcos Dione: If the `step` parameter for `itertools.count()` rounds to 1 (f.i., 1.1, 1.437643, 1.9), then it fallsback to fast (integer) mode and increases the counter by 1. Here's an example: Python 3.6.0a4+ (default:ddc95a9bc2e0+, Sep 8 2016, 14:46:19) >>&g

[issue26826] Expose new copy_file_range() syscall in os module.

2016-07-11 Thread Marcos Dione
Marcos Dione added the comment: Fixed extra space and semicolon (?!?!). Also, I'm getting 500 errors from riedvelt when I try to reply to comments. -- Added file: http://bugs.python.org/file43688/copy_file_range.diff ___ Python tracker <

[issue26826] Expose new copy_file_range() syscall in os module.

2016-07-06 Thread Marcos Dione
Marcos Dione added the comment: Another version: * Changed availability to kernel type, version and date. -- Added file: http://bugs.python.org/file43640/copy_file_range.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue26826] Expose new copy_file_range() syscall in os module.

2016-07-06 Thread Marcos Dione
Marcos Dione added the comment: New version: * Adds a new test for offset parameters. -- Added file: http://bugs.python.org/file43639/copy_file_range.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26826] Expose new copy_file_range() syscall in os module.

2016-07-04 Thread Marcos Dione
Marcos Dione added the comment: * Updated the patch to latest version. * PEP-8'ed the tests. * Dropped flags from the API but not the internal function. -- Added file: http://bugs.python.org/file43624/copy_file_range.diff ___ Python tracker <

[issue26826] Expose new copy_file_range() syscall in os module.

2016-06-09 Thread Marcos Dione
Marcos Dione added the comment: ENOSYS catching fixed. -- Added file: http://bugs.python.org/file43319/copy_file_range.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26826] Expose new copy_file_range() syscall in os module.

2016-06-09 Thread Marcos Dione
Marcos Dione added the comment: Fixed the last comments, including comparing what was written to the original data, but only to the length of what was actually written. I'm just not sure if the way to handle the syscall not existing is ok. -- Added file: http://bugs.python.org

[issue26826] Expose new copy_file_range() syscall in os module.

2016-06-08 Thread Marcos Dione
Marcos Dione added the comment: I added a couple of unit tests, which lead me to fix a couple of bugs (yay!). I discarded the idea of removing any reference to flags. -- Added file: http://bugs.python.org/file43310/copy_file_range.diff ___ Python

[issue26826] Expose new copy_file_range() syscall in os module.

2016-05-12 Thread Marcos Dione
Marcos Dione added the comment: I settled for s/in/src/ and s/out/dst/, fixed typos, made sure the docs are in sync (parameters in the docstring were out of order), rephrased paragraph about flags parameter and included the configure.ac code for detecting availability of the syscall. I'm also

[issue26826] Expose new copy_file_range() syscall in os module.

2016-05-04 Thread Marcos Dione
Marcos Dione added the comment: Sorry for the delay. Based on suggestions in the mailing list, I changed the *count* handling as if it were a ssize_t, and I added a note about ignored output parameters. -- title: Expose new copy_file_range() syscal in os module. -> Expose

[issue26826] Expose new copy_file_range() syscal in os module.

2016-04-29 Thread Marcos Dione
Marcos Dione added the comment: I fixed most of the type problems, except that I'm not sure how to convert to size_t. Someone suggested to convert with 'n', then check if it's negative and correct. I'll ask the mailing list for better suggestions. I also noted that running 'hg diff' shows

[issue26826] Expose new copy_file_range() syscal in os module.

2016-04-29 Thread Marcos Dione
Marcos Dione added the comment: > Yes, having a high-level version of copy_file_range() that falls back to > copyfileobj() should be okay. I'm not sure about this. For the moment c_f_o() is available only if the syscall is there. > I am wondering if it would be nice to

[issue26826] Expose new copy_file_range() syscal in os module.

2016-04-28 Thread Marcos Dione
Marcos Dione added the comment: I managed to modify the congigure.ac file so it includes the proper test. after I run autoconf it generated the proper configure script, but I also needed to run autoheaders (both run by make autoconf). This last command modified a generated file that's

[issue26826] Expose new copy_file_range() syscal in os module.

2016-04-28 Thread Marcos Dione
Marcos Dione added the comment: I'll do the copyfile() part once I'm convinced it doesn't break anything else. -- title: Expose new copy_file_range() syscal in os module and use it to improve shutils.copy() -> Expose new copy_file_range() syscal in os mod

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-28 Thread Marcos Dione
Marcos Dione added the comment: > About changing copyfileobj(), here are some test cases which may help explain > the compatibility problems: I see, I was expecting something like that after reading https://bugs.python.org/issue25063 's conclusions. I removed that part. > Perhaps

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-27 Thread Marcos Dione
Marcos Dione added the comment: Updated the patch withe most of Martin Panter's and all vadium's comments. -- Added file: http://bugs.python.org/file42628/copy_file_range.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-27 Thread Marcos Dione
Marcos Dione added the comment: > I didn’t see any changes to the configure script in your patches. Did you > make that change to define HAVE_COPY_FILE_RANGE yet? I'm not really sure how to make the test for configure.ac. Other functions are checked differently (availability of header

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Marcos Dione
Changes by Marcos Dione <mdi...@grulic.org.ar>: Removed file: http://bugs.python.org/file42617/copy_file_range.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Marcos Dione
Marcos Dione added the comment: New version. Factoring the old method in a nested function also paves the way to implement https://bugs.python.org/issue25156 . -- Added file: http://bugs.python.org/file42619/copy_file_range.diff ___ Python tracker

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Marcos Dione
Marcos Dione added the comment: Hmm, I just noticed that it doesn't fallback to normal copy if the arguments are not valid (EBADF, EXDEV). Back to the drawing board... -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Marcos Dione
Marcos Dione added the comment: Ok, I have a preliminary version of the patch. It has several parts: * Adding the functionality to the os module, with docstring. * Make shutil.copyfileobj() to use it if available. * Modify the docs (this has to be done by hand, right?). * Modify NEWS and ACKS

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Marcos Dione
Marcos Dione added the comment: Version without the NEWS and ACKS change. -- Added file: http://bugs.python.org/file42617/copy_file_range.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-26 Thread Marcos Dione
Changes by Marcos Dione <mdi...@grulic.org.ar>: Removed file: http://bugs.python.org/file42616/copy_file_range.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-25 Thread Marcos Dione
Marcos Dione added the comment: Then I don't know. My only worry is whether having the method local to os would allow shutils.copy() to use it or not. I will start by looking at other similar functions there to see to do it. urandom() looks like a good starting point

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-23 Thread Marcos Dione
Marcos Dione added the comment: Already there: http://man7.org/linux/man-pages/man2/copy_file_range.2.html -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-23 Thread Marcos Dione
Marcos Dione added the comment: Debian Sid, arch Linux and Fedora FC24 (alpha) already have linux-4.5, others would certainly follow soon. Meanwhile, I could start developing the patch and we could review it when you think it's appropriate

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-22 Thread Marcos Dione
New submission from Marcos Dione: copy_file_range() has been introduced in the Linux kernel since version 4.5 (mid march 2016). This new syscall allows to copy data from one fd to another without passing by user space, improving speed in most cases. You can read more about it here: https

[issue26601] Use new madvise()'s MADV_FREE on the private heap

2016-03-21 Thread Marcos Dione
New submission from Marcos Dione: Linux kernel's new madvise() MADV_FREE[1] could be used in the memory allocator to signal unused parts of the private heap as such, allowing the kernel use those pages for resolving lowmem pressure situations. From a LWN article[2]: [...] Rather than

[issue1580738] httplib hangs reading too much data

2007-10-12 Thread Marcos Dione
Marcos Dione added the comment: with facundo we were tracking this bug down. mhammond is right about that read() should allow 0 size responses, but the bug is that the response is not closed. HTTPResponse.read() says: if amt is None: # unbounded read