[issue10231] SimpleHTTPRequestHandler directory bugs

2017-11-25 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: On 26/11/17 04:59, Martin Panter wrote: > That leaves the fourth complaint, which I don’t understand: ‘translate_path() > does not handle initial "."/".." on non-Posix systems’. > > As far as I know, in 2010 (and still in

[issue10133] multiprocessing: conn_recv_string() broken error handling

2012-06-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Richard Oudkerk wrote: > Thanks for the patch, I have applied it. (I don't think there was a > problem with the promotion rules because res was a never converted to > UINT32.) True now that res is a Py_ssize_t. It was int when I w

[issue10231] SimpleHTTPRequestHandler directory bugs

2010-11-22 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Senthil Kumaran writes: > I have doubts on the validity of this bug itself. > > - First is, query and fragment are usually for the file being served > from the webserver, not on the directories. If there are characters such > as &#x

[issue10458] 2.7 += re.ASCII

2010-11-19 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : Could Python 2.7 get a dummy re.ASCII = re.A flag, for source code compatibility with 3.2? -- components: Regular Expressions messages: 121520 nosy: hfuru priority: normal severity: normal status: open title: 2.7 += re.ASCII type: feature

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-19 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Éric Araujo writes: >> That's fair enough. > > :) Do you want to close this feature request then? Me? No. I just figured that after all this arguing, I should mention that closing it as out of scope is not something I'

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-15 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Éric Araujo writes: > I think 2to3 is designed to take 2.x code and turn it into 3.x code. > Codebases using tricks and hacks to support both 2.x and 3.x (like the > example you linked to) cannot be handled by 2to3. That'

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-15 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Hallvard B Furuseth writes: >Martin v. Löwis writes: >> Ok, I can propose two different spellings of this without any >> macro processor: (...) > > Both your examples fit my request perfectly. Pieces of code which I > presume are

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-15 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Martin v. Löwis writes: > As this code is in a Python 2.x block: why does this change cause > problems to you? You are supposed to run the 2to3 result in Python 3, > and this conversion result will run correctly in Python 3. As I've explain

[issue10350] errno is read too late

2010-11-15 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Terry J. Reedy writes: > There is one relocation of memory freeing Modules/timemodule.c does '#if,if(..errno..)' after PyMem_Free(outbuf), which can overwrite the desired errno. Instead of reading errno into a temporary, I moved the f

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Martin v. Löwis writes: > And I still don't understand the rationale for this request. Can you > please post an example Python module that has this markup you are asking > for, so I can show you how to achieve what you want without the m

[issue10359] ISO C cleanup

2010-11-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: STINNER Victor writes: > Python-ast.c: why do you move req_name and req_type outside PyAST_obj2mod()? Eh, in case I've managed to be sufficiently unclear: The reason I modified it at all was because the initialization is not valid in C90, onl

[issue10308] Modules/getpath.c bugs

2010-11-11 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: STINNER Victor writes: > The following change is useless, it cannot overflow: > -if (n + k > MAXPATHLEN) > +if (k > MAXPATHLEN - n) > k = MAXPATHLEN - n; > > n and k maximum values are MAXPATHLEN (and the maximum

[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-09 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Hi, I'm back... I've been reading your last message a few times and I'm not sure what I'm to reconsider. We've had a way of talking past each toerh before, as far as I can remember. I think my request still now translate

[issue10375] 2to3 print(single argument)

2010-11-09 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : Could 2to3 without -p notice more cases of print(single argument), to avoid slapping another () around them? For example: print(2*3) print(", ".join(dir)) print(very + long + single + argument) My internal bug detector zooms i

[issue960325] "--require " option for configure/make (fail if building not possible)

2010-11-09 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Just for the record, I think you read this a bit too fast before closing: Terry J. Reedy writes: > I am closing this as some combination of wrong, inapplicable, > out-of-date, and postponed. > > 1. (...) For bz2, there is "This

[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-11-09 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: urlunparse(url or params = bytes object) produces a result with the repr of the bytes object if params is set. urllib.parse.urlunparse(['http', 'host', '/dir', b'params', '', '']) --> &quo

[issue10359] ISO C cleanup

2010-11-09 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Hallvard B Furuseth writes: > (...) which is what the current code actually executes. Er, I mean, that's what it does with req_type. The 'static' for req_name is an optimization o

[issue10359] ISO C cleanup

2010-11-09 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: STINNER Victor writes: > Python-ast.c: why do you move req_name and req_type outside PyAST_obj2mod()? Because there's no need to initialize the arrays each time PyAST_obj2mod is called. C90-friendly code inside PyAST_obj2mod would be PyAST

[issue10359] ISO C cleanup

2010-11-09 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: ,AIric Araujo writes: > By the way, do these changes actually fix errors or are they just > cleanups and pedantic (not a slight) fixes? I've used compilers where they'd be compile errors, though I found them just with gcc -pedantic i

[issue10312] intcatcher() can deadlock

2010-11-09 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Sorry, my patch is useless if the OS calls the handler with the signal blocked. It should also unblock the signal before doing anything which can do FILE* operations. And set the handler again? Or just leave the next signal to abort the process? I

[issue10325] PY_LLONG_MAX & co - preprocessor constants or not?

2010-11-09 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: No, PY_LLONG_MAX lacks a paren. Found by the revolutionary method of actually testing it (made the previous branches #if 0's). bugs.python.org is not responding, but here's what I'm using now: Index: I

[issue10325] PY_LLONG_MAX & co - preprocessor constants or not?

2010-11-08 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Hallvard B Furuseth writes: > Looks fine to me. Hold on.. #elif defined SIZEOF_LONG_LONG would be a bit safer than #else. -- ___ Python tracker <http://bugs.python.org/issu

[issue10359] ISO C cleanup

2010-11-08 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : Here are some ISO C conformance patches, and a minor cleanup I encountered along the way. Lib/distutils/tests/test_config_cmd.py // comment --> /* comment */. Lib/distutils/tests/test_build_ext.py, Objects/weakrefobject.c, Modules/_pickle.c, Modu

[issue10325] PY_LLONG_MAX & co - preprocessor constants or not?

2010-11-08 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: I wrote: >> BTW, do you know of any modern non-Windows platforms that don't define >> LLONG_MIN and LLONG_MAX? It may well be that the "two's complement" >> fallback hasn't been exercised in recent years. >

[issue10350] errno is read too late

2010-11-08 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : errno is sometimes read too late after the error: After another call may have modified it. Here's a patch against py3k. Most of it or a variant applies to 2.7 too, but I haven't really looked at that. I've not looked at math code, whe

[issue10325] PY_LLONG_MAX & co - preprocessor constants or not?

2010-11-08 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Mark Dickinson writes: > Here's a patch (against py3k) incorporating your suggestions. Would you > be willing to review? Looks fine to me. (Actually the gcc branch makes the same assumptions as the final branch, but then I expect gcc itse

[issue10325] PY_LLONG_MAX & co - preprocessor constants or not?

2010-11-06 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: I wrote: > #define PY_LLONG_MAX \ > (1 + 2 * ((Py_LL(1) << (CHAR_BIT*SIZEOF_LONG_LONG-2)) - 1)) > #define PY_ULLONG_MAX (PY_LLONG_MAX * 2ULL + 1) Eh, Py_ULL(2). > (...) I just get peeved when people get this > wrong, then doc

[issue10343] urllib.parse problems with bytes vs str

2010-11-06 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : urlunparse(url or params = bytes object) produces a result with the repr of the bytes object. urllib.parse.urlunparse(['http', 'host', '/dir', b'params', '', '']) --> "http://host/dir

[issue10325] PY_LLONG_MAX & co - preprocessor constants or not?

2010-11-06 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Mark Dickinson writes: > Thanks for the report; I agree that there's a potential issue here, and > I also think that all these definitions *should* be preprocessor > defines. Indeed, my suggestion to castify everything for uniformity was

[issue10325] PY_LLONG_MAX & co - preprocessor constants or not?

2010-11-05 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : Include/pyport.h invites potential compile errors with the definitions #define PY_LLONG_MIN LLONG_MIN #define PY_LLONG_MAX LLONG_MAX #define PY_ULLONG_MAX ULLONG_MAX which can fall back to gcc variants or to #else /* Otherwise, rely on two&#

[issue10311] Signal handlers must preserve errno

2010-11-05 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Antoine Pitrou writes: > I think it is extremely unlikely that mutating errno in a signal handler > is unsafe (after all, the library functions called from that handler can > mutate errno too: that's the whole point of the patch IIUC

[issue10311] Signal handlers must preserve errno

2010-11-05 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Antoine Pitrou writes: > By the way, I'd like to clear out a potential misunderstanding: the > function you are patching doesn't call Python signal handlers in itself > (those registered using signal.signal()). (...) Good point - I

[issue10313] Reassure user: test_os BytesWarning is OK

2010-11-05 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Antoine Pitrou writes: > Hallvard, if you update your py3k working copy, do these warnings disappear? Yes, switching to the svn version shuts them up. -- ___ Python tracker <http://bugs.python.org/issu

[issue10320] printf %qd is nonstandard

2010-11-05 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : Modules/_ctypes/callproc.c:PyCArg_repr() uses sprintf(%qd, long long), which is a GNU (and more?) extension. ISO C99 says %lld. Instead, use "%" PY_FORMAT_LONG_LONG "d" from pyconfig.h/pyport.h. Kills off #ifdef MS_WIN32 too. If P

[issue10313] Reassure user: test_os BytesWarning is OK

2010-11-04 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: R. David Murray writes: > I don't see any bytes warnings when I run test_os with -b or -bb on > linux on py3k trunk. (If there were such a warning and it was expected, > the fix would be to capture the warning and ignore it.) > > Unde

[issue10311] Signal handlers must preserve errno

2010-11-04 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Amaury Forgeot d'Arc writes: > OTOH this is really a micro optimization. ["this" = only saving/restoring errno when needed] True, but practically nothing is officially safe to do in signal handlers, so it's good to avoid code whi

[issue960325] "--require " option for configure/make (fail if building not possible)

2010-11-04 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Once upon a time, Terry J. Reedy wrote: > Hallvard, do you still consider this a live issue? If this general behavior remains, yes. It's been a while since I had a computer without these libraries to test it on. (Which is why I punted and then f

[issue10313] Reassure user: test_os BytesWarning is OK

2010-11-04 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : A test giving a strange warning can make a poor user nervous. Here's a minimal patch to calm his nerves. It would be better to only give the message if python -b (not -bb) is active, but I do not know how. diff -prU2 Lib/test/test_os.py Lib

[issue10311] Signal handlers must preserve errno

2010-11-04 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Amaury Forgeot d'Arc writes: > This issue is not really relevant on Windows: > - signals are actually run in a new thread specially created. > - errno is a thread-local variable; its value is thus local to the > signal handler, same fo

[issue10312] intcatcher() can deadlock

2010-11-04 Thread Hallvard B Furuseth
Changes by Hallvard B Furuseth : -- versions: +Python 2.7, Python 3.1 ___ Python tracker <http://bugs.python.org/issue10312> ___ ___ Python-bugs-list mailin

[issue10309] dlmalloc.c needs _GNU_SOURCE for mremap()

2010-11-04 Thread Hallvard B Furuseth
Changes by Hallvard B Furuseth : -- versions: +Python 3.1 ___ Python tracker <http://bugs.python.org/issue10309> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10308] Modules/getpath.c bugs

2010-11-04 Thread Hallvard B Furuseth
Changes by Hallvard B Furuseth : -- versions: +Python 2.7, Python 3.1 ___ Python tracker <http://bugs.python.org/issue10308> ___ ___ Python-bugs-list mailin

[issue10133] multiprocessing: conn_recv_string() broken error handling

2010-11-04 Thread Hallvard B Furuseth
Changes by Hallvard B Furuseth : -- versions: +Python 2.7, Python 3.1 ___ Python tracker <http://bugs.python.org/issue10133> ___ ___ Python-bugs-list mailin

[issue10231] SimpleHTTPRequestHandler directory bugs

2010-11-04 Thread Hallvard B Furuseth
Changes by Hallvard B Furuseth : -- versions: +Python 2.7, Python 3.1 ___ Python tracker <http://bugs.python.org/issue10231> ___ ___ Python-bugs-list mailin

[issue10311] Signal handlers must preserve errno

2010-11-04 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Parser/intrcheck.c:intcatcher() should do the same. Covered in Issue 10312. Antoine Pitrou writes: > This is a good idea IMO. It would be better if you minimized style > changes, so that the patch is easier to review. I'm afraid the un-rear

[issue10312] intcatcher() can deadlock

2010-11-04 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : Parser/intrcheck.c:intcatcher() can do FILE* operations, which can deadlock if the interrupt happens while a FILE* operation on the same FILE holds a mutex for the FILE. I've seen this happen elsewhere. It'd rather be a pity to remove Py_Ex

[issue10311] Signal handlers must preserve errno

2010-11-04 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : Signal handlers that can change errno, must restore it. I enclose a patch for <2.7, 3.2a3>/Modules/signalmodule.c which also rearranges the code to make this a bit easier. The patch does if (errno != save_errno) errno = save_errno; instead o

[issue10310] signed:1 bitfields rarely make sense

2010-11-04 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : In Python 2.7 and 3.2a3, Modules/_io/textio.c uses signed:1 bitfields. They have value -1 or 0 in two's complement, but are not used thus here: gcc complains of = 1 overflow. If the point was that they are assigned signed values, well, unsigned

[issue10309] dlmalloc.c needs _GNU_SOURCE for mremap()

2010-11-04 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : dlmalloc uses mremap() which is undeclared on Linux, needs _GNU_SOURCE. This can break at least on hosts where void* = 64 bits and int (default return type) 32 bits, since some bits in the return type are lost. A minimal patch is: --- Modules/_ctypes

[issue10308] Modules/getpath.c bugs

2010-11-04 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : Patches for getpath.c in Python 2.7 and 3.2a3: 2.7 chunk#2: copy_absolute() would use uninitialized data if getcwd() failed. The fix is equivalent to what 3.2a3 does. 3.2a3 chunk#2: search_for_exec_prefix() did 'unsigned value >= 0

[issue10086] test_sysconfig failure with site-packages

2010-11-02 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: ,AC�ric Araujo writes: > Attaching a patch with your two suggestions. > Added file: http://bugs.python.org/file19264/fix10086.diff Not quite, since I suggested global_path.startswith(os.path.join(base, "")) instead of global_path

[issue10231] SimpleHTTPRequestHandler directory bugs

2010-10-29 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : SimpleHTTPRequestHandler directory bugs Running 3.2a3 http/server.py or 2.7 SimpleHTTPServer.py as a script: * Redirection appends "/" to the unparsed URL instead of to the pathname component of the parsed URL: "foo/dir?baz" =>

[issue10133] conn_recv_string() broken error handling

2010-10-17 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : Neither conn_recv_string() nor its callers free *newbuffer on error. The promotion rules break negative 'res' for 64-bit Py_ssize_t in the (ulength <= buflength) branch: res = -1 ==> (UINT32)-1 ==> Py_ssize_t 0x instead of -1.

[issue10086] test_sysconfig failure with site-packages

2010-10-14 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: It's with 'purelib' because my prefix "/site" matches "/site-packages". This fixes it for me, but maybe you should also assert that global_path.startswith(os.path.join(base, "")). --- Lib/test/test_sysconfig.

[issue10086] test_sysconfig failure with site-packages

2010-10-13 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: "./configure --prefix=/site" on Ubuntu. Unedited site.py. I had Python3.2a2 installed, but removing it did not make the test do anything different. Nor did removing /home/sjef/.local/lib/python3.2, which only contained an empty sit

[issue10086] test_sysconfig failure with site-packages

2010-10-13 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : test_sysconfig on Python 3.2a3 fails with AssertionError: '/home/sjef/.local/lib/python3.2/site-packages' != '/home/sjef/.local/lib/python3.2/home/sjef/.local-packages' Python-3.2a3$ ./python Lib/test/regrtest.py -v test_syscon

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: [I got failed issue tracker submission, trying again...] >> How about this phrasing: “Make 2to3 fixers not touch code in a >> block starting with ’if sys.version >= '3'’“ >> (and hexversion, version_info, you get the idea

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Another syntax could be attached to if-else and try-except. Given: if ...: else: or try: except ...: if 2to3 would translate to or vise versa, sans whitespace/comment differences, then it does not

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: > Maybe we need to tackle this from a different angle: can you please > specify the feature you are asking for exactly, with any syntax, API, or > command line changes that you consider necessary? First, nothing here is necessary, since it

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Martin v. Löwis writes: > I still don't understand. If it's 2.x code, why do you want to say that > it is 3.x code? It works on Python 2. It runs on Python 3 - maybe correctly, or maybe it's not that far along yet. Maybe some files

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Martin v. Löwis writes: > Martin v. Löwis added the comment: > > I don't understand. If the code is already Python 3 code, why are you > running 2to3 on it? I should have clarified - it's still Python 2 code (maybe 2.7), mov

[issue10069] 2to3 crash in fix_urllib.py

2010-10-12 Thread Hallvard B Furuseth
Changes by Hallvard B Furuseth : -- type: -> crash ___ Python tracker <http://bugs.python.org/issue10069> ___ ___ Python-bugs-list mailing list Unsubscri

[issue10070] 2to3 wishes for already-2to3'ed files

2010-10-12 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : It would be nice with some official way to tell 2to3, "Leave this code chunk alone. This is 2.* code, that is 3.* code": try: # Python 2.6 from urlparse import urlparse, urlunparse except ImportError:

[issue10069] 2to3 crash in fix_urllib.py

2010-10-12 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth : This line: from urllib import quote as quote_url, urlencode makes 2to3 on Python 3.2a2 crash. At lib2to3/fixes/fix_urllib.py line 124, member = None. -- components: 2to3 (2.x to 3.0 conversion tool) messages: 118410 nosy: hfuru priority

[issue2921] enable embedding: declare/#define only py* symbols in #includes

2009-05-16 Thread Hallvard B Furuseth
Hallvard B Furuseth added the comment: Daniel Diniz writes: > Would this break existing code? Source code? Not if you use the PYTHON_NAMESPACE_ONLY trick. Old programs will receive all old definitions in addition to the new autoconf symbols, since they didn't #define PYTHON_NAMESP

[issue2921] enable embedding: declare/#define only py* symbols in #includes

2008-05-20 Thread Hallvard B Furuseth
Hallvard B Furuseth <[EMAIL PROTECTED]> added the comment: Duh, I should of course have said defined(PY_HAVE_ACOSH) and not defined(HAVE_ACOSH), that was the whole point:-) And the puts() should print "#define PY_HAVE_WHATEVER 1". Hopefully there are not too many #defines whi

[issue2921] enable embedding: declare/#define only py* symbols in #includes

2008-05-19 Thread Hallvard B Furuseth
New submission from Hallvard B Furuseth <[EMAIL PROTECTED]>: It can be cumbersome to embed Python in a program which also #includes a config.h from autoconf, because Python's and the program's autoconf macros may interfere with each other. Assuming it compiles at all, both could