Re: mailbox misbehavior with non-ASCII

2022-07-30 Thread Barry
 > On 30 Jul 2022, at 00:30, Peter Pearson wrote: > > The following code produces a nonsense result with the input > described below: > > import mailbox > box = mailbox.Maildir("/home/peter/Temp/temp",create=False) > x = box.values()[0] > h = x.get("X-DSPAM-Factors") > print(type(h)) > # >

Re: How to generate a .pyi file for a C Extension using stubgen

2022-07-30 Thread Marco Sulla
On Fri, 29 Jul 2022 at 23:23, Barry wrote: > > > > > On 29 Jul 2022, at 19:33, Marco Sulla wrote: > > > > I tried to follow the instructions here: > > > > https://mypy.readthedocs.io/en/stable/stubgen.html > > > > but the instructions about creating a stub for a C Extension are a little > > myst

Re: Simple TCP proxy

2022-07-30 Thread Roel Schroeven
Morten W. Petersen schreef op 29/07/2022 om 22:59: OK, sounds like sunshine is getting the best of you. It has to be said: that is uncalled for. Chris gave you good advice, with the best of intentions. Sometimes we don't like good advice if it says something we don't like, but that's no reaso

Re: Simple TCP proxy

2022-07-30 Thread Barry Scott
Morten, As Chris remarked you need to learn a number of networking, python, system performance and other skills to turn your project into production code. Using threads does not scale very well. Its uses a lot of memory and raises CPU used just to do the context switches. Also the GIL means tha

Re: PEP about recommended project folder layout

2022-07-30 Thread c.buhtz
Isn't there a PEP? On 2022-07-26 07:14 c.bu...@posteo.jp wrote: > Hello, > > I am not sure if I looked into the correct sources. I was looking in > "PEP 609 – Python Packaging Authority (PyPA) Governance" [1] and the > "PyPA specifications" [2]. > > My question in short: Is there an official d

Re: How to generate a .pyi file for a C Extension using stubgen

2022-07-30 Thread Barry
> On 30 Jul 2022, at 10:30, Marco Sulla wrote: > > On Fri, 29 Jul 2022 at 23:23, Barry wrote: >> >> >> On 29 Jul 2022, at 19:33, Marco Sulla wrote: >>> >>> I tried to follow the instructions here: >>> >>> https://mypy.readthedocs.io/en/stable/stubgen.html >>> >>> but the instruct

Re: Simple TCP proxy

2022-07-30 Thread Morten W. Petersen
I thought it was a bit much. I just did a bit more testing, and saw that the throughput of wget through regular lighttpd was 1,3 GB/s, while through STP it was 122 MB/s, and using quite a bit of CPU. Then I increased the buffer size 8-fold for reading and writing in run.py, and the CPU usage went

Re: mailbox misbehavior with non-ASCII

2022-07-30 Thread Peter J. Holzer
On 2022-07-29 23:24:57 +, Peter Pearson wrote: > The following code produces a nonsense result with the input > described below: > > import mailbox > box = mailbox.Maildir("/home/peter/Temp/temp",create=False) > x = box.values()[0] > h = x.get("X-DSPAM-Factors") > print(type(h)) > # > > The

Re: Simple TCP proxy

2022-07-30 Thread Barry
 > On 30 Jul 2022, at 20:33, Morten W. Petersen wrote: > I thought it was a bit much. > > I just did a bit more testing, and saw that the throughput of wget through > regular lighttpd was 1,3 GB/s, while through STP it was 122 MB/s, and using > quite a bit of CPU. > > Then I increased the bu

Re: PEP about recommended project folder layout

2022-07-30 Thread Barry
> On 30 Jul 2022, at 13:52, c.bu...@posteo.jp wrote: > > Isn't there a PEP? PEP are for improving python. They are not for telling people how to use python. I would be surprised to fine a PEP that addressed this. Barry > >> On 2022-07-26 07:14 c.bu...@posteo.jp wrote: >> Hello, >> >> I am