[issue42471] Slowdown in socket tests noticed since Py3.8

2020-11-26 Thread Bert JW Regeer
Bert JW Regeer added the comment: Ned: You are correct, I hadn't even considered that as a potential issue. Added a context to grab the fork multiprocessing context and we are back to the speed it was before. This slowdown is pretty huge for just changing the way the process is forked

[issue42471] Slowdown in socket tests noticed since Py3.8

2020-11-26 Thread Bert JW Regeer
New submission from Bert JW Regeer : I am being fairly vague here, but it is mainly because I don't know the best way to reduce the test cases down to pinpoint the problem. I maintain Waitress, a pure Python HTTP server, and ever since Python 3.8 there's been a marked slowdown

[issue30717] Add unicode grapheme cluster break algorithm

2019-02-19 Thread Bert JW Regeer
Change by Bert JW Regeer : -- nosy: +Bert JW Regeer ___ Python tracker <https://bugs.python.org/issue30717> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2018-06-26 Thread Bert JW Regeer
Bert JW Regeer added the comment: I'll take a look and see if I can get the other fixes from WebOb and add them to a patch, and create a follow-up PR. If I can stop carrying a monkey patch for the standard library I am all for it! Thanks for running with this! -- nosy: +Bert JW

[issue4963] mimetypes.guess_extension result changes after mimetypes.init()

2018-01-25 Thread Bert JW Regeer
Change by Bert JW Regeer <ber...@regeer.org>: -- nosy: +X-Istence ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue4963> ___ __

[issue32097] doctest does not consider \r\n a

2017-11-20 Thread Bert JW Regeer
New submission from Bert JW Regeer <ber...@regeer.org>: doctest fails to consider `\r\n` as a blank line. -- components: Library (Lib) files: test.py messages: 306595 nosy: X-Istence priority: normal severity: normal status: open title: doctest does not consider \r\n a versions:

