Re: nospam ** infinity?

2017-11-27 Thread Skip Montanaro
> I'm 99.5% certain it's not gate_news. A funny thing. All messages I have looked at so far with the "nospam" thing have a Message-ID from binkp.net. (They are also all Usenet posts.) For example: Newsgroups: comp.lang.python Subject: Re: I have anaconda, but Pycharm can't find it Date: Sun, 26 N

Profiler which takes I/O into account?

2017-12-05 Thread Skip Montanaro
Is there a profiler for Python (2.7 in my case) which recognizes when a process (or all threads but the profiler's) is blocked on I/O? I'm using cProfile at the moment, which is fine as far as it goes, but the program I'm profiling does a fair amount of I/O, so that dominates the actual time the pr

Re: csv.DictReader line skipping should be considered a bug?

2017-12-05 Thread Skip Montanaro
> And I want to argue that the difference of behavior should be considered a > bug. Sorry, that ship has sailed. If you want different behavior, subclassing DictReader and providing your own next() implementation should be straightforward. All you need to do is copy the existing implementation of

Re: csv.DictReader line skipping should be considered a bug?

2017-12-08 Thread Skip Montanaro
> And I want to argue that the difference of behavior should be considered a bug. Sorry, that ship has sailed. If you want different behavior, subclassing DictReader and providing your own next() implementation should be straightforward. All you need to do is copy the existing implementation of ne

Automated distribution building tools to support SpamBayes

2017-12-15 Thread Skip Montanaro
SpamBayes (http://www.spambayes.org/) has languished for quite awhile, in part because nobody is around who can put together a Windows installer. Unfortunately, most users are on Windows and have to work around problems caused by the march of time and consequent beefing up of Windows security. I d

Re: Repeated Names (Repeated Names)

2017-12-17 Thread Skip Montanaro
>> I've emailed the administrator of bbs.geek.nz, maybe he >> will be able to stop it. > > Thanks, Greg. We're actually blocking via that and related headers at > the gateway, which is why the mailing list is no longer seeing the > duplicates. I'm not sure any of us thought to email the news server

Re: Automated distribution building tools to support SpamBayes

2017-12-17 Thread Skip Montanaro
Thanks. I've had a couple references to Appveyor, so will see if I can make heads or tails of it during my Christmas-to-New Year's break. Skip On Dec 15, 2017 5:43 PM, "Ned Batchelder" wrote: > On 12/15/17 2:03 PM, Skip Montanaro wrote: > >> SpamBayes (http://ww

Re: Repeated Names (Repeated Names)

2017-12-18 Thread Skip Montanaro
Apologies. I interpreted your use of the word "fake" to imply the domain didn't really exist. In that case, I would have not expected a website to be up, nor an email to succeed (even with delays). S On Mon, Dec 18, 2017 at 5:12 AM, Jon Ribbens wrote: > On 2017-12-17, Ski

Re: adding elif to for

2017-12-19 Thread Skip Montanaro
Apologies. Misread your question. Skip On Dec 19, 2017 6:16 PM, "Skip Montanaro" wrote: > > Has any thought been given to adding elif to the for statement? > > > Time machine at work I think: > > https://docs.python.org/3/reference/compound_stmts.html#the-if

Re: adding elif to for

2017-12-19 Thread Skip Montanaro
Has any thought been given to adding elif to the for statement? Time machine at work I think: https://docs.python.org/3/reference/compound_stmts.html#the-if-statement Skip -- https://mail.python.org/mailman/listinfo/python-list

PyWin32 installer question

2017-12-27 Thread Skip Montanaro
I'm fiddling around with Appveyor, trying to build a Windows installer for SpamBayes. This is complicated by two facts: 1. I don't know squat about Windows. 2. I don't have access to a Windows command line. Consequently, every new attempt requires a change to appveyor.yml and a git push command.

Re: Python goto

2017-12-28 Thread Skip Montanaro
Jorge> I would like to know if there is a goto command or something similar that Jorge> I can use in Python. Ned> Python does not have a goto statement. You have to use structured Ned> statements: for, while, try/except, yield, return, etc. Though it appears some wag has used function decorators

Re: PyWin32 installer question

2017-12-28 Thread Skip Montanaro
Thanks for the help, Paul. > When I took a quick look at the code, it seemed to be based on a > pretty old version of Python. What version are you using? Yes, last time a Windows installer was created, Python 2.5 was still in vogue. I switched things to 2.7 with (so far) no obvious problems. I e

Re: PyWin32 installer question

2017-12-29 Thread Skip Montanaro
> That's not an architecture-independent file. The Wheel spec gives all > the details, but "cp27" (as opposed to "py27") means it's CPython only > (which usually means it's got a C extension) and "win32" is 32-bit > only ("win_amd64" is the tag for 64-bit Windows). So the problem is > that the py2e

Re: PyWin32 installer question

2017-12-29 Thread Skip Montanaro
> Thanks. I'll shoot Thomas Heller an email... Actually, make that Christopher Toth. Seems he's the current maintainer. -- https://mail.python.org/mailman/listinfo/python-list

Re: Goto (Posting On Python-List Prohibited)

2017-12-29 Thread Skip Montanaro
Looking at 14 million lines of Linux kernel sources, which are in C, over 100,000 of them use 'goto'. About one every 120 lines. Isn't C's goto statement restricted to the current function? I imagine setjmp and longjmp calls might be more insidious. Skip -- https://mail.python.org/mailman/listi

7z archive reader akin to zipfile?

2018-01-03 Thread Skip Montanaro
The zipfile module is kind of cool because you can access elements of the archive without explicitly uncompressing the entire archive and writing the structure to disk. I've got some 7z archives I'd like to treat the same way (read specific elements without first extractingg the entire tree to disk

Re: 7z archive reader akin to zipfile?

2018-01-03 Thread Skip Montanaro
If you're doing this a lot, it might be worth repackaging your 7z files as > zip files. Good point. FWIW, these are the files: http://untroubled.org/spam Pretty static once a month or year is closed out... Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: 7z archive reader akin to zipfile?

2018-01-06 Thread Skip Montanaro
> Have you looked at libarchive (https://pypi.python.org/pypi/libarchive)? Thanks, was completely unaware of its existence. I will take a look. I've been repackaging the 7z archives as zips, but the result is 3-5x larger. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-11 Thread Skip Montanaro
> So besides just grabbing a chunk of CPython source code and digesting it, I > was wondering if those of you have read and understood the source code, do > you have any tips or good starting points? Not mentioned yet, but maybe worth considering, might be to dip into the way back machine and star

Re: Why does pylint give this warning?

2018-01-14 Thread Skip Montanaro
> I cannot replicate this with > > $ pylint --version > Using config file /home/petto/.pylintrc > pylint 1.8.1, > astroid 1.6.0 > Python 3.4.0 (default, Apr 11 2014, 13:05:11) > [GCC 4.8.2] > > $ cat pylint_fodder.py > class FooBar: > def __len__(self): > return 42 > def __repr__(se

Re: pip --user by default

2018-01-15 Thread Skip Montanaro
>> Inside of a virtualenv, what's the difference between a --user install >> and a system one? >> > > It errors out: > > % pip install --user urllib3 > Can not perform a '--user' install. User site-packages are not visible > in this virtualenv. I was able to 'pip install --user ...' a package yest

Re: pip --user by default

2018-01-15 Thread Skip Montanaro
> I just tried that and it turns out that that installs the package into > the main anaconda/miniconda installation rather than the conda env. > Definitely not what you want. Yes, installing in the root environment (as it's called) is generally a bad idea. I use Conda at work, in a shared sort of

Right way to io.open(...) an existing file object in Python 2.7?

2018-01-16 Thread Skip Montanaro
I'd like to take advantage of the seekable() method of io.IOBase with existing open file objects, especially the standard in/out/err file objects. I know on Linux I can just do this: fp = io.open("/dev/stderr") but that's kind of cheating. File objects in Python 2.7 aren't created using the i

Re: Right way to io.open(...) an existing file object in Python 2.7?

2018-01-16 Thread Skip Montanaro
> If it's difficult to imagine a circumstance in which you would want to > seek on stdio/out/err where you were not making some considerable error. > But they are already io objects so you can just call sys.stdin.seekable > or whatever. Alas, in Python 2.7 sys.stdin/stdout/stderr are traditional (

Re: Right way to io.open(...) an existing file object in Python 2.7?

2018-01-16 Thread Skip Montanaro
>> I don't see any sort of "fdopen" or "freopen" equivalent mentioned in the io >> module documentation. Is this possible in a clean way? >> > > There is an os.fdopen(), so maybe > > newf = os.fdopen(fp.fileno()) Correct, but that just returns another File object which will still lack the API pr

Re: Right way to io.open(...) an existing file object in Python 2.7?

2018-01-16 Thread Skip Montanaro
io.open can open a file descriptor. Ah, thanks. I'd missed that in my initial reading of the io.open documentation. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Where are the moderators?

2018-01-18 Thread Skip Montanaro
> What happened to the moderators? I have always liked this forum, but there's > so much spam now. Is there a way to become a moderator so this can be cleaned > up? Just to emphasize what Paul said, the only moderators I'm aware of are those who moderate python-list@python.org. A bidirectional g

Re: Where are the moderators?

2018-01-18 Thread Skip Montanaro
>> Simply point your email client at news.gmane.org and take your pick from >> hundreds of Python lists and thousands of other technical lists that are >> all spam free. >> >> > Actually, this link is broken. But, gmane.org (without the news prefix) > does work. Neither works for me. The news link

Re: Sending Email using examples From Tutorials

2018-01-28 Thread Skip Montanaro
Your code is fine, ... In addition to what Jason wrote, note that the way you need to authenticate to most email servers has changed substantially since this tutorial example was written. The OP has a yahoo.com email address. Even assuming you used something like smtp.yahoo.com as the SMTP server

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Skip Montanaro
I've noticed it as well. I suspect it's from the Windows universe where it's common to snip a bit of the screen which isn't pure text when asking about some problematic GUI thing which is causing problems. I've never been a Windows user, but at my current job, Windows is core to just about everyth

Receive a signal when waking or suspending?

2022-04-23 Thread Skip Montanaro
It's not clear there is a straightforward way to catch a signal or get an event notification when my computer (Dell running XUbuntu 20.04) is about to sleep or when it's just awakened. The app uses tkinter. Is there some more-or-less easy way to do this? Mac support would be nice (I have my eye on

Re: Receive a signal when waking or suspending?

2022-04-23 Thread Skip Montanaro
> I don't know in Python, but maybe you can create a script that writes > on a named pipe and read it from Python? > https://askubuntu.com/questions/226278/run-script-on-wakeup Thanks, that gives me something to munch on. -- https://mail.python.org/mailman/listinfo/python-list

Re: Receive a signal when waking or suspending?

2022-04-25 Thread Skip Montanaro
> https://duckduckgo.com/?t=ffab&q=python+up+time pointed-out the > "uptime — Cross-platform uptime library" > - TLDR; I'm not sure if "uptime" and "boot" relate only to a > 'cold-start' or if they include bringing the machine out of 'stand-by' > or 'hibernation' Yeah, that won't help. uptime(1) g

Do projects exist to audit PyPI-hosted packages?

2022-05-06 Thread Skip Montanaro
I woke with a start in what amounted to the middle of the night (I really need to get about three more hours of sleep, but you'll understand why I was awake to write this). Many years ago, so as to preserve my wrists, I wrote a tool

Re: Do projects exist to audit PyPI-hosted packages?

2022-05-06 Thread Skip Montanaro
> > A related problem is that even if a package is maintained by somebody with > good intentions, the account might be hijacked by a malicious actor and > since PyPi is separate from source control, people might not be able to > find out easily and malware could spread through PyPi. > I hadn't con

Now for something completely different...

2022-05-22 Thread Skip Montanaro
This isn't really Python-related, but I don't wander around any more general software engineering/computer science places on the web, so I will throw this out here. I start a framebuilding class next week (lugged steel construction for those into bikes). After about three weeks of work, I should h

Re: Resolving Weekday Schedules to Dates

2022-07-21 Thread Skip Montanaro
> Do you know of a library that resolves schedules like every Wednesday > at 3:00pm to absolute time, that is return the datetime of the next > occurrence? Take a look at the `rrule` module in the `dateutil` package: https://dateutil.readthedocs.io/en/stable/rrule.html Skip -- https://mail.pyth

Re: Dictionary order?

2022-08-01 Thread Skip Montanaro
> > So I decided to write a little test program to run on a variety of > CPythons, to confirm what I was thinking. > > And instead I got a surprise. > > On 1.4 through 2.1 I got descending key order. I expected the keys to be > scattered, but they weren't. > > On 2.2 through 3.5 I got ascending ke

Python gets a mention on Reddit - in r/tifu

2022-08-07 Thread Skip Montanaro
Not exactly where I expected to see Python mentioned on Reddit, but I found this amusing (yes, despite the subreddit, it should be safe for work): https://www.reddit.com/r/tifu/comments/wibmkh/tifu_by_teaching_my_13yo_brother_python/ Just a little diversion for a Sunday afternoon. I was particula

Ref-strings in logging messages (was: Performance issue with CPython 3.10 + Cython)

2022-10-07 Thread Skip Montanaro
On Fri, Oct 7, 2022 at 9:42 AM Andreas Ames wrote: > 1. The culprit was me. As lazy as I am, I have used f-strings all over the > place in calls to `logging.logger.debug()` and friends, evaluating all > arguments regardless of whether the logger was enabled or not. > I thought there was some dis

Re: Ref-strings in logging messages (was: Performance issue with CPython 3.10 + Cython)

2022-10-07 Thread Skip Montanaro
Dang autocorrect. Subject first word was supposed to be "f-strings" not "ref-strings." Sorry about that. S On Fri, Oct 7, 2022, 10:45 AM Skip Montanaro wrote: > > > On Fri, Oct 7, 2022 at 9:42 AM Andreas Ames > wrote: > >> 1. The culprit was me. As laz

argparse — adding a --version flag in the face of positional args

2022-11-27 Thread Skip Montanaro
I have a script to which I'd like to add a --version flag. It should print the version number then exit, much in the same way --help prints the help text then exits. I haven't been able to figure that out. I always get a complaint about the required positional argument. I think I could use somethi

Re: argparse — adding a --version flag in the face of positional args

2022-11-27 Thread Skip Montanaro
> class VersionAction(argparse.Action): > def __call__(self, parser, namespace, values, option_string): > print(VERSION) > exit() ... > parser.add_argument("-v", "--version", nargs=0, action=VersionAction) Thanks. An action class didn't occur to me. I looked briefly at the code

Re: argparse — adding a --version flag in the face of positional args

2022-11-27 Thread Skip Montanaro
> > ummm, hate to say this, but have you checked the documentation? this > case is supported using an action named 'version' without doing very much. > Thanks, Mats. I actually searched all over the argparse docs. (There's a lot to digest. Honestly, if I wasn't attempting to be sort of up-to-dat

Re: argparse — adding a --version flag in the face of positional args

2022-11-28 Thread Skip Montanaro
Thanks. It occurs to me that instead of providing two special actions ("help" and "version"), it might be worthwhile to provide a standard way of saying, "if present, process this option and exit before considering other details of the command line." Matt's example action works well enough for my n

Re: Android APK

2023-01-25 Thread Skip Montanaro
> > Is there a good python library for converting python3 to android APK > I'm not an app type of person, so don't watch that space. I've heard of Kivy: https://kivy.org/ I also something called python-for-android on PyPI with a recent release: https://pypi.org/project/python-for-android/ I'd

Re: Upgrading Python on Ubuntu 22.04.1 LTS

2023-02-01 Thread Skip Montanaro
> > > I have a server with Ubuntu 22.04.1 LTS and the Python version there > is Python 3.10.6. Is there a safe way to upgrade to the latest version of > Python 3.10 (3.10.9)? I tried with the OS update and upgrade but the Python > version remained the same. > > I have an Ubuntu 22.04 system. The in

Is there a more efficient threading lock?

2023-02-25 Thread Skip Montanaro
I have a multi-threaded program which calls out to a non-thread-safe library (not mine) in a couple places. I guard against multiple threads executing code there using threading.Lock. The code is straightforward: from threading import Lock # Something in textblob and/or nltk doesn't play nice wit

Re: Is there a more efficient threading lock?

2023-02-25 Thread Skip Montanaro
Thanks for the responses. Peter wrote: > Which OS is this? MacOS Ventura 13.1, M1 MacBook Pro (eight cores). Thomas wrote: > I'm no expert on locks, but you don't usually want to keep a lock while > some long-running computation goes on. You want the computation to be > done by a separate thr

Re: Is there a more efficient threading lock?

2023-02-26 Thread Skip Montanaro
> And yet, it appears that *something* changed between Python 2 and Python 3 such that it *is* atomic: I haven't looked, but something to check in the source is opcode prediction. It's possible that after the BINARY_OP executes, opcode prediction jumps straight to the STORE_FAST opcode, avoiding t

Re: Python 3.10 Fizzbuzz

2023-02-26 Thread Skip Montanaro
> > is there any reason to prefer"over' ? > Not really. As an old C programmer for many years I used double quotes"around "strings" and single word around 'c'haracters, because that's what I was used to. (This was long before triple quoted strings appeared in the language.) Aside: G

Re: Python 3.10 Fizzbuzz

2023-02-26 Thread Skip Montanaro
Dang auto-correct... Should read ... double quotes around "strings" and single quotes around 'c'haracters ... On Sun, Feb 26, 2023, 6:28 PM Skip Montanaro wrote: > is there any reason to prefer"over' ? >> > > Not really. As an

Re: JOB | Lead Linux Sysadmin (Edinburgh/London)

2023-03-08 Thread Skip Montanaro
> Hello, I'm working with an employer that is looking to hire someone in > (Edinburgh or London) that can administer on-prem and vmware > platforms. > James, If you haven't already, please post to the Phone Jobs Board: https://www.python.org/jobs/ Skip > -- https://mail.python.org/mailman/lis

Re: JOB | Lead Linux Sysadmin (Edinburgh/London)

2023-03-08 Thread Skip Montanaro
There's a link at the bottom of each message to the list info pager. Follow the directions on that page to unsubscribe. Skip On Wed, Mar 8, 2023, 5:38 PM Thomas Gregg wrote: > Is there any way to be removed from this list? > Thank you, Tom > > On Wed, Mar 8, 2023 at 3:51 

Small lament...

2023-04-03 Thread Skip Montanaro
Just wanted to throw this out there... I lament the loss of waking up on April 1st to see a creative April Fool's Day joke on one or both of these lists, often from our FLUFL... Maybe such frivolity still happens, just not in the Python ecosystem? I know you can still import "this" or "antigravity"

Re: replacement for nntplib on Python3

2023-04-26 Thread Skip Montanaro
You could create a git repo with just nntplib and generate a package on PyPI, then use that when running a version of Python which lacks nntplib. Skip On Wed, Apr 26, 2023, 8:42 PM Retrograde wrote: > I used to use a script that relied on nntplib, which is currently still > available in Python3

Re: What to use instead of nntplib?

2023-05-15 Thread Skip Montanaro
> I got a nice warning today from the inews utility I use daily: > > DeprecationWarning: 'nntplib' is deprecated and slated for removal in > Python 3.13 > > What should I use in place of nntplib? I'd recommend creating a PyPI project with the existing 3.12 code, then using that from 3.13 onwa

Re: What to use instead of nntplib?

2023-05-22 Thread Skip Montanaro
> > My understanding is that nntplib isn't being erased from reality, > it's merely being removed from the set of modules that are provided > by default. > > I presume that once it's removed from the core, it will still be > possible to install it via pip or some other mechanism. > It won't magica

Re: why sqrt is not a built-in function?

2021-01-14 Thread Skip Montanaro
> I don't understand why sqrt is not a built-in function. > Why do we have to first import the function from the math module? > I use it ALL THE TIME! For one, it's specific to numeric types. You might use it all the time, but I (for example) almost never need to use it, or to import the math modu

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Skip Montanaro
CW> How do you troubleshooting/debugging in Python? GE> Mostly I read exception trace and read the code and think about it. GE> If that doesn't work, I add some print() or syslog() calls. CW> I know hardcore computer scientists would tell me about Python debugger. GE> I've been writing Python fo

Re: IDE tools to debug in Python?

2021-01-28 Thread Skip Montanaro
> > > Python is an interactive language. You can develop a lot while working > > on a Python console. Then copy and paste into a program. > > Absolutely, the humble interactive prompt is often overlooked > as a development tool. It's not as good as the "evaluate > expression" tool in the Smalltalk

Best practice for handling exceptions raised at lower levels?

2021-02-01 Thread Skip Montanaro
I'm curious if there are best practices for handling exceptions raised by lower level modules and packages. For example, I wrote an application called polly[1] which constructs a personalized dictionary from email messages using IMAP4. That dictionary is then used as input to a password generator b

Log exception so traceback contains timestamp and level?

2021-02-06 Thread Skip Montanaro
The logging package can log exceptions and call stacks, but it does (in my opinion) a suboptimal job of it. Consider this simple example: >>> import logging >>> FORMAT = '%(asctime)-15s %(levelname)s %(message)s' >>> logging.basicConfig(format=FORMAT, force=True) >>> log.warning("msg", stack_info=

UTF-16 or something else?

2021-02-09 Thread Skip Montanaro
I downloaded US hospital ICU capacity data this morning from this page: https://healthdata.gov/dataset/covid-19-reported-patient-impact-and-hospital-capacity-facility (The download link is about halfway down the page.) Trying to read it using my personal CSV tools without specifying an encoding,

Re: UTF-16 or something else?

2021-02-09 Thread Skip Montanaro
> > Try setting encoding to: "utf-8-sig". > > 'eb bb bf' is the byte order mark for UTF8 (most systems do not include > this in UTF-8 encoded files) > > Python will correctly read UTF8 BOMs if you use the 'utf-8-sig' encoding > when reading files > Excellent, thanks. That worked like a charm. Know

Re: UTF-16 or something else?

2021-02-09 Thread Skip Montanaro
> > It's UTF-8 with a UTF-16 BOM prepended, which is not uncommon when you > have a file that's been converted to UTF-8 from UTF-16 or has been > produced by shitty Microsoft software. You can tell instantly at a > glance that it's not UTF-16 because the ascii dump would l.o.o.k. > .l.i.k.e. .t.h.i

Python 0.9.1

2021-02-16 Thread Skip Montanaro
A note to webmas...@python.org from an astute user named Hiromi in Japan* referred us to Guido's shell archives for the 0.9.1 release from 1991. As that wasn't listed in the historical releases README file: https://legacy.python.org/download/releases/src/README I pulled the shar files (and a patc

Re: [Python-Dev] Re: Python 0.9.1

2021-02-16 Thread Skip Montanaro
> > Wow. Was white-space not significant in this release of Python? I see the >> lack of indentation in the first Python programs. >> > > Indentation most certainly was significant from day 0. I suspect what > happened is that these files got busted somehow by the extraction process > used by Skip

Re: [Python-Dev] Re: Python 0.9.1

2021-02-16 Thread Skip Montanaro
> If someone knows how to get the original Usenet messages from what Google > published, let me know. Seems the original shar is there buried in a Javascript string toward the end of the file. I think I've got a handle on it, though it will take a Python script to massage back into correct format

Re: [Python-Dev] Re: Python 0.9.1

2021-02-16 Thread Skip Montanaro
> Also mind > http://www.dalkescientific.com/writings/diary/archive/2009/03/27/python_0_9_1p1.html > for result comparison. Thanks, Paul. I had lost track of Andrew. Good to know he's still out there. I wonder why his tar file was never sucked up into the historical releases page. Whew! My stupid

Re: .title() - annoying mistake

2021-03-19 Thread Skip Montanaro
> > That's annoying. You have to roll your own solution! > Certainly seems like a known issue: https://bugs.python.org/issue12737 That issue was opened in 2011. Skip -- https://mail.python.org/mailman/listinfo/python-list

Looking for people interested in a Python register virtual machine project

2021-03-20 Thread Skip Montanaro
hon's internals. Questions/comments/pull requests welcome. Skip Montanaro -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-20 Thread Skip Montanaro
also intended to be the same thing, and for a while > had a fair number of contributors. Unfortunately, it never obtained the > performance wins that were good for. > > On Sat, Mar 20, 2021, 11:55 AM Skip Montanaro > wrote: > >> Back in the late 90s (!) I worked on a reimagi

Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Skip Montanaro
> In the "Object Lifetime" section you say "registers should be cleared upon > last reference". That isn't safe, since there can be hidden dependencies on > side effects of __del__, e.g.: > > process_objects = create_pipeline() > output_process = process_objects[-1] > return output_pr

Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Skip Montanaro
> Yeah, that is old writing, so is probably less clear (no pun intended) > than it should be. In frame_dealloc, Py_CLEAR is called for > stack/register slots instead of just Py_XDECREF. Might not be > necessary. Also, the intent is not to change any semantics here. The implementation of RETURN_VAL

Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Skip Montanaro
Thanks for the response. I will try to address your comments inline. > I guess it should be a good idea to answer what's the scope of this > project - is it research one or "production" one? If it's research one, > why be concerned with the churn of over-modern CPython versions? > Wouldn't it be b

Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-23 Thread Skip Montanaro
> a) You're working with CPython bleeding edge. > b) You find that (bleeding edge) adding extra chore. > c) Nobody told you to work on bleeding (nor boss, nor a maintainer who > said "I'll merge it once you've done"), > > Then: why do you complicate your task by working on bleeding edge? > Could ta

Re: Code Formatter Questions

2021-03-28 Thread Skip Montanaro
> 1) Are there any major other formatters that I can/should look at? I see some > "online" pretty printers, but I'm after something I can run on whole > recursive directories of code. I use Emacs, so I'm kind of biased, but I find its python-mode does a good job, good enough that I wouldn't use

Re: About \033[m

2021-04-04 Thread Skip Montanaro
>Porque quando se usa formatac,ao de cores, o python nao consegue > centralizar dentro da cadeia de 40 caracteres ? > >Tive que colocar 54 no parametro pois de alguma forma esta sendo >considerado os caracteres de dentro do comando \033[m Python doesn't know there is anything speci

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Skip Montanaro
> Are you unaware that the group is already gatewayed to a moderated > mailing list for which all of that work is already done? What is this moderation of which you speak? I'm one of the Python postmasters (I maintain the SpamBayes setup) and am aware of a multi-part tool chain (black hole lists,

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Skip Montanaro
> Are you saying that the messages that appear occasionally from people > such as Ethan Furman claiming to be moderators and alleging that > particular people have been banned or suspended are lies? And that the > message I received once saying that my comp.lang.python post had been > rejected from

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Skip Montanaro
> > Not that I support shutting down the Usenet/email gateway -- the > > signal/noise ration seems fine to me. > > > On that I quite agree. :-) I remind people that the existing Usenet<->Mail gateway keeps the mailing list software on mail.python.org from migrating to Mailman 3. I'm sure Mark Sap

Re: Bloody rubbish

2021-05-06 Thread Skip Montanaro
> > Machine language is so much simpler, and you can code with just a hexpad. > Pshaa... All you need are front panel switches. ;-) (Yes, I had a professor who required is to 'key' in our programs on the front panel, of a rack mounted PDP-11 as I recall. Needless to say, we didn't use an assembler

Re: imaplib: is this really so unwieldy?

2021-05-25 Thread Skip Montanaro
> It's working (with Cyrus), but I have the feeling I'm doing it all wrong > because it seems so unwieldy. I have a program, Polly , which I wrote to generate XKCD 936 passphrases. (I got the idea - and the name - from Chris Angelico. See the README.) It builds

Track 3.9 instead of 3.10?

2021-07-27 Thread Skip Montanaro
I have a development branch in my fork of python/cpython, the register2 branch of https://github.com/smontanaro/cpython. As I am dealing with virtual machine internals I've found the changes to the virtual machine between 3.9 and 3.10 too disruptive. I'd like to track 3.9 instead. How would I go ab

Package conflicts trying to install jpegdupes package

2021-09-27 Thread Skip Montanaro
I'd like to use the jpegdupes package but can't seem to get past compilation issued related to jpegtrans-cffi. Attempts to install any available versions on my XUbuntu system crap out with this C compiler error message: In file included from jpegtran/__py

Re: Package conflicts trying to install jpegdupes package

2021-09-27 Thread Skip Montanaro
> > Those are all warnings. Are there any errors that follow them? > Maybe I just missed the actual errors, but the compiler exit status was 1, so there must have been. I'll give it another try. The package doesn't seem to have had a release since 2018, but the > GitHub repository has had change

Re: Package conflicts trying to install jpegdupes package

2021-09-27 Thread Skip Montanaro
> > For the most part, a proper colorizing compiler can make the > errors stand out among the spam of warnings, but it's hard when people > copy and paste just the text. > In my defense, the entire traceback was red. :-) It's quite possible that GCC colorized its error/warning messages, but colori

Re: Package conflicts trying to install jpegdupes package

2021-09-27 Thread Skip Montanaro
Woo hoo! It's installed. The ultimate error was a missing turbojpeg.h file. Thank goodness for the apt-file command. I was able to track that down to the libturbojpeg0-dev package, install that, and after a bit more fussing around now have jpegdupes installed. Thanks for the help, Skip -- https:

Proliferation of Python packaging formats

2021-11-17 Thread Skip Montanaro
Is the proliferation of packaging formats in Python as nutzo as this author believes? https://drewdevault.com/2021/11/16/Python-stop-screwing-distros-over.html Asking because I've never been in the business of releasing "retail" Python applications or packages. Skip -- https://mail.python.org/m

Re: Sad news: Fredrik Lundh ("Effbot") has passed away

2021-12-12 Thread Skip Montanaro
Like many others, I'm saddened to hear of Fredrik Lundh's passing. I vaguely recall meeting him just once, probably at a Python workshop, before they grew big enough to be called conferences. Effbot.org was my Tkinter, ElemenTree, and PIL reference and cheat sheet. My attention to Python developme

email.message_from_file & quoted printable

2021-12-23 Thread Skip Montanaro
I have a bunch of old email archives I'm messing around with, for example, rendering them on-demand in HTML. Some of the files use quoted printable content transfer encoding. Here's one (with a number of headers elided): >From classicrendezvous-admin Mon Dec 4 15:29:22 2000 Message-ID: <027801bf

Re: email.message_from_file & quoted printable

2021-12-23 Thread Skip Montanaro
> > From the docs: > > get_payload(i=None, decode=False) ... Try decode=True. :dopeslap: Thanks. Never been all that consistent reading documentation. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: email.message_from_file & quoted printable

2021-12-24 Thread Skip Montanaro
Cameron> Try decode=True. Skip> :dopeslap: Thanks. Never been all that consistent reading documentation. The more I think about it, the more I think maybe my lack of documentation reading wasn't all that unreasonable. The content transfer encoding and charset are properties of the message as a wh

Re: email.message_from_file & quoted printable

2021-12-25 Thread Skip Montanaro
> That sometimes you want the raw content as it was in the file? That if > you have that choice (decoded or raw) the default should be False, as it > does less? Yeah, thinking back later, the round-trip possibility seemed plausible. I'll stop overthinking this now... > That we my _first_ instinct

Gunicorn - HTTP and HTTPS in the same instance?

2022-01-07 Thread Skip Montanaro
Hopefully some Pythonistas are also Gunicornistas. I've had little success finding help with a small dilemma in the docs or in other more specific sources. I'm testing out a new, small website. It is just Gunicorn+Flask. I'd like to both listen for HTTP and HTTPS connections. Accordingly, in my co

Re: Gunicorn - HTTP and HTTPS in the same instance?

2022-01-08 Thread Skip Montanaro
Thanks all. I was hoping to get away without something more sophisticated like NGINX. This is just a piddly little archive of an old mailing list running on a single-core Ubuntu VM somewhere on the East Coast. Speed is not a real requirement. Load balancing seemed like overkill to me. Still, I gues

asyncio+tkinter

2022-03-21 Thread Skip Montanaro
a few solutions out in the wild, but this seems like something which might best be addressed in either the asyncio or tkinter documentation, or better yet, implemented in one or the other. Skip Montanaro -- https://mail.python.org/mailman/listinfo/python-list

Re: How to detect an undefined method?

2022-03-27 Thread Skip Montanaro
> Let's say I have a Python app and have used an undefined method somewhere. > Let > us further assume I have not detected it thru my tests. > > Is there a way to detect it before deploying the app? pylint doesn't > notice it. > This is maybe not exactly what you're looking for, but writing a test

<    1   2   3   4   5   6   7   8   9   10   >