[issue37909] Thread pool return ref hold memory

2020-01-21 Thread Anders
Anders added the comment: Note: due to a change in Python 3.8 this example would be a lot less noticeable if tested. The problem remains the same though. If you run this snippet with Python 3.7, which is before the thread reuse was introduced into the ThreadPoolExecutor, each thread will

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2021-12-26 Thread Anders Kaseorg
Anders Kaseorg added the comment: If argparse will not be developed further to fix this bug, then we should undo the deprecation of optparse in the documentation (https://bugs.python.org/issue37103), since the stated justification for that deprecation was that optparse will not be developed

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2022-01-12 Thread Anders Kaseorg
Anders Kaseorg added the comment: > While optparse that it isn't being developed further, therebut will not > be taken away. IIRC the reason for this was that it too had become > difficult to build out and that is what necessitated the creation of > argparse -- there wasn&#

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Anders Hovmöller
New submission from Anders Hovmöller : >>> def foo(a): ... pass ... >>> foo() Traceback (most recent call last): File "", line 1, in TypeError: foo() missing 1 required positional argument: 'a' This error is incorrect. It says "positional argu

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Anders Hovmöller
Anders Hovmöller added the comment: Just dropping the word "positional" is very good. That word is a lie, and just removing it makes it true. -- ___ Python tracker <https://bugs.python.o

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Anders Hovmöller
Anders Hovmöller added the comment: For `foo(a, /, b)`, it could be: "TypeError: foo() missing 1 required argument 'a', and one required positional argument 'b'. If we start on this road there are some more, like for `def foo(a, *, b)` you get the error "TypeE

[issue1084] ''.find() gives wrong result in Python built with ICC

2007-09-01 Thread Simon Anders
Changes by Simon Anders: -- components: Build, Interpreter Core severity: normal status: open title: ''.find() gives wrong result in Python built with ICC versions: Python 2.5 __ Tracker <[EMAIL PROTECTED]> <http://bugs.p

[issue1084] ''.find() gives wrong result in Python built with ICC

2007-09-01 Thread Simon Anders
New submission from Simon Anders: I have just encountered a strange bug affecting Python 2.5.1 on an x86_64 Linux, but only when compiled with the Intel C Compiler (ICC) 10.0, not a GCC-compiled Python. On my Intel-compiled one, which otherwise seems to work fine, ''.find() works incor

[issue1084] ''.find() gives wrong result in Python built with ICC

2007-09-02 Thread Simon Anders
Simon Anders added the comment: Martin, you are right: is is related to compiler optimization. I have boiled it down to a call of stringlib_find (defined in Python-2.5.1/Objects/stringlib/find.h) and this runs fine with 'icc -O2' but incorrectly for 'icc -O3'. (The test co

[issue1084] ''.find() gives wrong result in Python built with ICC

2007-09-02 Thread Simon Anders
Simon Anders added the comment: Martin: I've boiled down the test case a bit more and removed all Python-specific types and macros, so that it can now be compiled stand-alone. (Updated test case 'findtest.c' attached.) I didn't feel like diving into the code much deeper, and

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-12-28 Thread Anders Kaseorg
Anders Kaseorg added the comment: James: That’s not related to this issue. This issue is about options taking arguments beginning with dash (such as a2x --asciidoc-opts --safe, where --safe is the argument to --asciidoc-opts), not positional arguments beginning with dash. Your observation

[issue12844] Support more than 255 arguments

2011-08-25 Thread Anders Kaseorg
New submission from Anders Kaseorg : This feels like an arbitrary restriction (obvious sequences have been replaced with ‘…’ to save space in this report): >>> zip([0], [1], [2], …, [1999]) File "", line 1 SyntaxError: more than 255 arguments especially when this works:

[issue12844] Support more than 255 arguments

2011-08-25 Thread Anders Kaseorg
Anders Kaseorg added the comment: I guess the desugaring is slightly more complicated in the case where the original function call already used *args or **kwargs: f(arg0, …, arg999, *args, k0=v0, …, k999=v999, **kwargs) becomes something like f(*((arg0, …, arg999) + args), **dict({&#x

[issue8595] Explain the default timeout in http-client-related libraries

2010-08-19 Thread Anders Sandvig
Changes by Anders Sandvig : -- nosy: +anders.sandvig ___ Python tracker <http://bugs.python.org/issue8595> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-19 Thread Anders Sandvig
New submission from Anders Sandvig : >From <http://mail.python.org/pipermail/python-dev/2010-July/101266.html>: Consider the following code for retreieving a web page using httplib: def get_url(hostname, port, url, timeout=5): con = httplib.HTTPConnection(hostname, port

[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-19 Thread Anders Sandvig
Anders Sandvig added the comment: The best (and simplest) solution seems to be option 2). Affected methods are found to be HTTPConnection.connect() and HTTPSConnection.connect() in Lib/httplib.py (Lib/http/client.py for 3.x) and FTP.connect() and FTP.ntransfercmd() in Lib/ftplib.py. It

[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-19 Thread Anders Sandvig
Anders Sandvig added the comment: socket.create_connection() does in fact set the timeout of the resulting socket object, so the issue is not an issue after all. The problems I experienced was a result of sending the timeout as the third parameter to the HTTPConnection() constructor instead

[issue979407] urllib2 digest auth totally broken

2010-08-19 Thread Anders Sandvig
Changes by Anders Sandvig : -- nosy: +anders.sandvig ___ Python tracker <http://bugs.python.org/issue979407> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue809163] Can't add files with spaces

2010-10-07 Thread Anders Sandvig
Changes by Anders Sandvig : -- nosy: +asandvig ___ Python tracker <http://bugs.python.org/issue809163> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-03-26 Thread Anders Kaseorg
Anders Kaseorg added the comment: > @andersk: Would the restriction to only having flags with a fixed > number of arguments be acceptable for your use case? I think that’s fine. Anyone coming from optparse won’t need options with optional arguments. However, FWIW, GNU getopt_long() su

[issue10513] sqlite3.InterfaceError after commit

2010-11-23 Thread Anders Blomdell
New submission from Anders Blomdell : With version 2.7 (and 2.7.1rc1), the following sequence (see attached test): c = cursor.execute(' select k from t where k == ?;', (1,)) conn.commit() r = c.fetchone() Traceback (most recent call last): File "/bugs/sqlite_bug.p

[issue10513] sqlite3.InterfaceError after commit

2010-11-24 Thread Anders Blomdell
Anders Blomdell added the comment: The culprit seems to be 'pysqlite_do_all_statements(self, ACTION_RESET, 0)' in pysqlite_connection_commit, which resets all active statements, but subsequent fetch/fetchall seems to trash the sqlite3 state in the statements. Removing the ACTION_R

[issue1571170] Some numeric characters are still not recognized

2010-12-09 Thread Anders Chrigström
Anders Chrigström added the comment: This is indeed a duplicate of #1571184 -- resolution: -> duplicate status: open -> closed ___ Python tracker <http://bugs.python.org/iss

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-02-06 Thread Anders Kaseorg
Anders Kaseorg added the comment: There are some problems that ‘=’ can’t solve, such as options with nargs ≥ 2. optparse has no trouble with this: >>> parser = optparse.OptionParser() >>> parser.add_option('-a', nargs=2) >>> parser.parse_args([&#

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-02-06 Thread Anders Kaseorg
Anders Kaseorg added the comment: That would be a good first step. I continue to advocate making that mode the default, because it’s consistent with how every other command line program works[1], and backwards compatible with the current argparse behavior. As far as documentation for older

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-02-06 Thread Anders Kaseorg
Anders Kaseorg added the comment: > (1) It's only deprecated in the documentation Which is why I suggested un-deprecating it in the documentation. (I want to avoid encouraging programmers to switch away from optparse until this bug is fixed.) > # proposed behavior > parser =

[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus
New submission from Anders Østhus : Hi I'm running Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32 (Server 2008 R2). I've discovered that when moving files with shutil.move, the file won't inherit the security settings as it shou

[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus
Anders Østhus added the comment: Ok, but the whole page you linked to (http://docs.python.org/library/shutil) confuses me then. It states at the top: "Warning Even the higher-level file copying functions (copy(), copy2()) can’t copy all file metadata. On POSIX platforms, this means

[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus
Anders Østhus added the comment: Ok. But that makes the whole method inconsistent. Basically, if it's on the same filesystem, rename the file, and thus not inheriting ACL. If it's on another use copy2, and inherit ACL. That makes no sense, atleast

[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus
Anders Østhus added the comment: On my system (Win Server 2008 R2 64-Bit, Python 2.7.1), when I use copy, copy2 or move(to another filesystem), the file _will_ get the ACL of the DST folder, and remove any ACL in SRC file that the DST folder does not have. Thus, it doesn't copy it fro

[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus
Anders Østhus added the comment: Thank you for taking the time to explain it to me, but it still seems inconsistent to me. I did a test with the functions copy, copy2, move, os.rename, copyfile, both on the same filesystem and another filesystem, and the result is: Same filesystem

[issue3545] Python turning off assertions (Windows)

2008-08-12 Thread Anders Bensryd
New submission from Anders Bensryd <[EMAIL PROTECTED]>: We are using Windows XP SP2, Visual Studio 2005 & Python 2.5.2. In Objects/exceptions.c the following code turns off all assertions. #if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)

[issue3545] Python turning off assertions (Windows)

2008-08-13 Thread Anders Bensryd
Anders Bensryd <[EMAIL PROTECTED]> added the comment: Yes, we could do that. However, my concerns are: 1) We cannot be the only Python user that experience this issue? I would prefer one of these solutions (in this order): a) A parameter to Py_Initialize (structure) that contro

[issue3545] Python turning off assertions (Windows)

2008-08-14 Thread Anders Bensryd
Anders Bensryd <[EMAIL PROTECTED]> added the comment: We started using Python 2.5.2 recently and a few developers have complained that they do not get any assertions anymore so yes, we do use _ASSERT() and _ASSERTE(), but after a brief look it seems as if we mainly use assert(). The dev

[issue8158] documentation of 'optparse' module incomplete

2010-03-16 Thread Simon Anders
New submission from Simon Anders : The class optparse.OptionParser supports a number of useful keyword arguments to the initializer, which are not documented in the Python Standard Library documentation, here: http://docs.python.org/library/optparse.html This is a bit unfortunate. For example

[issue8376] Tutorial offers dangerous advice about iterator s: “__iter__() can just return self”

2010-04-11 Thread Anders Kaseorg
New submission from Anders Kaseorg : The Python tutorial offers some dangerous advice about adding iterator behavior to a class: http://docs.python.org/tutorial/classes.html#iterators “By now you have probably noticed that most container objects can be looped over using a for statement

[issue8376] Tutorial offers dangerous advice about iterator s: “__iter__() can just return self”

2010-04-12 Thread Anders Kaseorg
Anders Kaseorg added the comment: As an experienced Python programmer I am obviously aware that the tutorial is trying to teach how to make an iterator class, not how to make a container class. But the tutorial doesn’t make that *clear*. It should be much more explicit about what it is

[issue1084] ''.find() gives wrong result in Python built with ICC

2007-12-04 Thread Simon Anders
Simon Anders added the comment: Update to the story: After I submitted the bug report to Intel, they investigated and quickly confirmed it to be a compiler bug, whcih they then managed to fix. I have just got an e-mail from Intel that the newest available version of ICC, namely version

[issue2138] Factorial

2008-02-22 Thread Anders Valind
Anders Valind added the comment: IMHO, The best place to put functions such as xgcd, factorial, etc, would be a new imath module, an integer equivalent of cmath. Not only would it keep the standard math module clean, it would also make clear that these functions are for integers only

[issue2138] Factorial

2008-02-23 Thread Anders Valind
Anders Valind added the comment: Yeah, I like the idea of a third party module and letting the popularity and quality decide when/if it will be included. This would also make it easier to see what kind of functionality people would want. __ Tracker <[EM

[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2022-03-26 Thread Anders Kaseorg
Anders Kaseorg added the comment: It could and does, as quoted in my original report. Content-Type: text/plain; charset*=utf-8”''utf-8%E2%80%9D That’s a U+201D right double quotation mark. This is not a valid charset for the charset of course, but it seems like the code was i

[issue31956] Add start and stop parameters to the array.index()

2019-08-27 Thread Anders Lorentsen
Anders Lorentsen added the comment: As far as I can recall, the patch is generally speaking good to go. A number of discussions arose on various details, however. In any event, I'll take a look at it during the next few days. -- ___ P

[issue31956] Add start and stop parameters to the array.index()

2019-09-15 Thread Anders Lorentsen
Anders Lorentsen added the comment: I have actually managed to lost my local branch of this fix, though I assume I can just start another one, manually copy over the changes, somehow mark this current PR as cancelled, aborted, or in my option the best: "replaced/superseeded by: [n

[issue38673] REPL shows continuation prompt (...) when comment or space entered

2019-11-07 Thread Anders Lorentsen
Anders Lorentsen added the comment: As a person without much experience, it sounded like a simple enough task, but having dug a bit, I found it quite complicated. It seems to me that the interpreter loop (in the standard REPL, that you get when you start ./python, blocks for input somewhere

[issue44283] Add jump table for certain safe match-case statements

2021-06-07 Thread Anders Munch
Anders Munch added the comment: Are you sure you want to do this? This optimisation is not applicable if the matched values are given symbolic names. You would be encouraging people to write bad code with lots of literals, for speed. -- nosy: +AndersMunch

[issue44680] Reference cycles from a WeakKeyDictionary value to its key aren’t collected

2021-07-19 Thread Anders Kaseorg
New submission from Anders Kaseorg : Because WeakKeyDictionary unconditionally maintains strong references to its values, the garbage collector fails to collect a reference cycle from a WeakKeyDictionary value to its key. For example, the following program unexpectedly leaks memory: from

[issue44680] Reference cycles from a WeakKeyDictionary value to its key aren’t collected

2021-07-19 Thread Anders Kaseorg
Anders Kaseorg added the comment: > extra_states[o] = ExtraState(obj) (Typo for extra_states[obj] = ExtraState(obj), obviously.) -- ___ Python tracker <https://bugs.python.org/issu

[issue44967] pydoc should return non-zero exit code when a query is not found

2021-08-20 Thread Gregory Anders
New submission from Gregory Anders : Currently pydoc returns an exit code of zero no matter what, even with e.g. pydoc lsjdfkdfj However, the ability to know whether or not pydoc successfully found a result is useful in tools that embed pydoc in some way. Here's one use case: Vi

[issue44967] pydoc should return non-zero exit code when a query is not found

2021-08-20 Thread Gregory Anders
Change by Gregory Anders : -- keywords: +patch pull_requests: +26323 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27868 ___ Python tracker <https://bugs.python.org/issu

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2020-01-20 Thread Anders Hovmöller
Anders Hovmöller added the comment: We were also bitten by this. In fact we still run a compatibility shim in production where we log if the new and old behavior are different. We also didn't think this "bug fix" made sense or was treated with the appropriate gravity in th

[issue43115] locale.getlocale fails if locale is set

2021-02-03 Thread Anders Munch
New submission from Anders Munch : getlocale fails with an exception when the string returned by _setlocale is already an RFC 1766 language tag. Example: Python 3.10.0a4 (tags/v3.10.0a4:445f7f5, Jan 4 2021, 19:55:53) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyr

[issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread Anders Munch
Anders Munch added the comment: I discovered that this can happen with underscores as well: Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license"

[issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread Anders Munch
Anders Munch added the comment: getlocale is documented to return None for the encoding if no encoding can be determined. There's no need to guess. I can't change the locale.setlocale call, because where I'm actually having the problem, I'm not even calling locale.set

[issue43115] locale.getlocale fails if locale is set

2021-02-17 Thread Anders Munch
Anders Munch added the comment: > BTW: What is wxWidgets doing with the returned values ? wxWidgets doesn't call getlocale, it's a C++ library (wrapped by wxPython) that uses C setlocale. What does use getlocale is time.strptime and datetime.datetime.strptime, so when ge

[issue43115] locale.getlocale fails if locale is set

2021-02-23 Thread Anders Munch
Anders Munch added the comment: >> What does use getlocale is time.strptime and datetime.datetime.strptime, so >> when getlocale fails, strptime fails. > Would they work with getlocale() returning None for the encoding ? Yes. All getlocale is used for in _strptime.py is comp

[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2021-02-25 Thread Anders Kaseorg
New submission from Anders Kaseorg : We ran into a UnicodeEncodeError exception using email.parser to parse this email <https://lists.cam.ac.uk/pipermail/cl-isabelle-users/2021-February/msg00135.html>, with full headers available in the raw archive <https://lists.cam.ac.uk/pip

[issue10513] sqlite3.InterfaceError after commit

2012-02-16 Thread Anders Blomdell
Anders Blomdell added the comment: > So my suggestion is to remove in "pysql_connection_commit" the call to : > pysqlite_do_all_statements(self, ACTION_RESET, 0); > to bring back the correct old behavior. That's what I have been running for years, now... > And a

[issue37103] Undo deprecation of optparse

2019-05-30 Thread Anders Kaseorg
New submission from Anders Kaseorg : The optparse library is currently marked in the documentation as deprecated in favor of argparse. However, argparse uses a nonstandard reinterpretation of Unix command line grammars that makes certain arguments impossible to express, and causes scripts to

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2018-12-12 Thread Anders Kaseorg
Anders Kaseorg added the comment: porton: Please don’t steal someone else’s issue to report a different bug. Open a new issue instead. -- title: argparse: add a full fledged parser as a subparser -> argparse does not accept options taking arguments beginning with dash (regress

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-04-18 Thread Anders Hovmöller
Anders Hovmöller added the comment: @larsonreever That lib is pretty limited, in that it doesn't handle dates or deltas. Again: my lib that is linked above does and has comprehensive tests. -- ___ Python tracker <http://bugs.python.org/is

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2019-03-22 Thread Anders Hovmöller
Anders Hovmöller added the comment: I just discovered this ticket again and see that it's stuck! I have read through the thread but it's still a bit unclear what would be required to test this with homebrew like Guido says is needed for this to go forward. Is there anyone who can

[issue36485] Add a way to clear all caches

2019-03-31 Thread Anders Hovmöller
Anders Hovmöller added the comment: I think this is a great idea. We would have needed this many times for tests over the years. -- nosy: +Anders.Hovmöller ___ Python tracker <https://bugs.python.org/issue36

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2019-04-11 Thread Anders Hovmöller
Anders Hovmöller added the comment: This was a really bad idea in my opinion. We just found this and we have no way to know how this will impact production. It's really absurd that re.sub('(.*)', r'foo', 'asd') is "foo" in python 1 to 3.6

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2019-04-11 Thread Anders Hovmöller
Anders Hovmöller added the comment: Just as a comparison, sed does the 3.6 thing: > echo foo | sed 's/\(.*\)/x\1y/g' xfooy -- ___ Python tracker <https://bugs.pytho

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2019-04-12 Thread Anders Hovmöller
Anders Hovmöller added the comment: That might be true, but that seems like a weak argument. If anything, it means those others are broken. What is the logic behind "(.*)" returning the entire string (which is what you asked for) and exactly one empty string? Why not two empty str

[issue32601] PosixPathTest.test_expanduser fails in NixOS build sandbox

2018-01-19 Thread Anders Kaseorg
New submission from Anders Kaseorg : PosixPathTest.test_expanduser fails in the NixOS build sandbox, where every user has home directory /, so it falls off the end of the for pwdent in pwd.getpwall() loop. nixbld:x:30001:3:Nix build user:/:/noshell nobody:x:65534:65534:Nobody:/:/noshell

[issue32764] Popen doesn't work on Windows when args is a list

2018-02-04 Thread Anders Lorentsen
Anders Lorentsen added the comment: This is strange, because _execute_child calls os.fsdecode with `args` as the argument, which may be a list. os.fsdecode calls fspath. Now, the python docstring of _fspath, as defined in Lib/os.py on line 1031, clearly states that it will raise a TypeError

[issue32764] Popen doesn't work on Windows when args is a list

2018-02-04 Thread Anders Lorentsen
Anders Lorentsen added the comment: Also, isn't there continuous integration testing? Everything passed on the PR, so where does this come from? -- ___ Python tracker <https://bugs.python.org/is

[issue32764] Popen doesn't work on Windows when args is a list

2018-02-04 Thread Anders Lorentsen
Anders Lorentsen added the comment: Wait a minute. The failing test is test_nonexisting_with_pipes, and it fails because args[0] is a tuple - how can that be? Nobody is supposed to pass cmd=sequence-where-first-element-is-a-tuple! Is everything all right with the test itself

[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-05 Thread Anders Lorentsen
Anders Lorentsen added the comment: > # runs this weird file > subprocess.run([bin]) > # Currently an error; if this is implemented, would run > # /bin/ls, and pass it the -l argument. Refers to something > # completely different than our .exists() call above. I do not underst

[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-06 Thread Anders Lorentsen
Anders Lorentsen added the comment: What do you mean "is a bug", and "the PR would encourage this"? Can't it be fixed? Are you saying that just because it is a bug now, we should be discouraged from making it work in the way you'd expect it to work? If `exe`

[issue33143] encode UTF-16 generates unexpected results

2018-03-26 Thread Anders Rundgren
New submission from Anders Rundgren : Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> v = '\u20ac' >>> p

[issue33143] encode UTF-16 generates unexpected results

2018-03-26 Thread Anders Rundgren
Anders Rundgren added the comment: Thanx for the superquick response! I really appreciate it. I'm obviously a Python n00b Anders -- ___ Python tracker <https://bugs.python.org/is

[issue31843] sqlite3.connect() should accept PathLike objects

2017-11-06 Thread Anders Lorentsen
Anders Lorentsen added the comment: Had my first go at a python patch. Added a test case for it, and all tests passing when I test with `./python -bb -E -Wd -m test -v test.test_sqlite -r -w -uall -R 3:2` -- nosy: +Phaqui ___ Python tracker <ht

[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2017-11-06 Thread Anders Lorentsen
Anders Lorentsen added the comment: I was able to make a test that reproduces your code, and expectedly fails. Also implemented a fix for it. See a temporary diff here: https://pastebin.com/C9JWkg0i However, there is also a specific MS Windows version of _execute_child() (a phrase only

[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2017-11-07 Thread Anders Lorentsen
Anders Lorentsen added the comment: While researching this, I discovered that on MS Windows >>> subprocess.run([pathlike_object, additional_arguments]) did not run like it did on Posix. My PR includes this problem and it's fix. --

[issue31956] Add start and stop parameters to the array.index()

2017-11-12 Thread Anders Lorentsen
Anders Lorentsen added the comment: I decided to work on this, and I would like some review, as this would be my second contribution to cpython. Also, a general question: As I defined the start and end arguments Py_ssize_t, bigger indexes (more negative or more positive) than what can fit in

[issue31956] Add start and stop parameters to the array.index()

2017-11-13 Thread Anders Lorentsen
Anders Lorentsen added the comment: Writing my tests, I originally looked at Lib/test/seq_tests.py. One test case uses indexes that are (+-)4*sys.maxsize. This does not fit in Py_ssize_t, and so these tests cause my array implementation to raise an overflow exception. A solution is of course

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2017-11-25 Thread Anders Hovmöller
Change by Anders Hovmöller : -- versions: +Python 3.6 ___ Python tracker <https://bugs.python.org/issue22490> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2017-11-25 Thread Anders Hovmöller
Change by Anders Hovmöller : -- nosy: +Anders.Hovmöller ___ Python tracker <https://bugs.python.org/issue22490> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34861] Improve cProfile standard output

2018-10-01 Thread Anders Hovmöller
New submission from Anders Hovmöller : The standard output for cProfile when run from a command line is not very useful. It has two main flaws: - Default sort order is by name of function - It strips the full path of source files The first makes it very hard to look at the output. The second

[issue34861] Improve cProfile standard output

2018-10-01 Thread Anders Hovmöller
Change by Anders Hovmöller : -- keywords: +patch pull_requests: +9046 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34861> ___ ___ Py

[issue34861] Improve cProfile standard output

2018-10-05 Thread Anders Hovmöller
Anders Hovmöller added the comment: There is an example output on github. Should I paste it here too? I can do it once I get home if you want. -- ___ Python tracker <https://bugs.python.org/issue34

[issue34861] Improve cProfile standard output

2018-10-07 Thread Anders Hovmöller
Anders Hovmöller added the comment: Output before this patch: 3666 function calls (3556 primitive calls) in 0.005 seconds Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function) 20.0000.0000.0020.001 :1009

[issue15292] import hook behavior documentation improvement

2012-07-08 Thread Anders Hammarquist
New submission from Anders Hammarquist : When testing Eutaxia on PyPy (1.9) I discovered a discrepancy in the path_hooks import hook implementation. In CPython (2.7), if the find_module() method raises ImportError (as imp.find_module() does when it does not find a module in the given path

[issue15429] types.NoneType missing

2012-07-22 Thread Anders Kaseorg
Changes by Anders Kaseorg : -- assignee: docs@python components: Documentation nosy: andersk, docs@python priority: normal severity: normal status: open title: types.NoneType missing type: behavior versions: Python 3.2 ___ Python tracker <h

[issue15429] types.NoneType missing

2012-07-22 Thread Anders Kaseorg
New submission from Anders Kaseorg : http://docs.python.org/py3k/library/constants.html#None says that None is the sole value type types.NoneType. However, NoneType was removed from the types module with Python 3. -- ___ Python tracker <h

[issue20288] HTMLParse handing of non-numeric charrefs broken

2014-01-17 Thread Anders Hammarquist
New submission from Anders Hammarquist: Python 2.7 HTMLParse.py lines 185-199 (similar lines still exist in Python 3.4) match = charref.match(rawdata, i) if match: ... else: if ";" in rawdata[i:]

[issue6682] Default traceback does not handle PEP302 loaded modules

2009-08-11 Thread Anders Blomdell
New submission from Anders Blomdell : While trying to get a PEP302 import hook to function properly, I found that the default traceback picks up the wrong sourcecode for PEP302 loaded modules. The testcase pep302_traceback.py tries to emulate the behavior of the files in ordinary, which

[issue1759169] clean up Solaris port and allow C99 extension modules

2010-01-02 Thread anders musikka
anders musikka added the comment: Just wanted to chip in my $.02: Defining _XOPEN_SOURCE in the python headers causes problems for Solaris. It also causes problems for Ubuntu Linux. Because _XOPEN_SOURCE is defined, Python.h must included first in any program under Ubuntu. Perhaps the right

[issue5704] Command line option '-3' should imply '-t'

2009-04-05 Thread Simon Anders
New submission from Simon Anders : The '-3' command line option in Python 2.6 is supposed to warn whenever encountering something that would throw an error in Python 3. Mixing of tabs and spaces has become illegal in Python 3. However, Python 2.6, called with '-3', passe

[issue8376] Tutorial offers dangerous advice about iterator s: “__iter__() can just return self”

2010-07-22 Thread Anders Kaseorg
Anders Kaseorg added the comment: I don’t think that small change is good enough, if it is still the case that the only provided example is the dangerous one. It would be easy to clarify the differences between the classes: >>> rl = test.ReverseList('spam') >>> [

[issue8376] Tutorial offers dangerous advice about iterator s: “__iter__() can just return self”

2010-07-22 Thread Anders Kaseorg
Anders Kaseorg added the comment: Antoine: That’s true. Amaury: See my original bug description (“This is reasonable advice for writing an iterator class, but terrible advice for writing a container class…”), and my other comments. There is nothing wrong with explaining how to write an

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-22 Thread Anders Kaseorg
New submission from Anders Kaseorg : Porting the a2x program to argparse from the now-deprecated optparse subtly breaks it when certain options are passed: $ a2x --asciidoc-opts --safe gitcli.txt $ ./a2x.argparse --asciidoc-opts --safe gitcli.txt usage: a2x [-h] [--version] [-a ATTRIBUTE

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-22 Thread Anders Kaseorg
Anders Kaseorg added the comment: > Though in general I find argparse's default behavior more useful. I’m not sure I understand. Why is it useful for an option parsing library to heuristically decide, by default, that I didn’t actually want to pass in the valid option that I p

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-23 Thread Anders Kaseorg
Anders Kaseorg added the comment: > Note that the negative number heuristic you're complaining about > doesn't actually affect your code below. Yes it does: >>> import argparse >>> parser = argparse.ArgumentParser(prog='a2x') >>> parser.

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-26 Thread Anders Kaseorg
Anders Kaseorg added the comment: > I still disagree. You're giving the parser ambiguous input. If a > parser sees "--foo --bar", and "--foo" is a valid option, but "--bar" > is not, this is a legitimately ambiguous situation. There is no ambiguit

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-26 Thread Anders Kaseorg
Anders Kaseorg added the comment: > arguments = *(positional-argument / option) [-- *(positional-argument)] > positional-argument = string > option = foo-option / bar-option > foo-option = "--foo" string > bar-option = "--bar" Er, obviously po

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-02 Thread Anders Hovmöller
Anders Hovmöller added the comment: > > By the way, I just discovered, that the way we treat microseconds differs > from the strptime one : we are smarter read every digits and smartly round to > six, strptime doesn't go that far and just *truncate* to this. Should go

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2016-07-19 Thread Anders Hovmöller
Anders Hovmöller added the comment: > The `arrow` library depends on the supposed "strict" behaviour of strptime > that has never been guaranteed, which often results in very buggy behaviour > under some conditions. Well… the arrow library accepts all sorts of broken in

  1   2   >