[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2016-11-26 Thread Bert JW Regeer
Bert JW Regeer added the comment: Unfortunately I need to spin another patch, the one I created didn't solve the issue for one of WebOb's users: https://github.com/Pylons/webob/pull/300 (Thanks Julien Meyer!) I have his permission to grab his test/patch and update this patch, I will get

[issue24764] cgi.FieldStorage can't parse multipart part headers with Content-Length and no filename in Content-Disposition

2016-11-17 Thread Bert JW Regeer
Bert JW Regeer added the comment: I've uploaded a patchset to bug #2 that fixes this issue by fixing make_file, and doesn't cause Python to throw out the content-length information. It also fixes FieldStorage for when you provide it a non-multipart form submission and there is no list

[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2016-11-17 Thread Bert JW Regeer
Bert JW Regeer added the comment: @berker.peksag: Attached is a patch with a test case that exercises this issue. Code path is that read_single() checks if the length is greater than 0, and then it reads binary, otherwise it reads it as a single line. This fixes make_file so

[issue28719] zipfile increase in size

2016-11-16 Thread Bert JW Regeer
Bert JW Regeer added the comment: Here's a dump from Python 3.6: b'PK\x03\x04\x14\x00\x08\x00\x00\x00\xc0~pI\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00zinfo_or_arcnamefoo!es\x8c\x03\x00\x00\x00\x03\x00\x00\x00PK\x01\x02\x14\x03\x14\x00\x08\x00\x00\x00\xc0~pI!es\x8c\x03\x00

[issue28719] zipfile increase in size

2016-11-16 Thread Bert JW Regeer
Bert JW Regeer added the comment: It's literally the string written: writer.writestr('zinfo_or_arcname', b'foo') rbo in this case is a simple file like object. I can get dumps from Python 3.5 and Python 3.6 if necessary. -- ___ Python tracker <

[issue28719] zipfile increase in size

2016-11-16 Thread Bert JW Regeer
New submission from Bert JW Regeer: I am the current maintainer of WebOb, and noticed that on Python 3.6 and 3.7 I noticed that a test started failing. Granted, the test is checking the size of the file created and it is not the brightest idea in a test, but it's been stable since Python 2.5

[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2016-09-26 Thread Bert JW Regeer
Bert JW Regeer added the comment: Updated versions this applies to. -- versions: +Python 3.3, Python 3.4, Python 3.6, Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2016-09-26 Thread Bert JW Regeer
Changes by Bert JW Regeer <ber...@regeer.org>: -- nosy: +berker.peksag ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue2> ___ _

[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2016-09-26 Thread Bert JW Regeer
Bert JW Regeer added the comment: On line #890 in self.make_file() the check for _binary_file should be changed to also check for self.length >= 0. https://github.com/python/cpython/blob/3.4/Lib/cgi.py#L890 becomes: if self._binary_file or self.length >= 0: _binary_file is only ev

[issue27308] Inconsistency in cgi.FieldStorage() causes unicode/byte TypeError.

2016-09-26 Thread Bert JW Regeer
Bert JW Regeer added the comment: This is not a duplicate of https://bugs.python.org/issue24764 -- nosy: +X-Istence ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue21878] wsgi.simple_server's wsgi.input read/readline waits forever in certain circumstances

2016-09-22 Thread Bert JW Regeer
Bert JW Regeer added the comment: This is still very much an issue, and makes it more difficult to write generic python request/response libraries because we can't assume that a read() will return, and relying on the Content-Length being set is not always possible unfortunately

[issue26945] difflib.HtmlDiff().make_file() treat few change as whole line change

2016-08-08 Thread JW
JW added the comment: please find attached the reproducer C.7z this issue only happens with this format of data before and after the difference -- Added file: http://bugs.python.org/file44046/C.7z ___ Python tracker <rep...@bugs.python.org>

[issue26945] difflib.HtmlDiff().make_file() treat few change as whole line change

2016-08-05 Thread JW
JW added the comment: i found that making a change similar to this one in a certain place towards then end of my 300 or so long list of strings produces issues further along: making a change of Latitude=1.1 -> Latitude=111.1 correctly shows as 11 added; however subsequent matching li

[issue25379] Changes in traceback broke existing code (Python 3.5)

2015-10-11 Thread Bert JW Regeer
New submission from Bert JW Regeer: One of the changes in Python 3.5's traceback functionality broke existing code compared to Python 3.4 by injecting an extra stack frame into the list when using traceback.extract_stack: What this looks like on Python 3.5: pyramid/tests/test_config

[issue25379] Changes in traceback broke existing code (Python 3.5)

2015-10-11 Thread Bert JW Regeer
Bert JW Regeer added the comment: Looks like this is a dup of: https://bugs.python.org/issue25108 -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

conditional running of code portion

2012-08-04 Thread JW Huang
Hi, How can I implement something like C++'s conditional compile. if VERBOSE_MODE: print debug information else: do nothing But I don't want this condition to be checked during runtime as it will slow down the code. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2012-01-30 Thread Bert JW Regeer
Bert JW Regeer ber...@regeer.org added the comment: In my first comment on this bug post I posted what project has issues with this, Botan with Boost.Python on FreeBSD and Mac OS X. If required I will post how to reproduce this error using that project. If you would prefer a simplified test

[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-01-14 Thread Bert JW Regeer
New submission from Bert JW Regeer ber...@regeer.org: I was recently attempting to get Botan (http://botan.randombit.net) working with Python 2.6.6 on FreeBSD when it failed to compile, I filled a bug with Botan (http://bugs.randombit.net/show_bug.cgi?id=135) and first thought

Re: building extensions for Windows Python

2006-10-17 Thread JW
Thanks to Michael and Nick, I can now cross-compile my Pyrex extensions for bog-standard Python 2.5. As I stumbled around in the dark trying to bump into a solution, I was bolstered by the belief that at least two other people had found the light at the end of the tunnel. I had been using a

building extensions for Windows Python

2006-10-13 Thread JW
I have a lousy little Python extension, generated with the generous help of Pyrex. In Linux, things are simple. I compile the extension, link it against some C stuff, and *poof*! everything works. My employer wants me to create a Windows version of my extension that works with the vanilla

Re: 2Qs

2006-06-26 Thread JW
2nd question: [snip] if x10 and y10 and z10 and summ(tritup(x,y,z)): print OK Others have already suggested you use the built-in sum() function. I'll suggest you don't need it at all, because it is redundant. If the sum is zero, either all three values are zero or at least one of the

Re: MS VC++ Toolkit 2003, where?

2006-04-24 Thread JW
On Sun, 23 Apr 2006 21:15:23 -0700, Alex Martelli wrote: As suggested to me by David Rushby 10 hours ago, ... huge URL snipped ... Alas, somehow this URL was split in two, and all the kings horses and all the kings men can't seem to put it back together again (at least in my browser).

Re: just one more question about the python challenge

2006-04-13 Thread JW
You said: Sorry to post here about this again, but the hint forums are dead, and the hints that are already there are absolutely no help (mostly it's just people saying they are stuck, then responding to themselves saying the figured it out! not to mention that most of the hints require

Re: Multiplying all the values in a dictionary

2006-03-24 Thread JW
As long as you are optimizing, addition is slightly faster than multiplication: $ python2.4 -mtimeit 'h=1;h*=2' 100 loops, best of 3: 0.286 usec per loop $ python2.4 -mtimeit 'h=1;h=h+h' 100 loops, best of 3: 0.23 usec per loop Of course, that's only a 20% decrease, so it might not be

Re: Please, I Have A Question before I get started

2006-03-13 Thread JW
Skipper wrote: I can not believe that there isn't a GUI programing tool that will allow me to build GUI apps - just like I use Dreamweaver to build a web page ... a WYSIWYG builder that does a few simplet things and calls other programs ... Oh well no silver bullet! If you are

Re: doctest-alike for a unix shell?

2006-03-13 Thread JW
1. Try os.popen: import os os.popen('echo Hello World').read() 'Hello World\n' 2. Try a test environment built for testing shell commands, such as DejaGnu: http://www.gnu.org/software/dejagnu/ -- http://mail.python.org/mailman/listinfo/python-list

Re: looking for help about python-sane

2006-03-02 Thread JW
modify the Python code to do the same thing. Hope this is some help, JW -- http://mail.python.org/mailman/listinfo/python-list

Re: looking for help about python-sane

2006-03-01 Thread JW
Every time, or just this run? -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 354: Enumerations in Python

2006-02-28 Thread JW
It seems the concensus is that empty enums should be allowed for consistancy, and to support the loop that doesn't. I thought I'd find some data points in other languages as a guide: * C - builtin, empty enumerations not allowed * C++ - builtin, empty enumerations allowed. C++ doesn't have

Re: general coding issues - coding style...

2006-02-20 Thread JW
in Windows, which unfortunately uses the backslash as a directory seperator. You might also want to look at os.sep and the os.path.* functions, if you are interested in making your code work on different platforms. JW -- http://mail.python.org/mailman/listinfo/python-list

Re: Rethinking the Python tutorial

2006-02-14 Thread JW
Here's my two cents - I started with the official tutorial. It seemed up to date to me. Things that changed from 2.4 to 2.5 changed in the tutorial as well. I still refer to it every few days, because it had been a useful reference for the basic data types. I like that it seemlessly links into

Re: random playing soundfiles according to rating.

2006-02-09 Thread JW
I think of it this way: you randomly pick a entry out of a dictionary, then roll a 100-side die to see if the pick is good enough. Repeat until you find one, or give up. import random def rand_weighted_pick(weighted_picks): for i in range(100): name, prob =

Re: New Python.org website ?

2006-01-18 Thread JW
On Wed, 18 Jan 2006 00:33:06 -0800, Tim N. van der Leeuw wrote: What I especially dislike about the new website are the flashy pictures on the front-page with no content and no purpose -- purely boasting but nothing to back up your claims. (I wouldn't mind some sleek pictures there if they

Re: New Python.org website ?

2006-01-18 Thread JW
On Wed, 18 Jan 2006 20:51:03 +, Roel Schroeven wrote: I, Jim Wilson, schreef: I'm assured that in print ads the only content anyone reads is in picture captions, and you damn well better make sure your message is conveyed there. Any other content only wastes space. I see no reason to

Re: New Python.org website ?

2006-01-15 Thread JW
On Sun, 15 Jan 2006 22:19:37 +, Tim Parkin wrote: http://pyyaml.org/downloads/masterhtml/ Feedback appreciated ... Many thanks Again, with FF 1.0.7 (on FC4 Linux BTW), the left column no longer violates the right. However, ViewPage Stylelarge text makes the button annotation smaller

Re: New Python.org website ?

2006-01-13 Thread JW
On Fri, 13 Jan 2006 11:00:05 -0600, Tim Chase wrote: http://tim.thechases.com/pythonbeta/pythonbeta.html Very strange. With FF 1.0.7, I can just get the buttons to violate the next column if I ViewPage StyleLarge Text, but I wouldn't have noticed it unless Tim had pointed it out. Tim's gifs