RE: Popping key causes dict derived from object to revert to object (3/25/2024)

2024-03-27 Thread Dr. F. M. (Mike) Covington via Python-list
Hello, all.

 

I guess I'm just not seeing this dictionary pop() problem you're having.  

What version of Python are you using?  Is there something I'm missing?

If I've made an obvious oversight, please forgive me and explain.

 

Thanks!

 

PyCharm (2023.1.1) REPL running Python 3.12:

 



 

Mike

 



--
F. M. (Mike) Covington, PhD, PCPP, MCT

Automation Consultant, Developer, Instructor

 

 



 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-14 Thread Mike Dewhirst via Python-list
In Windows the provided methods for running complex command lines are either a 
batch file or a shortcut.Someone very kindly pointed out to me in this thread 
that there is a PEP for py.exe. I don't use py.exe originally because I didn't 
trust it believing it was a new-fangled Microsoft trick. I did read that PEP 
but it has no relevance for my mixed Windows/Linux environments. On reflection 
I now believe I won't use py.exe because it introduces an unnecessary layer of 
indirection.The  bottom line is that you still need to know which Python a 
particular set of circumstances demands and if you use py.exe you then need to 
also understand how it chooses and how it interprets shebang lines written for 
your Linux environment. And if that isn't your situation I have jumped to the 
wrong conclusion.I have found no problem in Windows when I use shebang lines in 
scripts intended for execution in both Linux and Windows. They are ignored 
unless you use py.exe.My advice is to give up py.exe unless your use case 
mandates shebang lines in Windows.M--(Unsigned mail from my phone)
 Original message From: Sibylle Koczian via Python-list 
 Date: 14/1/24  23:59  (GMT+10:00) To: 
python-list@python.org Subject: Re: Python 3.12.1, Windows 11: shebang line 
#!/usr/bin/env python3
  doesn't work any more Am 09.01.2024 um 12:36 schrieb Barry Scott via 
Python-list:> > >> On 7 Jan 2024, at 15:09, Sibylle Koczian via Python-list 
 wrote: Oh, and the two Windows and Python versions 
are on two different computers. Will remove the "/env" from my shebang 
lines, even if I don't understand what's happening.> > Thanks for the details.> 
> Only thing I can think of is that "python" may be defaulting to mean python 
2.> If you use "#!/usr/bin/env python3" it may work on both.No, it doesn't. 
That's the form I started with. When it didn't work I thought "python3" might 
be too old, because Python 2 is dead for so long.> > Did you creates a py.ini 
file to configure py.exe?> > See if you have %userappdata%\py.ini on either 
windows 10 or windows 11.> If so what is its contents?No to both.> > I've tried 
with and without a py.ini and cannot duplicate what you see.> It really seems 
strange. Only thing I can think of - and I don't really believe in that idea: 
as far as I know in Windows 11 the handling of PATH has changed. My Python 
isn't on the path, perhaps that is it. A shebang line without "/env" doesn't 
check the path, right?Thank you for helping,Sibylle-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-29 Thread Mike Dewhirst via Python-list

On 29/12/2023 12:09 pm, Félix An via Python-list wrote:

On 2023-12-25 12:36, Mike Dewhirst wrote:


3. You cannot trust Microsoft. You can trust Python Software 
Foundation. Python from PSF works the same in all environments - or 
if not it is a bug. Python from Microsoft is tweaked to satisfy their 
aforementioned strategy of locking in users to Windows.




I strongly disagree with this.


Not sure which part of the above you strongly disagree with. I might 
seem a bit OTT with "You cannot trust Microsoft" but I did put it in a 
specific context.


PSF does try to make Python work identically in all operating systems it 
supports. The OP was using py.exe which I discovered (just now - and it 
is why I'm writing this) exists on my Windows 10 machine. I have never 
installed any Python other than personally downloaded from the 
python.org website - therefore py.exe must have come from PSF!


I had assumed the OP had installed Python from the Microsoft shop and 
that's where py.exe must have come from.


I learn something every day.

I don't get all the irrational hate for Microsoft that exists within 
the Linux community.


Perhaps you are too young to remember when Steve Ballmer was head of 
Microsoft?


He specifically and loudly hated Linux and developed the anti-linux 
culture/strategy within Microsoft. If memory serves correctly he called 
it a virus. That was in the context of trying to get rid of Linux in 
Europe (Germany I think) where it had gained a small municipal foothold. 
Microsoft eventually succeeded in reversing that public mistake.


In recent years, Microsoft has made great contributions to the 
everyday life of Linux users. VS Code is based on open source and 
available on Linux, .NET is now on Linux, Windows has WSL2 and Visual 
Studio Linux development tools to help you develop software for Linux, 
SQL Server (despite still being commercial software except for the 
Express and Developer versions) is on Linux, etc.


I only use Linux on servers without GUI. I have used Windows desktop 
since it was released because most of my clients used it. I had no 
choice. I have been watching what they do for decades.


I agree they appear to have become more civilised in recent years.

M

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-25 Thread Mike Dewhirst via Python-list
Well spotted Chris. 4 was a generalisation based on my own 
circumstances.However, I'm not wrong about Microsoft motivationsM--(Unsigned 
mail from my phone)
 Original message From: Chris Angelico via Python-list 
 Date: 25/12/23  15:57  (GMT+10:00) To: Michael Torrie 
via Python-list  Subject: Re: Python 3.12.1, Windows 
11: shebang line #!/usr/bin/env python3
  doesn't work any more On Mon, 25 Dec 2023 at 15:42, Mike Dewhirst via 
Python-list wrote:>> Apologies for top posting - my 
phone seems unable to do otherwise.>> Here's my view - which may not be 
popular.You're right about that part, anyhow :)> 4. Shebang lines are pretty 
much redundant now that most python interpreters are run from venvsStrongly 
dispute that. The rest. you're entitled to your opinions(they happen to be 
wrong, but you're entitled to them :) ), but thisis a statement of fact that I 
would need to see some evidence for.ChrisA-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-24 Thread Mike Dewhirst via Python-list
Apologies for top posting - my phone seems unable to do otherwise.

Here's my view - which may not be popular.

1. Py.exe is an awful idea. 

2. Installing python in %PROGRAMFILES% is not a good idea

3. Installing Python from a Microsoft shop or server is a bad idea

4. Shebang lines are pretty much redundant now that most python interpreters 
are run from venvs

5. Shebang lines have never had a place in Windows

TL;DR

1. Py.exe is not a standard python thing and learning to rely on it is 
following Microsoft's marketing strategy. That strategy has served them 
brilliantly since the 1980s. They make their environment just different enough 
to force users to invest brainspace to make it work and thereby lock-in their 
users with their own muscle-memory. Very subtle. Not.

2. Installing Python in Microsoft's preferred location wasn't always 
"standard". Python downloaded from python.org always defaulted to C:\PythonXXX. 
I'm not saying that was a perfect location but at least it was (in my case 
still is) nicely visible for researching multiple different pythons. Putting 
deep in Program files does nothing other than hide it. 

3. You cannot trust Microsoft. You can trust Python Software Foundation. Python 
from PSF works the same in all environments - or if not it is a bug. Python 
from Microsoft is tweaked to satisfy their aforementioned strategy of locking 
in users to Windows.

4. Shebang lines are a fallback if you don't wish to type the interpreter 
location before typing your script name. You must know your interpreter 
location to get the shebang line right. Shebangs were never intended as primary 
devices. They are linux/unix things.

5. Shebangs on Windows are a new opportunity for Microsoft to plough its own 
furrow. They are difficult to handle simply because of 4 above.

To finish this rant, I believe it is far better to aim for standardisation 
rather than subtle and annoying differences deliberately designed to supplant 
standards in favour of market dominance.

Merry Christmas all

Cheers

Mike




On 24 December 2023 3:35:42 am AEDT, Michael Torrie via Python-list 
 wrote:
>On 12/22/23 20:56, Thomas Passin via Python-list wrote:
>> It's just better not to make assumptions about which version of Python 
>> will be running. Just specify it yourself when you can, and then you can 
>> be sure.
>
>Precisely, which is why the shebang is so useful, even on Windows with
>py launcher.  For example, set the shebang to:
>
>#!/usr/bin/python3.6
>
>And py launcher will always try to run it with Python 3.6.
>
>-- 
>https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Code improvement question

2023-11-16 Thread Mike Dewhirst via Python-list

On 16/11/2023 9:34 am, Rimu Atkinson via Python-list wrote:





Why don't you use re.findall?

re.findall(r'\b[0-9]{2,7}-[0-9]{2}-[0-9]{2}\b', txt)


I think I can see what you did there but it won't make sense to me - 
or whoever looks at the code - in future.


That answers your specific question. However, I am in awe of people 
who can just "do" regular expressions and I thank you very much for 
what would have been a monumental effort had I tried it.


I feel the same way about regex. If I can find a way to write 
something without regex I very much prefer to as regex usually adds 
complexity and hurts readability.


You might find https://regex101.com/ to be useful for testing your 
regex. You can enter in sample data and see if it matches.


If I understood what your regex was trying to do I might be able to 
suggest some python to do the same thing. Is it just removing numbers 
from text?


The for loop, "for bit in bits" etc, could be written as a list 
comprehension.


pieces = [bit if len(bit) > 6 else "" for bit in bits]

For devs familiar with other languages but new to Python this will 
look like gibberish so arguably the original for loop is clearer, 
depending on your team.


It's worth making the effort to get into list comprehensions though 
because they're awesome.


I agree qualitatively 100% but quantitively perhaps I agree 80% where 
readability is easy.


I think that's what you are saying anyway.








That little re.sub() came from ChatGPT and I can understand it 
without too much effort because it came documented


I suppose ChatGPT is the answer to this thread. Or everything. Or 
will be.


I am doubtful. We'll see!

R





--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Code improvement question

2023-11-16 Thread Mike Dewhirst via Python-list

On 15/11/2023 3:08 pm, MRAB via Python-list wrote:

On 2023-11-15 03:41, Mike Dewhirst via Python-list wrote:

On 15/11/2023 10:25 am, MRAB via Python-list wrote:

On 2023-11-14 23:14, Mike Dewhirst via Python-list wrote:
I'd like to improve the code below, which works. It feels clunky to 
me.


I need to clean up user-uploaded files the size of which I don't 
know in

advance.

After cleaning they might be as big as 1Mb but that would be super 
rare.

Perhaps only for testing.

I'm extracting CAS numbers and here is the pattern xx-xx-x up to
xxx-xx-x eg., 1012300-77-4

def remove_alpha(txt):

      """  r'[^0-9\- ]':

      [^...]: Match any character that is not in the specified set.

      0-9: Match any digit.

      \: Escape character.

      -: Match a hyphen.

      Space: Match a space.

      """

  cleaned_txt = re.sub(r'[^0-9\- ]', '', txt)

      bits = cleaned_txt.split()

      pieces = []

      for bit in bits:

      # minimum size of a CAS number is 7 so drop smaller 
clumps of digits


      pieces.append(bit if len(bit) > 6 else "")

      return " ".join(pieces)


Many thanks for any hints


Why don't you use re.findall?

re.findall(r'\b[0-9]{2,7}-[0-9]{2}-[0-9]{2}\b', txt)


I think I can see what you did there but it won't make sense to me - or
whoever looks at the code - in future.

That answers your specific question. However, I am in awe of people who
can just "do" regular expressions and I thank you very much for what
would have been a monumental effort had I tried it.

That little re.sub() came from ChatGPT and I can understand it without
too much effort because it came documented

I suppose ChatGPT is the answer to this thread. Or everything. Or 
will be.



\b  Word boundary
[0-9]{2,7}  2..7 digits
-   "-"
[0-9]{2}    2 digits
-   "-"
[0-9]{2}    2 digits
\b  Word boundary

The "word boundary" thing is to stop it matching where there are 
letters or digits right next to the digits.


For example, if the text contained, say, "123456789-12-1234", you 
wouldn't want it to match because there are more than 7 digits at the 
start and more than 2 digits at the end.



Thanks

I know I should invest some brainspace in re. Many years ago at a Perl 
conferenceI did buy a coffee mug completely covered with a regex cheat 
sheet. It currently holds pens and pencils on my desk. And spiders now I 
look closely!


Then I took up Python and re is different.

Maybe I'll have another look ...

Cheers

Mike

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Code improvement question

2023-11-14 Thread Mike Dewhirst via Python-list

On 15/11/2023 10:25 am, MRAB via Python-list wrote:

On 2023-11-14 23:14, Mike Dewhirst via Python-list wrote:

I'd like to improve the code below, which works. It feels clunky to me.

I need to clean up user-uploaded files the size of which I don't know in
advance.

After cleaning they might be as big as 1Mb but that would be super rare.
Perhaps only for testing.

I'm extracting CAS numbers and here is the pattern xx-xx-x up to
xxx-xx-x eg., 1012300-77-4

def remove_alpha(txt):

      """  r'[^0-9\- ]':

      [^...]: Match any character that is not in the specified set.

      0-9: Match any digit.

      \: Escape character.

      -: Match a hyphen.

      Space: Match a space.

      """

  cleaned_txt = re.sub(r'[^0-9\- ]', '', txt)

      bits = cleaned_txt.split()

      pieces = []

      for bit in bits:

      # minimum size of a CAS number is 7 so drop smaller clumps 
of digits


      pieces.append(bit if len(bit) > 6 else "")

      return " ".join(pieces)


Many thanks for any hints


Why don't you use re.findall?

re.findall(r'\b[0-9]{2,7}-[0-9]{2}-[0-9]{2}\b', txt)


I think I can see what you did there but it won't make sense to me - or 
whoever looks at the code - in future.


That answers your specific question. However, I am in awe of people who 
can just "do" regular expressions and I thank you very much for what 
would have been a monumental effort had I tried it.


That little re.sub() came from ChatGPT and I can understand it without 
too much effort because it came documented


I suppose ChatGPT is the answer to this thread. Or everything. Or will be.

Thanks

Mike
--
https://mail.python.org/mailman/listinfo/python-list


Code improvement question

2023-11-14 Thread Mike Dewhirst via Python-list

I'd like to improve the code below, which works. It feels clunky to me.

I need to clean up user-uploaded files the size of which I don't know in 
advance.


After cleaning they might be as big as 1Mb but that would be super rare. 
Perhaps only for testing.


I'm extracting CAS numbers and here is the pattern xx-xx-x up to 
xxx-xx-x eg., 1012300-77-4


def remove_alpha(txt):

    """  r'[^0-9\- ]':

    [^...]: Match any character that is not in the specified set.

    0-9: Match any digit.

    \: Escape character.

    -: Match a hyphen.

    Space: Match a space.

    """

cleaned_txt = re.sub(r'[^0-9\- ]', '', txt)

    bits = cleaned_txt.split()

    pieces = []

    for bit in bits:

    # minimum size of a CAS number is 7 so drop smaller clumps of digits

    pieces.append(bit if len(bit) > 6 else "")

    return " ".join(pieces)


Many thanks for any hints

Cheers

Mike
--
https://mail.python.org/mailman/listinfo/python-list


Re: Help

2023-11-07 Thread Mike Dewhirst via Python-list

On 7/11/2023 9:02 am, Jason Friedman via Python-list wrote:

On Sun, Nov 5, 2023 at 1:23 PM office officce via Python-list <
python-list@python.org> wrote:


which python version is better to be used and how to make sure it works on
my window 10 because i downloaded it and it never worked so I uninstall to
do that again please can you give me the steps on how it will work perfectly


1. Download from https://python.org (not Microsoft) and always choose 
the 64-bit stable version


2. Choose the installation location as C:\Python311 (avoid the default)

4. Accept other recommended installation options especially to include 
Python on the path (if offered)


Guaranteed to work. Also, you will never have to uninstall. Install the 
next version in C:\Python312 etc


In due course, investigate virtual environments so you can work on 
projects simultaneously using different versions of Python or different 
versions of various Python libraries.


Good luck

Mike





If you are just starting out, the most recent version is 3.12 and is
probably your best choice.

When you say it never worked, can you describe in more detail what you did
and what error messages you encountered?

This mailing list does not accept screenshots.



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Checking if email is valid

2023-11-02 Thread Mike Dewhirst via Python-list
If i wanted an email verifier I would look at open source frameworks and see 
how they do it. Django comes to mind.--(Unsigned mail from my phone)
 Original message From: Michael Torrie via Python-list 
 Date: 3/11/23  07:23  (GMT+10:00) To: 
python-list@python.org Subject: Re: Checking if email is valid On 11/2/23 
00:42, Simon Connah via Python-list wrote:> Basically I'm writing unit tests 
and one of them passess in a string > with an invalid email address. I need to 
be able to check the string > to see if it is a valid email so that the unit 
test passess.If you truly have managed to code an RFC-compliant verifier, I 
commend you.> Valid as in conforms to the standard. Although having looked at 
the> standard that might be more difficult than originally planned.You'll have 
to read the relevant RFCs.  Lots of corner cases!  From whatI can see virtually 
no one on the internet gets it right, judging by thenumber of times I have 
valid email addresses flagged as not valid bypoor algorithms.-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to sort this without 'cmp=' in python 3?

2023-10-24 Thread Mike H via Python-list
On Saturday, October 15, 2016 at 12:27:42 AM UTC-7, Peter Otten wrote:
> 38016...@gmail.com wrote: 
> 
> > nums=['3','30','34','32','9','5'] 
> > I need to sort the list in order to get the largest number string: 
> > '953433230' 
> > 
> > nums.sort(cmp=lambda a,b: cmp(a+b, b+a), reverse=True) 
> > 
> > But how to do this in python 3? 
> > 
> > Thank you
> While cmp_to_key is neat doing it by hand should also be instructive. 
> Essentially you move the comparison into a method of the key: 
> 
> $ cat translate_cmp.py 
> class Key(str): 
> def __lt__(a, b): 
> return a + b < b + a 
> 
> nums = ['3','30','34','32','9','5'] 
> print(nums) 
> nums.sort(key=Key, reverse=True) 
> print(nums) 
> print("".join(nums)) 
> 
> $ python3 translate_cmp.py
> ['3', '30', '34', '32', '9', '5']
> ['9', '5', '34', '3', '32', '30']
> 953433230 
> 
> The above works because in CPython list.sort() currently uses only the < 
> operator; adding __gt__() and __eq__() to make this portable is 
> straightforward even if you do not use the functools.total_ordering class 
> decorator.
Is it possible to use lambda expression instead of defining a `Key` class? 
Something like `sorted(my_list, key = lambda x, y: x+y > y+x)`?
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: regarding installation of python version

2023-10-09 Thread Mike Dewhirst via Python-list
Look in Windows Settings, About, Advanced system settings, Environment 
variables and you will see two sets of variables. One for the system and one 
set for yourself.Select Path and click [Edit]Carefully remove all references to 
Python in both sets.In theory you can now install a new Python and it will 
update your environment variables and that will be the Python you 
use.Otherwise, find the Python executable (python.exe) you wish to use and call 
it in your terminal using its full path.Good luckMike--(Unsigned mail from my 
phone)
 Original message From: "Thri sowmya.G via Python-list" 
 Date: 10/10/23  04:43  (GMT+10:00) To: 
python-list@python.org Subject: regarding installation of python version        
The problem is how many times I have uninstalled the python version but   
always it is showing the  same version  after the installation  of new   
version too  .But in all control panel and file explorer at everywhere the   
system showing that the old  version got uninstalled  but again in command   
prompt or terminal it is in  same old version. I hope I will get a   solution 
from you.       
    
   Thank you.    -- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


zoneinfo and tzdata

2023-08-09 Thread Mike Dewhirst via Python-list
The zoneinfo module does not work on Windows unless you have installed 
tzdata.


On Ubuntu that data seems to exist already. Not sure how or why but it 
obviously isn't there in a Windows virtualenv unless deliberately installed.


I just spent a bit of time trying to switch from pytz to zoneinfo in 
Django without luck. I then asked and greatly embarrassed ChatGPT which 
kept apologizing when I fed back all the zoneinfo errors its advice caused.


It wasn't until I read the docs that I saw zoneinfo would get timezone 
data from tzdata if the real info wasn't where it first looked.


As soon as I installed tzdata, ChatGPT's advice started to work. When I 
reported this, it was very grateful and assured me my generosity in 
bothering to correct it would be very beneficial for other users having 
similar problems.


Might I suggest that if zoneinfo comes up empty-handed it should raise 
an error saying no timezone information was found?


Currently, it just nominates the timezone key you attempt to use. Behind 
the scenes it surely knows there are no such keys. In that case it might 
suggest installing tzdata.


Cheers

Mike
--
https://mail.python.org/mailman/listinfo/python-list


[Python-announce] Tkintertoy 1.6.0 released

2023-08-07 Thread Mike Callahan
Announcing the release of Tkintertoy version 1.60.

Python educators, do you want to move your students beyond command-line
interfaces (ie. input-print) but find the jump to Tkinter too much?
Give TkinterTOY a try. It makes Tkinter GUI programming child's play.

Used in college-level courses, your students will be writing clean, balanced
GUI interfaces quickly. Tkintertoy also let the student explore more complex
parts of Tkinter when they are ready.

Extensive online documentation with a beginner's tutorial that covers
many types of simple examples is available. Tkintertoy has an MIT license.

Downloads:
https://pypi.python.org/pypi/tkintertoy

Documentation:
http://tkintertoy.readthedocs.io/en/master/

Repository:
https://github.com/mcalla314/tkintertoy

Enjoy.

http://pypi.tkintertoy.com;>Tkintertoy 1.60
A lightweight wrapper for Tkinter for novice coders. (08/07/23)
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


Re: Is there a Python module to parse a date like the 'date' command in Linux?

2023-06-01 Thread Mike Dewhirst

On 24/05/2023 6:00 pm, Mike Dewhirst wrote:

On 23/05/2023 7:16 pm, Chris Green wrote:

Mike Dewhirst  wrote:

[-- multipart/mixed, encoding 7bit, 22 lines --]

 [-- text/plain, encoding base64, charset: UTF-8, 16 lines --]

On 21/05/2023 5:53 am, Chris Green wrote:

I'm converting a bash script to python as it has become rather clumsy
in bash.

What is the use case?


A script I use to create diary entries, so it's very handy to be able
to give the date as 'yesterday' or 'friday'.


OK - I thought maybe baklabel might suit, but that delivers a day-name 
(backup filename prefix) for today or a given date


I have just refreshed baklabel on PyPI and upped it from my local svn 
server to github [1]


The changes include resolving ambiguous dates across locales eg USA vs 
Australia 5/6/2023 being detected as May in USA and June in Australia on 
the assumption that the user knows what is required.


[1] https://github.com/mdewhirst/baklabel





--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.


--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a Python module to parse a date like the 'date' command in Linux?

2023-05-24 Thread Mike Dewhirst

On 23/05/2023 7:16 pm, Chris Green wrote:

Mike Dewhirst  wrote:

[-- multipart/mixed, encoding 7bit, 22 lines --]

 [-- text/plain, encoding base64, charset: UTF-8, 16 lines --]

On 21/05/2023 5:53 am, Chris Green wrote:

I'm converting a bash script to python as it has become rather clumsy
in bash.

What is the use case?


A script I use to create diary entries, so it's very handy to be able
to give the date as 'yesterday' or 'friday'.


OK - I thought maybe baklabel might suit, but that delivers a day-name 
(backup filename prefix) for today or a given date







--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: where is requests

2023-05-23 Thread Mike Dewhirst
Try pip install requests--(Unsigned mail from my phone)
 Original message From: Rich Osborne  
Date: 24/5/23  11:49  (GMT+10:00) To: python-list@python.org Subject: where is 
requests I have install Python 3.11.3 but my import requests does not work. I 
found documentation that refers to C:\python35 but I am on 3.11.3. Where do I 
find requests?Sent from Mail 
for Windows-- https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a Python module to parse a date like the 'date' command in Linux?

2023-05-22 Thread Mike Dewhirst

On 21/05/2023 5:53 am, Chris Green wrote:

I'm converting a bash script to python as it has become rather clumsy
in bash.


What is the use case?


However I have hit a problem with converting dates, the bash script
has:-

 dat=$(date --date "$1" +"%Y/%m/%d")

and this will accept almost anything reasonably sensible that can be
interpreted as a date, in particular it accepts things like "tomorrow",
"yesterday" and "next thursday".

Is there anything similar in Python or would I be better off simply
using os.system() to run date from the python program?




--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Christoph Gohlke and compiled packages

2023-04-12 Thread Mike Dewhirst

On 13/04/2023 12:00 pm, Eryk Sun wrote:

On 4/12/23, Mike Dewhirst  wrote:

Collecting psycopg2==2.9.3

x86 and x64 wheels are available for Python 3.11 if you can use
Psycopg 2 version 2.9.5 or 2.9.6 instead of 2.9.3:

https://pypi.org/project/psycopg2/2.9.5/#files
https://pypi.org/project/psycopg2/2.9.6/#files


Many thanks to both of you ...

I'll uninstall Microsoft Build Tools as soon as its finished installing 
(37.3GB and I had to clear space for it)


Cheers

Mike




--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Christoph Gohlke and compiled packages

2023-04-12 Thread Mike Dewhirst

On 12/04/2023 10:59 pm, Mike Dewhirst wrote:

Sadly Windows is still in the dock. The jury is still out.

Turns out the "without a hitch" was based on cached wheels.

I'm going to start from scratch with new projects using Pythons 3.8, 
3.10 and 3.11 and report back.


Report summary:

pip install works well with Python 3.8 and 3.10 (and presumably 3.9) but 
3.11 fails.


Report conclusion:

As indicated in this thread, pip cannot find Python 3.11 wheels and 
therefore needs to compile from source. It is looking for Microsoft's 
C++ compiler version 14.


I'll (gulp) attempt to swallow the Koolaid.

See error below ...

Cheers

Mike

(xreq) D:\Users\mike\envs\xreq>pip install -r requirements\dev.txt

...

Collecting psycopg2==2.9.3

  Downloading psycopg2-2.9.3.tar.gz (380 kB)

 --- 380.6/380.6 kB 6.0 MB/s eta 0:00:00

  Preparing metadata (setup.py) ... done

Collecting Pillow==9.1.1

  Downloading Pillow-9.1.1.tar.gz (49.8 MB)

  49.8/49.8 MB 4.5 MB/s eta 0:00:00

  Preparing metadata (setup.py) ... done

...

Installing collected packages: psycopg2, Pillow, ...

  DEPRECATION: psycopg2 is being installed using the legacy 'setup.py install' 
method, because it does not have a 'pyproject.toml' and the 'wheel' package is 
not installed. pip 23.1 will enforce this behaviour change. A possible 
replacement is to enable the '--use-pep517' option. Discussion can be found 
athttps://github.com/pypa/pip/issues/8559

  Running setup.py install for psycopg2 ... error

  error: subprocess-exited-with-error

  × Running setup.py install for psycopg2 did not run successfully.

  │ exit code: 1

  ╰─> [24 lines of output]

  
D:\Users\mike\envs\xreq\Lib\site-packages\setuptools\config\setupcfg.py:508: 
SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use 
license_files instead.

    warnings.warn(msg, warning_class)

  running install

  
D:\Users\mike\envs\xreq\Lib\site-packages\setuptools\command\install.py:34: 
SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip 
and other standards-based tools.

    warnings.warn(

  running build

  running build_py

  creating build

  creating build\lib.win-amd64-cpython-311

  creating build\lib.win-amd64-cpython-311\psycopg2

  copying lib\errorcodes.py -> build\lib.win-amd64-cpython-311\psycopg2

  copying lib\errors.py -> build\lib.win-amd64-cpython-311\psycopg2

  copying lib\extensions.py -> build\lib.win-amd64-cpython-311\psycopg2

  copying lib\extras.py -> build\lib.win-amd64-cpython-311\psycopg2

  copying lib\pool.py -> build\lib.win-amd64-cpython-311\psycopg2

  copying lib\sql.py -> build\lib.win-amd64-cpython-311\psycopg2

  copying lib\tz.py -> build\lib.win-amd64-cpython-311\psycopg2

  copying lib\_ipaddress.py -> build\lib.win-amd64-cpython-311\psycopg2

  copying lib\_json.py -> build\lib.win-amd64-cpython-311\psycopg2

  copying lib\_range.py -> build\lib.win-amd64-cpython-311\psycopg2

  copying lib\__init__.py -> build\lib.win-amd64-cpython-311\psycopg2

  running build_ext

  building 'psycopg2._psycopg' extension

  error: Microsoft Visual C++ 14.0 or greater is required. Get it with 
"Microsoft C++ Build 
Tools":https://visualstudio.microsoft.com/visual-cpp-build-tools/

  [end of output]

  note: This error originates from a subprocess, and is likely not a problem 
with pip.

error: legacy-install-failure

× Encountered error while trying to install package.

╰─> psycopg2

note: This is an issue with the package mentioned above, not pip.

hint: See above for output from the failure.

(xreq) D:\Users\mike\envs\xreq>






Cheers

Mike

On 12/04/2023 6:13 pm, Mike Dewhirst wrote:
Well thank you Christoph Gohlke and thank you Ian Bicking and 
colleagues.


I just used pip to nakedly install psycopg2 and Pillow without a 
hitch. My distrust of Windows has kept me going back to Christoff's 
well for years.


Maybe it is time to assume innocence unless proven guilty ;-)

Thanks to all who showed me the way.

Cheers

Mike

On 11/04/2023 11:39 pm, Thomas Passin wrote:

On 4/11/2023 6:58 AM, Chris Angelico wrote:
On Tue, 11 Apr 2023 at 20:15, Jim Schwartz  
wrote:


What’s the problem now?  Is it with python on windows?  I use 
python on windows so I’d like to know. Thanks




Python itself is fine, but a lot of third-party packages are hard to
obtain. So if you need numpy, for instance, or psycopg2, you might
need to find an alternative source.


I've noticed a big change in the last few years in that PyPi has 
many, many amd-64 packages than it used to in the heyday of 
Christoph Gohlke's efforts. I haven't needed to go there for some 
time whereas I used to need to all the time.  So if I "need numpy, 
for instance, or psycopg2" for Windows, I get t

Re: Christoph Gohlke and compiled packages

2023-04-12 Thread Mike Dewhirst

Sadly Windows is still in the dock. The jury is still out.

Turns out the "without a hitch" was based on cached wheels.

I'm going to start from scratch with new projects using Pythons 3.8, 
3.10 and 3.11 and report back.


Cheers

Mike

On 12/04/2023 6:13 pm, Mike Dewhirst wrote:

Well thank you Christoph Gohlke and thank you Ian Bicking and colleagues.

I just used pip to nakedly install psycopg2 and Pillow without a 
hitch. My distrust of Windows has kept me going back to Christoff's 
well for years.


Maybe it is time to assume innocence unless proven guilty ;-)

Thanks to all who showed me the way.

Cheers

Mike

On 11/04/2023 11:39 pm, Thomas Passin wrote:

On 4/11/2023 6:58 AM, Chris Angelico wrote:
On Tue, 11 Apr 2023 at 20:15, Jim Schwartz  
wrote:


What’s the problem now?  Is it with python on windows?  I use 
python on windows so I’d like to know. Thanks




Python itself is fine, but a lot of third-party packages are hard to
obtain. So if you need numpy, for instance, or psycopg2, you might
need to find an alternative source.


I've noticed a big change in the last few years in that PyPi has 
many, many amd-64 packages than it used to in the heyday of Christoph 
Gohlke's efforts. I haven't needed to go there for some time whereas 
I used to need to all the time.  So if I "need numpy, for instance, 
or psycopg2" for Windows, I get them from PyPi.


Yes, I know that some projects haven't caught up to Python 3.11x yet. 
And I'm glad I haven't needed to create a binary wheel for Windows 
myself.  But the situation is way better than it used to be.  I've 
had more trouble with Python and Python packages on Linux than on 
Windows.









--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Christoph Gohlke and compiled packages

2023-04-12 Thread Mike Dewhirst

Well thank you Christoph Gohlke and thank you Ian Bicking and colleagues.

I just used pip to nakedly install psycopg2 and Pillow without a hitch. 
My distrust of Windows has kept me going back to Christoff's well for 
years.


Maybe it is time to assume innocence unless proven guilty ;-)

Thanks to all who showed me the way.

Cheers

Mike

On 11/04/2023 11:39 pm, Thomas Passin wrote:

On 4/11/2023 6:58 AM, Chris Angelico wrote:
On Tue, 11 Apr 2023 at 20:15, Jim Schwartz  
wrote:


What’s the problem now?  Is it with python on windows?  I use python 
on windows so I’d like to know. Thanks




Python itself is fine, but a lot of third-party packages are hard to
obtain. So if you need numpy, for instance, or psycopg2, you might
need to find an alternative source.


I've noticed a big change in the last few years in that PyPi has many, 
many amd-64 packages than it used to in the heyday of Christoph 
Gohlke's efforts. I haven't needed to go there for some time whereas I 
used to need to all the time.  So if I "need numpy, for instance, or 
psycopg2" for Windows, I get them from PyPi.


Yes, I know that some projects haven't caught up to Python 3.11x yet. 
And I'm glad I haven't needed to create a binary wheel for Windows 
myself.  But the situation is way better than it used to be.  I've had 
more trouble with Python and Python packages on Linux than on Windows.





--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Christoph Gohlke and compiled packages

2023-04-11 Thread Mike Dewhirst

On 11/04/2023 5:21 pm, Chris Angelico wrote:

On Tue, 11 Apr 2023 at 14:20, Mike Dewhirst  wrote:

It seems Christoph Gohlke has been cut adrift and his extremely valuable
web page ...

https://www.lfd.uci.edu/~gohlke/pythonlibs/

... turned into an archive getting staler by the day.

What does the Python Software Foundation and the community think about this?

My personal view? Windows is *really really really* hard to support,
and ONE PERSON did a stellar job of supporting the platform for an
incredibly long job.


I have to agree - but what you are really saying is that without 
Christoph, Python on Windows is


*really really really*

not viable.

Mike




I don't know if he'll ever read this, but if he does, thank you
Christoph for your amazing contribution to the community.

The fact that we have a problem now is a testament to the length of
time that we *didn't* have a problem, thanks to him.

ChrisA



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Christoph Gohlke and compiled packages

2023-04-10 Thread Mike Dewhirst
It seems Christoph Gohlke has been cut adrift and his extremely valuable 
web page ...


https://www.lfd.uci.edu/~gohlke/pythonlibs/

... turned into an archive getting staler by the day.

What does the Python Software Foundation and the community think about this?

Cheers

Mike
--
https://mail.python.org/mailman/listinfo/python-list


RE: found older version of python in my command prompt

2023-03-28 Thread Mike Dewhirst
The quickest and dirtiest fix is to edit your %path% variable in windows. 
Remove all python versions you don't want from the path and Windows won't find 
them.You can then just delete the unwanted python directories.That doesn't 
remove any old dll files in secret locations but this is a dirty 
fix.--(Unsigned mail from my phone)
 Original message From: pranavbhardwaj...@gmail.com Date: 
29/3/23  02:43  (GMT+10:00) To: Python-list@python.org Subject: found older 
version of python in my command prompt            Sent from [1]Mail for Windows 
  Dear sir,     I am Pranav Bhardwaj and I am facing issue 
regarding python   version. When I try to open python in my command prompt, I 
see there is   very older version in it that is python 2.7.13 as a default 
version. I   want to switch my default version to the latest version in my 
command   prompt. Plese help me how can I do this.    References   Visible 
links   1. https://go.microsoft.com/fwlink/?LinkId=550986-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Winodws10 Command Prompt unresponsive to .py commands

2023-03-07 Thread Mike Dewhirst

On 8/03/2023 6:31 am, Thomas Gregg wrote:

Hi,  I got python 11 to work with the esptool a few days ago.  However, I
must have something wrong, because now, when I enter any command with .py,
Windows Command Prompt just returns without doing anything.  Example

C:\Users\gregg>esptool.py version

C:\Users\gregg>

I tried to change the Windows default by filetype. but no luck.  Any
ideas?  Thanks


Prove it works in the command prompt by using the full path to python 
for example,


C:\Python311\python C:\Users\gregg>esptool.py version

If that works, look at your path environment variables and see where 
python is sitting. Substitute the real location of Python 3.11 on your 
machine. Sadly, I think it defaults to C:\Program Files nowadays.


Once you can get Python working by omitting the path, for example,

C:\Users\gregg>python esptool.py version

... you can then right-click the .py file and choose whichever program 
you like to open with.


I'm inclined to advise you to focus on getting virtual environments 
working next and leave all that auto-opening to later. You might find 
you prefer to right click and select every time.


M

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: bool and int

2023-01-24 Thread Mike Baskin via Python-list
Will all of you please stop sending me emails

Sent from my iPhone

> On Jan 24, 2023, at 2:59 PM, rbowman  wrote:
> 
> On Mon, 23 Jan 2023 23:22:00 -0500, Dino wrote:
> 
>> $ python Python 3.8.10 (default, Mar 15 2022, 12:22:08)
>> [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license"
>> for more information.
> b = True isinstance(b,bool)
>> True
> isinstance(b,int)
>> True
> 
> 
>> WTF!
> 
> 
 b = True
 isinstance(b, bool)
> True
 isinstance(b, int)
> True
 c = b + 10
 print(c)
> 11
 b = False
 c = b + 10
 print(c)
> 10
> 
> 
> bool is a subtype of integer. I never dug that deep into Python's guts but 
> I assume it goes back to boolean being an afterthought in C. Some people 
> fancy it up with #defines but I always use int.  0 is false, anything else 
> is true.
> 
> C# is pickier, which I guess is a good thing. 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Mike Baskin via Python-list
Can you stop please


Sent from Yahoo Mail for iPhone


On Tuesday, January 24, 2023, 10:12 AM, Thomas Passin  
wrote:

On 1/23/2023 9:12 PM, Chris Angelico wrote:
> On Tue, 24 Jan 2023 at 13:09, Jach Feng  wrote:
>>
>> Chris Angelico 在 2023年1月24日 星期二清晨5:00:27 [UTC+8] 的信中寫道:
>>> On Tue, 24 Jan 2023 at 07:47, Cameron Simpson  wrote:

 But for Jach Feng: the "--" is really expected as something the user
 does when they invoke your programme, _explicitly_ saying that what
 follows from here is not an argument. So the user is expected to type:

 your_script -x -y -- "-4^2+5.3*abs(-2-1)/2"

 where there are -x and -y options, then end of options, then an
 argument, which would look like an option if there wasn't the "--"
 argument.
>>> And if you DON'T expect the user to enter the "--", then why use
>>> argparse? You can just check argv directly to get your arguments.
>>>
>>> This entire thread is a massive "how can I use X to do Y?" problem.
>>>
>>> ChrisA
>> The '--' requirement makes its usage less instinctive, and handling argv 
>> directly makes me loss the benefit of using '-h':-)
> 
> if "-h" in sys.argv: usage()
> else: do_stuff_with(sys.argv[1:])
> 
> What is argparse really doing for you?

I second this.  "if '-h' in sys.argv:"  is usually what I do.

Alternatively, you could use "--arg=" syntax and place your string 
"-4^2+5.3*abs(-2-1)/2" its right-hand side":

infix2postfix [options] "--infix=-4^2+5.3*abs(-2-1)/2"

This shouldn't be too hard for a user to work with.  You could scan the 
argument list for the presence of "--infix=" and display the help 
message if it isn't there.

-- 
https://mail.python.org/mailman/listinfo/python-list



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Mike Baskin via Python-list
Stop please


Sent from Yahoo Mail for iPhone


On Tuesday, January 24, 2023, 1:05 AM, Cameron Simpson  wrote:

On 23Jan2023 17:58, Jach Feng  wrote:
 parser.parse_args(['--', 'infix2postfix.py', '-4.3+5'])
>usage: [-h] infix
>: error: unrecognized arguments: -4.3+5

This error doesn't look like "-4.3+5 looks like an option" but instead 
"we don't expect any arguments after "infix".

Not personally a fan of argparse myself, but then I have my own 
elaborate command line framework which generally uses getopt for the 
option stuff.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list



-- 
https://mail.python.org/mailman/listinfo/python-list


OT: ~gohlke [Was: Installation hell]

2022-12-19 Thread Mike Dewhirst

On 20/12/2022 9:28 am, Mats Wichmann wrote:

On 12/19/22 14:47, Eryk Sun wrote:


If you search a bit deeper, you'll find a site with unofficial Windows
builds of many packages, including pygame for Python 3.11:

https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
Semi-OT: that's been a superb resource, but apparently it's no longer 
maintained - internet scuttlebutt suggests the project which let it 
exist has lost funding.  The link above is a mirror, marked 
"Archived", and I can't see there's been any addition since July 1. 
(sadly... I happen to need an lxml build for experimenting with 3.12 
alphas, and that's an absolute bear to build for WIndows - I've never 
cracked it)


That is dreadful news! Windows as a dev platform is dead without it. 
That is serious.


Back on topic - Installation hell

I use Windows for historic reasons related to needing to support 99% of 
my customers/dependents who also use it. I'm the only one who also uses 
Linux - but only non-GUI Linux.


Windows works for me as a dev platform because there are so many 
talented Python people out there who make it work. It would be 
impossible otherwise. I would be forced to to learn two GUIs if I had to 
develop on Linux.


I'm here to tell you that dev and production on different OSs works 
without a hitch! For me.


Whoever wrote the installation docs for Windows did a great job. All the 
bases and options are covered. Absolutely no-one could complain that any 
pertinent detail has been omitted.


Some marketing research is indicated. The OP who started this thread 
could define themself in exquisite detail so that installation 
infrastructure including documentation can be developed to suit that 
market exemplar.


I think there are several separate markets. Eg., for someone like me ... 
locked into Windows (but not Microsoft otherwise) and needing to target 
Linux web servers. That would allow a branching of the installation docs 
to home in, say, on virtual envs and multiple Python installations in 
the root of drive C: (well away from "Program files") and so on.


If the OP says they are an educated computer scientist they could become 
a hero and write up a tightly focused set of docs (extracted from the 
comprehensive canonical docs) which assume their particular "market", 
for want of a better term.


The PSF might recognise the effort and be able to promote such a high 
interest from Windows Python devs into funding for Chris Gohlke.


Cheers

Mike


--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Subtracting dates to get hours and minutes

2022-12-12 Thread Mike Dewhirst
I have seen vast conversations on this topic but if everything is in the same 
time-zone and daylight saving switchovers are not involved it is relatively 
straightforward.Check the timedelta docs. Or convert datetimes to ordinals and 
subtract then convert the result to whatever units please you.M--(Unsigned mail 
from my phone)
 Original message From: Steve GS  Date: 
12/12/22  17:34  (GMT+10:00) To: python-list@python.org Subject: Subtracting 
dates to get hours and minutes How do I subtract two time/dates and calculate 
the hours and minutesbetween?Steve-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python script not letting go of files

2022-11-29 Thread Mike Dewhirst

Stefan

Thank you. I should have said this has been working fine for years and 
years until Ubuntu 2022.04 on a new droplet running Apache/2.4.52


I will refactor it one day - especially if the script is implicated. But 
I think I have to learn how to use lsof first!


Cheers

Mike

On 30/11/2022 1:44 am, Stefan Ram wrote:

"Weatherby,Gerard"  writes:

Do any of you Python folks see any blunders in the above code along the
lines of not letting go of py files or static assets?

   No, sorry. But I had to refactor it.

   *Warning* The following code is not intended to be executed,
   it is just intended to be read by humans. It was not tested
   and, therefore, it probably contains errors. If executed, it
   may cause destruction such as deletions of files etc. Stefan
   Ram (I) does not claim any copyright for his modifications.

def attempt( task, command ):
 if trycmd( command, log ):
 print( f'task "{task}" failed.'  )
 return False # failure
 else:
 return True # success

def main():
 with open( fetchlog, 'a' )as log_:
 global log
 log = log_
 remove_site()
 del log

def remove_site():
 log.write( f"\n\nFetching {tag}" )
 if attempt( "remove site", f"sudo rm -Rf {site_root}", log ):
 get_source()

def get_source():
 if attempt( "get source", f"sudo svn export --force --username {usr} --password 
{pw} {svn_repo} {site_root}" ):
 install_requirements()

def install_requirements():
 if attempt( "install requirements", f"sudo -H pip install -r {reqfile}" ):
 repo_migrations()

def repo_migrations():
 if attempt( "run any migrations shipped from the repo", f"sudo python3 
{site_root}/manage.py migrate --noinput --settings={settings}" ):
 makemigrations()

def makemigrations():
 # shouldn't find anything
 if attempt( "makemigrations", f"sudo python3 {site_root}/manage.py 
makemigrations --noinput --settings={settings}" ):
 migrate()

def migrate():
 # should already be done
 if attempt( "migrate 2", f"sudo python3 {site_root}/manage.py migrate --noinput 
--settings={settings}" ):
 remove_static()

def remove_static():
 if attempt( "remove all static files from their Apache dir", f"sudo rm -Rf 
{static_root}/*" ):
 copy_static()

def copy_static():
 if attempt( "copy all static files to the Apache location", f"sudo python3 
{site_root}/manage.py collectstatic --noinput --settings={settings}" ):
 set_permissions()

def set_permissions():
 if attempt( "set all permissions", f"sudo {scripts}/perms_{host}.sh" ):
 service_restart()

def service_restart():
 if attempt( "restart of Apache service", f"sudo service apache2 restart" ):
 log_success()

def log_success():
 log.write( f"\nFinish {tag}\n\n" )

# main()
# sys.exit()





--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Python script not letting go of files

2022-11-28 Thread Mike Dewhirst
I have a script which fetches a production site directly from a 
Subversion repo using svn export


It runs a bunch of commands by calling this little method ...

def trycmd(cmd, log):
    retcode = -1
    ret = f"Trying {cmd}"
    try:
    retcode = os.system(cmd)
    ret = f"\n{cmd} -ok-> {retcode}"
    except Exception as err:
    ret = f"\n{cmd} -fail-> {err}"
    log.write(remove_password(ret))
    return retcode

This is the fetching script (omitting variables at the top) which 
appears to be keeping a finger on files which Apache wants.


with open(fetchlog, 'a') as log:
    ret = f"\n\nFetching {tag}"
    log.write(ret)
    cmd = f"sudo rm -Rf {site_root}"
    if trycmd(cmd, log) == 0:
    cmd = f"sudo svn export --force --username {usr} --password 
{pw} {svn_repo} {site_root}"

    if trycmd(cmd, log) == 0:
    # get any new dependencies
    cmd = f"sudo -H pip install -r {reqfile}"
    if trycmd(cmd, log) == 0:
    # run any migrations shipped from the repo
    cmd = f"sudo python3 {site_root}/manage.py migrate 
--noinput --settings={settings}"

    if trycmd(cmd, log) == 0:
    # shouldn't find anything
    cmd = f"sudo python3 {site_root}/manage.py 
makemigrations --noinput --settings={settings}"

    if trycmd(cmd, log) == 0:
    # should have been done already
    cmd = f"sudo python3 {site_root}/manage.py 
migrate --noinput --settings={settings}"

    if trycmd(cmd, log) == 0:
    # remove all static files from their Apache dir
    cmd = f"sudo rm -Rf {static_root}/*"
    if trycmd(cmd, log) == 0:
    # copy all static files to the Apache 
location
    cmd = f"sudo python3 
{site_root}/manage.py collectstatic --noinput --settings={settings}"

    if trycmd(cmd, log) == 0:
    # set all permissions
    cmd = f"sudo {scripts}/perms_{host}.sh"
    if trycmd(cmd, log) == 0:
    cmd = "sudo service apache2 
restart"

    if trycmd(cmd, log) == 0:
    ret = f"\nFinish {tag}\n\n"
    log.write(ret)
    else:
    print("Apache didn't restart")
    else:
    print("Didn't set permissions")
    else:
    print("Didn't collectstaic")
    else:
    print("Didn't delete static files")
    else:
    print("Didn't migrate 2")
    else:
    print("Didn't makemigration")
    else:
    print("Didn't migrate 1")
    else:
    print("Didn't install requirements")
    else:
    print("Didn't get source")
    else:
    print("Didn't remove site")
exit()

The problem I'm trying to fix is that after an Apache reload Apache 
seems hellbent on filling up its scoreboard and running out of 
resources. The kind folk on the Apache mailing list say something is 
hogging the workers.


You can see the last operation above is an Apache restart. It should be 
an Apache reload. Reload however lets Apache run out of resources.


Do any of you Python folks see any blunders in the above code along the 
lines of not letting go of py files or static assets?


mod_wsgi is configured with 100% defaults.
mod_mpm_event conf per advice from the Apache mailing list is ...


    ServerLimit 32
    StartServers    16
    MinSpareThreads 400
    MaxSpareThreads 800
    ThreadLimit 64
    ThreadsPerChild 50
    AsyncRequestWorkerFactor    2
    MaxRequestWorkers   800
    MaxConnectionsPerChild  0


Server Version: Apache/2.4.52 (Ubuntu 2022.04) OpenSSL/3.0.2 
mod_wsgi/4.9.0 Python/3.10

Server MPM: event
Server Built: 2022-09-30T04:09:50

DigitalOcean droplet 8BG RAM and lightly loaded.

Many thanks for any hints.

Cheers

Mike


--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import

RE: Python coding

2022-11-27 Thread Mike Dewhirst
Create a folder anywhere convenient and copy it in there.Then - if python has 
been downloaded from the Python website and installed "normally" you can open a 
command prompt in that folder and type C:\\$>python 
logistics.py"normally" means Python is in your path environment 
variable.--(Unsigned mail from my phone)
 Original message From: Karen Park  Date: 
28/11/22  10:07  (GMT+10:00) To: python-list@python.org Subject: Python coding 
Hello,I am trying to do a python code. Using Windows, I got as far as the step 
that asks me to “copy the logistics.py file and save it in the same folder that 
you are running python from” (as displayed by the command prompt). Can you help 
direct me where to go to copy and save this “logistics.py“ file?Thank you,Karen 
-- https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to manage python shebang on mixed systems?

2022-11-06 Thread Mike Dewhirst

On 7/11/2022 6:51 am, jak wrote:

Il 06/11/2022 11:03, Chris Green ha scritto:

I have a number of python scripts that I run on a mix of systems.  I
have updated them all to run on python 3 but many will also run quite
happily with python 2.  They all have a #!/usr/bin/python3 shebang.

This works almost everywhere but there is one system where only
python 2 is available (at /usr/bin/python).

I don't have python 2 on any of the systems I manage myself now so a
#!/usr/bin/python shebang will fail.

Is there a neat way of handling this?  I could write a sort of wrapper
script to run via the shebang but that seems overkill to me.



Can you link the interpreter on each system to the same-named local link 
and put that in your shebang?


#!~/scripts/mypython



hi,
If you can call Python from the shell prompt, then you could remove the
path from shebang:

#!python




--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Update from 3.9 to 3.10.8 and uninstall 3.9

2022-10-23 Thread Mike Dewhirst

On 23/10/2022 9:13 pm, B N wrote:

I am new to python and wish to update 3.9 to3.10.8 which I have downloaded. How 
do I replace 3.9 with the 3.10.8 I downloaded.
Kind regards
JohnGee


It depends on the operating system.

Typically, you can just install the new version and adjust your 
environment vars (ie., path) to point to the new version instead of the old.


The theoretical reason is that you may have other programs/scripts etc 
which still rely on the old version.


If you are new to Python, you should probably avoid installing later 
versions until you have studied virtual environments. A venv will let 
you keep your "system" Python(s) clean and unencumbered while being able 
to experiment with all sorts of additional libraries, packages etc in 
multiple separate sub-environments.


Cheers

Mike

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python developer

2022-10-01 Thread Mike Dewhirst
Ah well! I did not think that far ahead.My apologies for burdening your digest. 
Should I abandon my quest?M--(Unsigned mail from my phone)
 Original message From: Jan van den Broek  
Date: 2/10/22  06:58  (GMT+10:00) To: python-list@python.org Subject: Re: 
python developer 2022-10-01, Mike Dewhirst  schrieb:>So 
the answer to your question is signed email is easy and if it becomes >popular 
it has potential to defeat hackers.Yes, but I'm reading this as a 
usenet-message (comp.lang.python), not as a mail.-- Jan v/d 
broekbalgl...@dds.nl-- https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python developer

2022-09-30 Thread Mike Dewhirst

On 30/09/2022 3:31 pm, Jan van den Broek wrote:

2022-09-29, Mike Dewhirst  schrieb:

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)

Why?


Good question.

Further to Peter's explanation, email is the primary conduit for 
hackers. At this point in time human education and training is the only 
defence. The bad guys count on human error because that's what humans 
are good at.


If everyone signed their mail and all mail clients defaulted to 
expecting signed email from correspondents for whom the public key is 
known, some of that defence can be delegated to the computer.


I'm not expecting this any time soon but it doesn't hurt to get the 
message out.


Most email activists demand end-to-end encryption and obviously signing 
email is part of that. However, my view is that email privacy, while 
very important, is an oxymoron. If you need encrypted messages you would 
never use email. You would meet under a waterfall.


So the answer to your question is signed email is easy and if it becomes 
popular it has potential to defeat hackers.


Cheers

Mike


[Schnipp]



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python developer

2022-09-29 Thread Mike Dewhirst

On 30/09/2022 5:09 am, Walid AlMasri wrote:

Hi all,

I has been using python in scientific computing for many years

I want to become a python developer so what is a good reference to follow ?


A developer makes products whereas a scientist understands complexities.

I would recommend reading about Scrum 
https://www.scrum.org/resources/what-is-scrum


After many years you probably already know enough Python to do anything.

Your task as a developer is to understand the relationship between a 
problem (business or scientific) and a maintainable, perhaps packaged, 
product which handles the drudgery and leaves expert judgement to the 
human user(s).


Scrum is the easiest way down that road.

You need a customer with a problem. You might be your own first customer.

Cheers

Mike



Thanks in advance !

Walid



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Persistent Error: Python was not found

2022-08-14 Thread Mike Dewhirst

Jonathan

This is what I would do ...

1.    Download Python from python.org not Microsoft

2.    Install as an expert or custom install to C:\Python310 rather than 
C:\Program files


3.    Ignore this point - I was going to mention VirtualEnv which comes 
later for software development and thereafter you don't need to put 
Python on the Windows path. As I said, ignore this point.


4.    Add C:\Python310\Scripts to the path (system or user)

5.    Add C:\Python310 to the path after C:\Python310\Scripts

6.    Open a cmd prompt and enter python to prove it starts then quit. 
Exit the cmd window


7.    Create a directory in the root of your user profile 
(C:\Users\Jonathan ??) called pythontest


8.    Save 'print("hello world")' in a text file called hello.py in the 
above directory


9.    Open a cmd prompt and type > python 
C:\Users\Jonathan\pythontest\hello.py


Should work.

If you want to execute a python script without first opening a cmd 
prompt, you need a bat file or shortcut which contains the command line 
you want executed. Give that a double-click and it should also work.


If Python is on the path you don't need to specify where it is.

You do need to tell Python what you want it to execute.

It is possible that you can associate .py files with Python but that 
would be a step too far for me.


Good luck

M

On 13/08/2022 9:55 pm, Jonathan Owah wrote:

Good day,
Great job on making Python easily accessible.

I'm using a  Windows 10, 64gb HP EliteBook.

I've been trying to configure my laptop to run python scripts.
This is the error I keep getting:
Python was not found; run without arguments to install from the Microsoft
Store, or disable this shortcut from Settings > Manage App Execution
Aliases.

Everything I've tried has failed.
I've uninstalled and reinstalled
I've added to path, both user and system path,manually and from fresh
installation
I've downloaded from Microsoft Store
I've gone to manage app aliases and switched off
I've used Git Bash, Powershell, cmd

I'm able to check my python version: 3.10.6.

I can't do anything else and it's really frustrating.

I've been at it for days, I don't know what else to do.

Thanks in advance for your help.

Regards



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pip upgrade causing issues in 3.10

2022-07-20 Thread Mike Dewhirst

On 20/07/2022 4:43 am, David Raymond wrote:

C:\Program Files\Python310\Scripts>..\python.exe -m pip install --upgrade pip
ERROR: Could not install packages due to an OSError: [WinError 32] The process 
cannot access the file because it is being used by another process: 
'c:\\program files\\python310\\scripts\\'
There's your problem. The 'other' process is your cmd.exe within which 
you are typing etc.


Python scripts dir should be on the path so you don't have to execute 
anything from within it. Windows is obviously tripping over its own toes 
trying to delete and install something in the same dir while you also 
have your foot in it.


M

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Simple message passing system and thread safe message queue

2022-07-18 Thread Mike Dewhirst
MortenI didn't click on your link because it is a security bad practice to 
click on any unsolicited link.I'm not accusing you or anyone else of nefarious 
intent. It could be argued that being a member of this list means links posted 
here are indeed solicited links.You asked for comment. Mine is that your 
subject line was interesting enough for me to open your email but my own 
security habits prevented me from learning more about your 
topic.CheersMike--(Unsigned mail from my phone)
 Original message From: "Morten W. Petersen" 
 Date: 19/7/22  03:35  (GMT+10:00) To: python-list 
 Subject: Simple message passing system and thread safe 
message queue Hi.I wrote a couple of blog posts as I had to create a message 
passing system,and these posts are 
here:http://blogologue.com/search?category=1658082823X26Any comments or 
suggestions?Regards,Morten-- I am https://leavingnorway.infoVideos at 
https://www.youtube.com/user/TheBlogologueTwittering at 
http://twitter.com/blogologueBlogging at http://blogologue.comPlaying music at 
https://soundcloud.com/morten-w-petersenAlso playing music and podcasting 
here:http://www.mixcloud.com/morten-w-petersen/On Google+ here 
https://plus.google.com/107781930037068750156On Instagram at 
https://instagram.com/morphexx/-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Solved] Re: Windows registry PermissionError

2022-05-13 Thread Mike Dewhirst

On 13/05/2022 4:37 pm, Eryk Sun wrote:

On 5/13/22, Mike Dewhirst  wrote:

On 13/05/2022 4:14 pm, Eryk Sun wrote:

Since self.connect() is always called, you should document that the
initial hkey parameter has to be one of the following predefined key
handles:

  HKEY_LOCAL_MACHINE
  HKEY_USERS

I'm targeting HKEY_CURRENT_USER so I assume HK_USERS includes that.

Using HKEY_CURRENT_USER with RegConnectRegistryW() to access a remote
registry isn't well defined and not documented as supported. If it
works at all, the API probably just opens a subkey of the remote
HKEY_USERS based on the string SID (security identifier string) of the
current user. That may fail as not found since user SIDs are unique to
machines, unless it's on a domain.

Bear in mind that the remote registry service is running on the remote
machine as SYSTEM (S-1-5-18) in the non-interactive services session.
If it literally accessed its "current user", then it would open
"HKEY_USERS\S-1-5-18".
In that case, I'll remove 'computer' as a parameter and lock it in as 
None. I'll document why and if I ever need to access a remote registry 
I'll do some research along the lines you suggest.


My case demands execution of this code via login script for end-user 
configuration after the IT department has done a bulk installation 
rollout. One of key items is ComputerName which is in HKLM and needs to 
be in HKCU for whichever user logs in. The application looks in HKCU for 
a unique Device Reference and ComputerName suffices and is attractive 
because it is also the asset number of the machine.



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Solved] Re: Windows registry PermissionError

2022-05-13 Thread Mike Dewhirst

On 13/05/2022 4:14 pm, Eryk Sun wrote:

Since self.connect() is always called, you should document that the
initial hkey parameter has to be one of the following predefined key
handles:

 HKEY_LOCAL_MACHINE
 HKEY_USERS


I'm targeting HKEY_CURRENT_USER so I assume HK_USERS includes that.

Thanks again Eryk

Cheers

mike


 HKEY_PERFORMANCE_DATA

WinAPI RegConnectRegistryW() only matters when the target computer is
a different machine, in which case an RPC proxy handle is returned.



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


[Solved] Re: Windows registry PermissionError

2022-05-12 Thread Mike Dewhirst

Eryk

Many thanks. It is working perfectly now. See below for the reworked code.

Cheers

Mike

On 13/05/2022 1:42 pm, Eryk Sun wrote:

On 5/12/22, Mike Dewhirst  wrote:

  access=wr.KEY_ALL_ACCESS + wr.KEY_WRITE,


import winreg as wr class Registry: def __init__(self, computer=None, 
hkey=None, sub_key=None): self.computer = computer self.key = hkey 
self.sub_key = sub_key def connect(self): return 
wr.ConnectRegistry(self.computer, self.key) def select(self, 
access=None): with self.connect() as hkey: return wr.OpenKeyEx(key=hkey, 
sub_key=self.sub_key, access=access) def count(self): access = 
wr.KEY_QUERY_VALUE return wr.QueryInfoKey(self.select(access=access)) 
def query(self, vname, access=None): if access is None: access = 
wr.KEY_READ | wr.KEY_WOW64_32KEY return 
wr.QueryValueEx(self.select(access=access), vname) def setvalue(self, 
vname, value, access=None): if access is None: access = wr.KEY_SET_VALUE 
with self.select(access=access) as hkey: return wr.SetValueEx(hkey, 
vname, 0, wr.REG_SZ, value) if __name__ == "__main__": lmregistry = 
Registry( hkey=wr.HKEY_LOCAL_MACHINE, sub_key=r"SOFTWARE\XXX 
Technology\AppName", ) print(f"\n{lmregistry.sub_key}") anz = 
lmregistry.query('Country')[0] print(f"\n{anz}") db = 
lmregistry.query('Database')[0] print(f"\n{db}") devref = 
lmregistry.query('v135')[0] print(f"\n{devref}") orgid = 
lmregistry.query('v136')[0] print(f"\n{orgid}") curegistry = Registry( 
hkey=wr.HKEY_CURRENT_USER, sub_key=r"SOFTWARE\XXX Technology\AppName", ) 
print(f"\n{curegistry.sub_key}") anz = curegistry.query('Country')[0] 
print(f"\n{anz}") db = curegistry.query('Database')[0] print(f"\n{db}") 
devref = curegistry.query('v135')[0] print(f"\n{devref}") orgid = 
curegistry.query('v136')[0] print(f"\n{orgid}") 
curegistry.setvalue('Country', 'nz') curegistry.setvalue('Database', 
'2022.2') curegistry.setvalue('v135', 'Asus10') 
curegistry.setvalue('v136', orgid.replace('ALL', 'Most')) anz = 
curegistry.query('Country')[0] print(f"\n{anz}") db = 
curegistry.query('Database')[0] print(f"\n{db}") devref = 
curegistry.query('v135')[0] print(f"\n{devref}") orgid = 
curegistry.query('v136')[0] print(f"\n{orgid}")


Again, many thanks for putting so much effort into educating me.

Cheers

Mike

The access parameter is a bit mask of access rights that combine via
bitwise OR (|), not via arithmetic addition.

KEY_ALL_ACCESS (0x000F_003F) is a superset of KEY_WRITE (0x0002_0006):

 KEY_WRITE = (
 READ_CONTROL   | # 0x0002_
 KEY_SET_VALUE  | # 0x_0002
 KEY_CREATE_SUB_KEY | # 0x_0004
 )# 0x0002_0006

 KEY_ALL_ACCESS = (
 DELETE | # 0x0001_
 READ_CONTROL   | # 0x0002_
 WRITE_DAC  | # 0x0004_
 WRITE_OWNER| # 0x0008_
 KEY_QUERY_VALUE| # 0x_0001
 KEY_SET_VALUE  | # 0x_0002
 KEY_CREATE_SUB_KEY | # 0x_0004
 KEY_ENUMERATE_SUB_KEYS | # 0x_0008
 KEY_NOTIFY | # 0x_0010
 KEY_CREATE_LINK| # 0x_0020
 )# 0x000F_003F

The result of the arithmetic addition `KEY_ALL_ACCESS + KEY_WRITE` is
0x0011_0045, which is wrong and meaningless. Registry key objects do
not support SYNCHRONIZE (0x0010_) access; DELETE (0x0001_)
access isn't needed; 0x_0040 is not a supported key right;
KEY_CREATE_SUB_KEY (0x_0004) access isn't needed; and
KEY_QUERY_VALUE (0x_0001) isn't sufficient.

You should limit the requested access to the specific access rights
that are required for querying and setting values in the key:

 access=(wr.KEY_QUERY_VALUE | wr.KEY_SET_VALUE)


 def setvalue(self, vname, value):
return wr.SetValueEx(self.select(), vname, 0, 1, value)

You shouldn't hard code the value of the data type constant. Use
wr.REG_SZ instead of 1.

The return value of self.select() is a winreg PyHKEY object that wraps
the OS handle for the key object. You're relying on implicit closing
of this handle based on referencing counting. It's cleaner to use it
in a `with` statement, as you would for a file object returned by
open(). For example:

 with self.select() as hkey:
 wr.SetValueEx(hkey, vname, 0, wr.REG_SZ, value)


  lmregistry = Registry(
  hkey=wr.HKEY_LOCAL_MACHINE,
  sub_key="SOFTWARE\WOW6432Node\XXX Technology\AppName",

You really shouldn't open the "WOW6432Node" key directly. It is an
implementation detail of the WOW64 subsystem that runs 32-bit
applications on a 64-bit system. If you need to operate on the
registry keys of 32-bit applications from a native 64-bit process,
open the normal path usin

Windows registry PermissionError

2022-05-12 Thread Mike Dewhirst
I'm trying to copy a value from HKLM to HKCU for application rollout via 
bulk installation by an administrator but individual Windows user setup.


Getting this ...

Traceback (most recent call last):
  File "D:\Users\mike\envs\chemdata\registry\wreg\wreg.py", line 84, in 


    curegistry.setvalue('Country', anz)
  File "D:\Users\mike\envs\chemdata\registry\wreg\wreg.py", line 51, in 
setvalue

    return wr.SetValueEx(self.select(), vname, 0, 1, value)
PermissionError: [WinError 5] Access is denied

... on my very own laptop where my login has admistrator permissions ... 
which I realise means nothing in this case.


But I would not have been surprised if it worked here but not in the 
field where users are firefighters and definitely not administrators and 
cannot install software on their workstations.


import winreg as wr


class Registry:

def __init__(self, computer=None, hkey=None, sub_key=None):
# computer is None means this computer
self.computer = computer
self.key = hkey
self.sub_key = sub_key

def connect(self):
return wr.ConnectRegistry(self.computer, self.key)

def select(self):
# also tried OpenKeyEx()
return wr.OpenKey(
key=self.key,
sub_key=self.sub_key,
access=wr.KEY_ALL_ACCESS + wr.KEY_WRITE,
)

def query(self, vname):
return wr.QueryValueEx(self.select(), vname)

def setvalue(self, vname, value):
return wr.SetValueEx(self.select(), vname, 0, 1, value)

if __name__ == "__main__":

lmregistry = Registry(
hkey=wr.HKEY_LOCAL_MACHINE,
sub_key="SOFTWARE\WOW6432Node\XXX Technology\AppName",
)
print(f"\n{lmregistry.sub_key}")
anz = lmregistry.query('Country')[0]
print(f"\n{anz}") # works fine

curegistry = Registry(
hkey=wr.HKEY_CURRENT_USER,
sub_key="SOFTWARE\XXX Technology\AppName",
)
curegistry.setvalue('Country', anz)  <<<<< BOOM <<<<<
...

Any hints appreciated.

Cheers

Mike

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Question re Executing a Script

2022-04-30 Thread Mike Dewhirst

On 1/05/2022 8:37 am, Brent Hunter wrote:

Hello,

I just purchased a new Windows 11 computer and installed Python 3.10.4 (64 
bit).  I can't figure out from your documentation, how do I:


   1.  Run a python script that is located in the same directory ( 
C:\Users\Brent\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 
3.10 )


   1.  How do I automatically run a python app at Windows startup?


https://www.windowscentral.com/how-launch-apps-automatically-during-login-windows-11

Personally, I write a batch file containing the 'python 
/location/of/script.py' command line and call that batch file. That 
assumes python.exe is on the Windows path.


Once tested and working it lets me edit the batch file to adjust the 
payload without having to touch the Windows stuff again.







Thank you!

Brent Hunter




--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue47174] Define behavior of descriptor-typed fields on dataclasses

2022-04-01 Thread mike bayer


Change by mike bayer :


--
nosy: +zzzeek

___
Python tracker 
<https://bugs.python.org/issue47174>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32658] Metacharacter (\) documentation suggestion

2022-04-01 Thread mike mcleod


Change by mike mcleod :


--
keywords: +patch
pull_requests: +30302
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32230

___
Python tracker 
<https://bugs.python.org/issue32658>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47183] Cant compile html docs

2022-04-01 Thread mike mcleod


mike mcleod  added the comment:

Works for me. The command installed the correct version of Sphinx.
Thanks.

--
stage:  -> resolved
status: pending -> closed

___
Python tracker 
<https://bugs.python.org/issue47183>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47183] Cant compile html docs

2022-03-31 Thread mike mcleod

New submission from mike mcleod :

After sync'ing to upstream/main and then
python/Doc on  main via  v3.11.0a6+ 
❯ make html
mkdir -p build
Building NEWS from Misc/NEWS.d with blurb
PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees   -W . build/html 
Running Sphinx v3.5.4
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 495 source files that are out of date
updating environment: [new config] 495 added, 0 changed, 0 removed
reading sources... [100%] whatsnew/index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... failed

Warning, treated as error:
unsupported theme option 'license_url' given
make: *** [Makefile:53: build] Error 2

No changes to source.

--
assignee: docs@python
components: Documentation
messages: 416448
nosy: docs@python, mikecmcleod
priority: normal
severity: normal
status: open
title: Cant compile html docs
type: compile error
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue47183>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32658] Metacharacter (\) documentation suggestion

2022-03-31 Thread mike mcleod


mike mcleod  added the comment:

After sync'ing to upstream/main and then running make html I get: ...
checking consistency... done
preparing documents... failed

Warning, treated as error:
unsupported theme option 'license_url' given
make: *** [Makefile:53: build] Error 2

I cant see anything from googling the error above.
This is before I have made any changes.

--

___
Python tracker 
<https://bugs.python.org/issue32658>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32658] Metacharacter (\) documentation suggestion

2022-03-29 Thread mike mcleod


mike mcleod  added the comment:

Sorry, forgot this one. Would you like me to move this forward? Or do you want 
to take it? I don't mind either way.

--

___
Python tracker 
<https://bugs.python.org/issue32658>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46751] Windows-style path is not recognized under cygwin

2022-02-14 Thread Mike Kaganski


Mike Kaganski  added the comment:

> As for 3.9: it's not available through the 64 bit installer (at least, I 
> don't see it there). I'll look and see what's involved in installing it.

I don't remember if I did something special to install it; however, just maybe 
you need to install python39 directly.

> Are you running the 32- or 64-bit version?

64-bit.

> Does Cygwin not use : as a path list separator?

It uses : as path separator:

$ echo $PATH
/opt/lo/bin:/usr/local/bin:/usr/bin:/cygdrive/c/Program 
Files/AdoptOpenJDK/jdk-11.0.7.10-hotspot/bin:/cygdrive/c/Program Files 
(x86)/Common 
Files/Oracle/Java/javapath:/cygdrive/c/ProgramData/Oracle/Java/javapath:/cygdrive/c/Windows/System32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:...

But obviously, it can't use Windows-style paths in the $PATH (for that reason?).

--

___
Python tracker 
<https://bugs.python.org/issue46751>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46751] Windows-style path is not recognized under cygwin

2022-02-14 Thread Mike Kaganski


Mike Kaganski  added the comment:

Thanks for looking at this!

> Are you running from bash (or another cygwin shell), or from cmd.exe, or 
> something else?

:) Citing myself:

> Trying this *bash* command line:

> To my knowledge, cygwin's installer doesn't have a 3.9 available.

It does: https://cygwin.com/packages/summary/python3.html

--

___
Python tracker 
<https://bugs.python.org/issue46751>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46751] Windows-style path is not recognized under cygwin

2022-02-14 Thread Mike Kaganski


New submission from Mike Kaganski :

Using cyqwin 3.3.4-2, and python3:

Python 3.9.10 (main, Jan 20 2022, 21:37:52)
[GCC 11.2.0] on cygwin

Trying this bash command line:

> python3 C:/path/to/script.py

results in this error:

"python3: can't open file '/cygdrive/c/path/to/curdir/C:/path/to/script.py': 
[Errno 2] No such file or directory"

OTOH, calling it like

> python3 /cygdrive/c/path/to/script.py

gives the expected output:

"usage: script.py [-h] ..."

It seems that python3 doesn't recognize "C:/path/to/script.py" to be a proper 
full path under cygwin, while most other cygwin apps handle those fine. E.g.,

> nano C:/path/to/script.py

opens the script for editing without problems.

The mentioned path syntax is useful and supported under cygwin, so it would be 
nice if python3 could support it, too. Especially useful it is in mixed 
development environment, mixing Windows native tools and cygwin ones; using 
such path style allows to use same paths for both kinds of tools, simplifying 
scripts.

--
components: Windows
messages: 413247
nosy: mikekaganski, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows-style path is not recognized under cygwin
type: behavior
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46751>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43882] [security] CVE-2022-0391: urllib.parse should sanitize urls containing ASCII newline and tabs.

2022-02-06 Thread Mike Lissner


Mike Lissner  added the comment:

Looks like that CVE isn't public yet.

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0391

Any chance I can get access (I originally reported this vuln.). My email is 
m...@free.law, if it's possible and my email is needed.

Thanks!

--

___
Python tracker 
<https://bugs.python.org/issue43882>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46654] urllib.request.urlopen doesn't handle UNC paths produced by pathlib's resolve() (but can handle UNC paths with additional slashes)

2022-02-05 Thread Mike Auty


Change by Mike Auty :


--
title: file_open doesn't handle UNC paths produced by pathlib's resolve() (but 
can handle UNC paths with additional slashes) -> urllib.request.urlopen doesn't 
handle UNC paths produced by pathlib's resolve() (but can handle UNC paths with 
additional slashes)

___
Python tracker 
<https://bugs.python.org/issue46654>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46654] file_open doesn't handle UNC paths produced by pathlib's resolve() (but can handle UNC paths with additional slashes)

2022-02-05 Thread Mike Auty


Mike Auty  added the comment:

I can confirm that url2pathname work with either number of slashes, and that 
open_file appears to have had the file: removed.

However, in even if the check in open_file were bypassed, it calls 
open_local_file, which then strips any host before calling url2pathname, 
meaning the host will never be included if only two slashes are used.

host, file = _splithost(url)
localname = url2pathname(file)

This is what seems to cause the issue when attempting to open 
file://server/host/file.ext on windows, even though 
file:server/host/file.ext open just fine.

The problem that I found, and was in bug #32442, is that pathlib only ever 
returns two slashes, which despite being a valid and correctly formed url, 
can't be opened by urllib.request.urlopen().  Since there doesn't seem to be an 
issue with opening these files (given it works for file:server...) and 
since nt2pathname will produce the correct result, it feels as though open_file 
should have special code on windows to allow servers to be accepted by the file 
handler (open_local_file should probably stay as is to not change the API too 
much).

--

___
Python tracker 
<https://bugs.python.org/issue46654>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46654] file_open doesn't handle UNC paths produced by pathlib's resolve() (but can handle UNC paths with additional slashes)

2022-02-05 Thread Mike Auty


Mike Auty  added the comment:

Here's the revised code sample:

import pathlib
import urllib.request

path = "Z:\\test.py"

print(f"Stock open: {pathlib.Path(path).as_uri()}")
with urllib.request.urlopen(pathlib.Path(path).as_uri()) as fp:
data = fp.read()

print(f"Pathlib resolved open: {pathlib.Path(path).resolve().as_uri()}")
with urllib.request.urlopen(pathlib.Path(path).resolve().as_uri()) as fp:
data = fp.read()

and here's the output:

Z:\> python test.py
Stock open: file:///Z:/test.py
Pathlib resolved open: file://host/share/test.py
Traceback (most recent call last):
File "C:\Program Files\Python310\lib\urllib\request.py", line 1505, in 
open_local_file
stats = os.stat(localfile)
FileNotFoundError: [WinError 2] The system cannot find the file specified: 
'\\share\\test.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "Z:\test.py", line 14, in 
with urllib.request.urlopen(pathlib.Path(path).resolve().as_uri()) as 
fp:
File "C:\Program Files\Python310\lib\urllib\request.py", line 216, in 
urlopen
return opener.open(url, data, timeout)
File "C:\Program Files\Python310\lib\urllib\request.py", line 519, in open
response = self._open(req, data)
File "C:\Program Files\Python310\lib\urllib\request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "C:\Program Files\Python310\lib\urllib\request.py", line 496, in 
_call_chain
result = func(*args)
File "C:\Program Files\Python310\lib\urllib\request.py", line 1483, in 
file_open
return self.open_local_file(req)
File "C:\Program Files\Python310\lib\urllib\request.py", line 1522, in 
open_local_file
raise URLError(exp)
urllib.error.URLError: 

--

___
Python tracker 
<https://bugs.python.org/issue46654>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46654] file_open doesn't handle UNC paths produced by pathlib's resolve() (but can handle UNC paths with additional slashes)

2022-02-05 Thread Mike Auty


Mike Auty  added the comment:

My bad, sorry, I realized I was conflating open with urllib.request.urlopen.  I 
believe the issue still exists though, sorry for the confusion.

--

___
Python tracker 
<https://bugs.python.org/issue46654>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46654] file_open doesn't handle UNC paths produced by pathlib's resolve() (but can handle UNC paths with additional slashes)

2022-02-05 Thread Mike Auty


Mike Auty  added the comment:

> Why are you adding `.as_uri()`?

The API we provide accepts URIs, so whilst the example seems a little 
contrived, the code itself expects a URI and then calls open (making use of the 
ability to add open handlers).

> Builtin open() calls C open().

As best I can tell the file handler is defined in urllib/request.py as 
file_open.  This appears to do some preprocessing to remove the file scheme and 
(and explicitly throws an exception if there's a host that isn't localhost) 
before it gets to the C open().  I wondered why it didn't check if it was on 
windows and, if so, construct an appropriate path (since quadruple hash I don't 
think adheres to the URI RFC, but seems to open correctly)?

--

___
Python tracker 
<https://bugs.python.org/issue46654>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46654] file_open doesn't handle UNC paths produced by pathlib's resolve() (but can handle UNC paths with additional slashes)

2022-02-05 Thread Mike Auty


New submission from Mike Auty :

I've found open to have difficulty with a resolved pathlib path:

Example code of:

   import pathlib
   path = "Z:\\test.py"
   with open(path) as fp:
   print("Stock open: works")
   data = fp.read()
   with open(pathlib.Path(path).resolve().as_uri()) as fp:
   print("Pathlib resolve open")
   data = fp.read()

Results in:

Z:\> python test.py
Stock open: works
Traceback (most recent call last):
  File "Z:\test.py", line 12, in 
with open(pathlib.Path(path).resolve().as_uri()) as fp:
FileNotFoundError: [Errno 2] No such file or directory: 
"file://machine/share/test.py"

Interestingly, I've found that open("file:machine/share/test.py") succeeds, 
but this isn't what pathlib's resolve() produces.  It appears as though 
file_open only supports hosts that are local, but will open UNC paths on 
windows with the additional slashes.  This is quite confusing behaviour and 
it's not clear why file://host/share/file won't work, but 
file:host/share/file does.

I imagine this is a long time issue and a decision has already been reached on 
why file_open doesn't support such URIs, but I couldn't find the answer 
anywhere, just issue 32442 which was resolved without clarifying the 
situation...

--
messages: 412602
nosy: ikelos
priority: normal
severity: normal
status: open
title: file_open doesn't handle UNC paths produced by pathlib's resolve() (but 
can handle UNC paths with additional slashes)

___
Python tracker 
<https://bugs.python.org/issue46654>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32442] Result of pathlib Path.resolve() with UNC path is not very useful

2022-02-05 Thread Mike Auty


Mike Auty  added the comment:

Sorry for the spam, thought I was in a different text box.  5:(

--
nosy: +ikelos
title: file_open unc -> Result of pathlib Path.resolve() with UNC path is not 
very useful

___
Python tracker 
<https://bugs.python.org/issue32442>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32442] file_open unc

2022-02-05 Thread Mike Auty


Change by Mike Auty :


--
title: Result of pathlib.Path.resolve() with UNC path is not very useful -> 
file_open unc

___
Python tracker 
<https://bugs.python.org/issue32442>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32658] Metacharacter (\) documentation suggestion

2022-01-21 Thread mike mcleod


mike mcleod  added the comment:

I would like to help with this issue. Is that acceptable?

--
nosy: +mikecmcleod

___
Python tracker 
<https://bugs.python.org/issue32658>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1521051] Allow passing DocTestRunner and DocTestCase in doctest

2022-01-21 Thread mike mcleod


mike mcleod  added the comment:

I would like to help on this issue.

--
nosy: +mikecmcleod

___
Python tracker 
<https://bugs.python.org/issue1521051>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10434] Document the rules for "public names"

2022-01-21 Thread mike mcleod


mike mcleod  added the comment:

I would like to help on this issue. Is there anyone available to push a PR 
through? If I make the changes.

--
nosy: +mikecmcleod

___
Python tracker 
<https://bugs.python.org/issue10434>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10202] ftplib doesn't check close status after sending file

2022-01-21 Thread mike mcleod


Change by mike mcleod :


--
keywords: +patch
pull_requests: +28934
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30747

___
Python tracker 
<https://bugs.python.org/issue10202>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10202] ftplib doesn't check close status after sending file

2022-01-15 Thread mike mcleod


mike mcleod  added the comment:

Working.. should be able to create pull request soon. Note part of suggestions 
include using SIOCOUTQ, but this does not have an equivalent for windows. And 
as Murphy's law goes this is likely to be where the problem is!

--

___
Python tracker 
<https://bugs.python.org/issue10202>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1

2022-01-14 Thread Mike Schiessl


Mike Schiessl  added the comment:

Yes, enforcing interval == 1 or interval == None (which pulls the 
TimedRotatingFileHandler class __init__ default value which is also 1) works 
perfectly with midnight.

I do not see any urge on that topic - as I personally now know the issue :D - 
but I really feel this fix could save someones else's time someday ;) 

So going the "safe" way via deprecation cycle seems to be the right approach

--

___
Python tracker 
<https://bugs.python.org/issue46377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1

2022-01-14 Thread Mike Schiessl


Mike Schiessl  added the comment:

i've just checked PR and you're right, something with the PR went wrong.

Anyway, midnight (at least from the wording) specifies the "atTime". (which 
should be midnight). 


Again, if there's (by mistake) an interval bigger than 1 set(which in my mind 
makes no sense along to be used with midnight) things are getting pretty 
intransparent. The midnight handler created a logfile dated with 2021-12-15 
(last night). Took me some time to get this sorted. (I've discovered, that I've 
set 30 in a default value file).

Agreed on the backward compatibility, but I would assume someone using 
"midnight" would not expect any other behavior than "daily at midnight" besides 
using the atTime to modify the rollover time. (my opinion)

--

___
Python tracker 
<https://bugs.python.org/issue46377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1

2022-01-14 Thread Mike Schiessl


New submission from Mike Schiessl :

Using the TimedRotatingFileHandler along with "when='midnight'" and interval > 
1, midnight is handled equally to "days" which is a little misleading.

Expectation:
setting when to 'midnight', the file is rotated every midnight (interval value 
should be ignored)

Current behavior:
If 'midnight' is given alongside with an interval greater than 1 (.e.g 5), the 
(internal) interval (24*60*60) is calculated with the given interval -> 
24*60*60 * 5.


In my case, this led to some unforeseeable and unexpected behavior.

--
components: Library (Lib)
messages: 410558
nosy: mschiess, vinay.sajip
priority: normal
severity: normal
status: open
title: TimedRotatingFileHandler "midnight" misleading when interval > 1
type: behavior
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Isn't TypeError built in?

2021-12-25 Thread Mike Dewhirst via Python-list
Thanks Peter ... the problem was all mine.Can't quite remember what it was 
exactly but I introduced a bug in my own code and it manifested down there in 
the bowels of the snake.I suppose that indicates a possible kink to be ironed 
out and if that interests you I am happy to retrace my steps and describe 
it.Fyi, there was nothing out of kilter in the machine. It was in production 
and is stable.CheersMike--(Unsigned mail from my phone)
 Original message From: "Peter J. Holzer"  
Date: 26/12/21  06:19  (GMT+10:00) To: python-list@python.org Subject: Re: 
Isn't TypeError built in? On 2021-12-13 12:22:28 +1100, Mike Dewhirst via 
Python-list wrote:> Obviously something is wrong elsewhere but I'm not sure 
where to look.> Ubuntu 20.04 with plenty of RAM.[...]> [Mon Dec 13 
01:15:49.885659 2021] [mpm_event:notice] [pid 1033:tid> 140446449658944] 
AH00489: Apache/2.4.41 (Ubuntu) SVN/1.13.0 OpenSSL/1.1.1f> mod_wsgi/4.6.8 
Python/3.8 configured -- resuming normal operations> [Mon Dec 13 
01:15:49.885664 2021] [core:notice] [pid 1033:tid> 140446449658944] AH00094: 
Command line: '/usr/sbin/apache2'> Exception ignored in: > Traceback (most recent call last):>   File 
"/usr/local/lib/python3.8/dist-packages/asgiref/local.py", line 96,> in 
__del__> NameError: name 'TypeError' is not definedDid you upgrade the OS 
recently and do you use virtual environents withmod_wsgi?"Impossible" errors 
like the above are common when the virtualenvironment was built with a 
different (older) version of the Pythoninterpreter than the one trying to use 
it. Nuking and rebuilding thevirtual environment is usually the quickest way to 
fix it.    hp--    _  | Peter J. Holzer    | Story must make more sense 
than reality.|_|_) |    || |   | h...@hjp.at |    -- 
Charles Stross, "Creative writing__/   | http://www.hjp.at/ |   
challenge!"-- https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24364] Not all defects pass through email policy

2021-12-24 Thread mike mcleod


mike mcleod  added the comment:

I would like to help with this issue.

--
nosy: +mikecmcleod

___
Python tracker 
<https://bugs.python.org/issue24364>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4849] instantiating and populating xml.dom.minidom.Element is cumbersome

2021-12-24 Thread mike mcleod


mike mcleod  added the comment:

I would like to help with this issue. I'm new to this space hence I am not 
aware of what patch review means.

--
nosy: +mikecmcleod

___
Python tracker 
<https://bugs.python.org/issue4849>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1284670] Allow to restrict ModuleFinder to get "direct" dependencies

2021-12-22 Thread mike mcleod


Change by mike mcleod :


--
pull_requests: +28450
pull_request: https://github.com/python/cpython/pull/30228

___
Python tracker 
<https://bugs.python.org/issue1284670>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10483] http.server - what is executable on Windows

2021-12-20 Thread mike mcleod


Change by mike mcleod :


--
pull_requests: +28437
pull_request: https://github.com/python/cpython/pull/30216

___
Python tracker 
<https://bugs.python.org/issue10483>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Isn't TypeError built in?

2021-12-13 Thread Mike Dewhirst via Python-list

On 13/12/2021 12:42 pm, Chris Angelico wrote:

On Mon, Dec 13, 2021 at 12:31 PM Mike Dewhirst via Python-list
  wrote:

Obviously something is wrong elsewhere but I'm not sure where to look.
Ubuntu 20.04 with plenty of RAM.

  def __del__(self):
  try:
  for context_obj in self._context_refs:
  try:
  delattr(context_obj, self._attr_name)
  except AttributeError:
  pass

  except TypeError:# THIS IS LINE 96 IN THE APACHE2 ERROR
LOG BELOW

  # WeakSet.__iter__ can crash when interpreter is shutting
down due
  # to _IterationGuard being None.
  pass

[Mon Dec 13 01:15:49.875993 2021] [mpm_event:notice] [pid 1033:tid
140446449658944] AH00493: SIGUSR1 received.  Doing graceful restart
[Mon Dec 13 01:15:49.878443 2021] [so:warn] [pid 1033] AH01574: module
dav_module is already loaded, skipping
[Mon Dec 13 01:15:49.885659 2021] [mpm_event:notice] [pid 1033:tid
140446449658944] AH00489: Apache/2.4.41 (Ubuntu) SVN/1.13.0
OpenSSL/1.1.1f mod_wsgi/4.6.8 Python/3.8 configured -- resuming normal
operations
[Mon Dec 13 01:15:49.885664 2021] [core:notice] [pid 1033:tid
140446449658944] AH00094: Command line: '/usr/sbin/apache2'
Exception ignored in: 
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/asgiref/local.py", line
96, in __del__
NameError: name 'TypeError' is not defined
Exception ignored in: 
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/asgiref/local.py", line
96, in __del__
NameError: name 'TypeError' is not defined

Any hints welcome ...

During interpreter shutdown, all kinds of things can go weird. The
order that things get destroyed isn't always clearly defined.

Is it possible to do the cleanup work before interpreter shutdown?
Alternatively: maybe take a local reference to the exception types you
need to refer to (just "AttributeError = AttributeError" at top level
should do it), which should keep them alive longer (I think). Worst
case, capture *all* exceptions, then look at e.__class__.__name__ and
match on that.

ChrisA


OK - not solved but resolved anyway.

The Django project was failing on the new server and working fine in dev.

The problem seems to be a mis-export from an old subversion repo.The 
project was being reconstituted on a new staging server from a reloaded 
svn dump from the old (ancient) svn server to the new svn server on the 
same machine.


Resolution "happened" when I updated the (c) notice in all source files 
and recommitted to the new server and re-exported from that. The repo 
looks fine. The log is all there back to the beginning. As a test I have 
deployed from an earlier revision and that all works. It's either a 
miracle or I did something else (which I didn't notice) which fixed it.


Thanks to everyone for thinking about this.

Cheers

Mike

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Isn't TypeError built in?

2021-12-12 Thread Mike Dewhirst via Python-list
Obviously something is wrong elsewhere but I'm not sure where to look. 
Ubuntu 20.04 with plenty of RAM.


    def __del__(self):
    try:
    for context_obj in self._context_refs:
    try:
    delattr(context_obj, self._attr_name)
    except AttributeError:
    pass

    except TypeError:        # THIS IS LINE 96 IN THE APACHE2 ERROR 
LOG BELOW


    # WeakSet.__iter__ can crash when interpreter is shutting 
down due

    # to _IterationGuard being None.
    pass

[Mon Dec 13 01:15:49.875993 2021] [mpm_event:notice] [pid 1033:tid 
140446449658944] AH00493: SIGUSR1 received.  Doing graceful restart
[Mon Dec 13 01:15:49.878443 2021] [so:warn] [pid 1033] AH01574: module 
dav_module is already loaded, skipping
[Mon Dec 13 01:15:49.885659 2021] [mpm_event:notice] [pid 1033:tid 
140446449658944] AH00489: Apache/2.4.41 (Ubuntu) SVN/1.13.0 
OpenSSL/1.1.1f mod_wsgi/4.6.8 Python/3.8 configured -- resuming normal 
operations
[Mon Dec 13 01:15:49.885664 2021] [core:notice] [pid 1033:tid 
140446449658944] AH00094: Command line: '/usr/sbin/apache2'

Exception ignored in: 
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/asgiref/local.py", line 
96, in __del__

NameError: name 'TypeError' is not defined
Exception ignored in: 
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/asgiref/local.py", line 
96, in __del__

NameError: name 'TypeError' is not defined

Any hints welcome ...

Thanks

Mike

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue10483] http.server - what is executable on Windows

2021-12-04 Thread mike mcleod


Change by mike mcleod :


--
keywords: +patch
pull_requests: +28141
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29624

___
Python tracker 
<https://bugs.python.org/issue10483>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1284670] Allow to restrict ModuleFinder to get "direct" dependencies

2021-12-01 Thread mike mcleod


mike mcleod  added the comment:

Minor fix after test.

--
Added file: https://bugs.python.org/file50467/2.html

___
Python tracker 
<https://bugs.python.org/issue1284670>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1284670] Allow to restrict ModuleFinder to get "direct" dependencies

2021-12-01 Thread mike mcleod

mike mcleod  added the comment:

I have made the changes as indicated in the diff files. I have tested against 
the latest from my GitHub copy.
The result is:
./python -m test -j0
== CPython 3.11.0a2+ (heads/main:3a91617590, Dec 1 2021, 15:11:41) [GCC 11.2.0]
== Linux-5.13.0-22-generic-x86_64-with-glibc2.34 little-endian
== cwd: /home/dougal/Documents/cpython/build/test_python_300237æ
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
...
0:01:34 load avg: 8.77 [221/430/1] test_modulefinder passed
== Tests result: FAILURE ==
409 tests OK.
1 test failed:
test_embed
20 tests skipped:
test_curses test_devpoll test_epoll test_ioctl test_kqueue
test_msilib test_ossaudiodev test_smtpnet test_socketserver
test_startfile test_tix test_tk test_ttk_guionly test_urllib2net
test_urllibnet test_winconsoleio test_winreg test_winsound
test_xmlrpc_net test_zipfile64
Total duration: 5 min 30 sec
Tests result: FAILURE

The first diff is attached. But there was a bug in the code and I will upload 
in next comment.

--
Added file: https://bugs.python.org/file50466/1.html

___
Python tracker 
<https://bugs.python.org/issue1284670>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10483] http.server - what is executable on Windows

2021-11-27 Thread mike mcleod


mike mcleod  added the comment:

I will work on this next week.

--

___
Python tracker 
<https://bugs.python.org/issue10483>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1284670] Allow to restrict ModuleFinder to get "direct" dependencies

2021-11-27 Thread mike mcleod


mike mcleod  added the comment:

Ok, I will work on this soon and make further comments.

--

___
Python tracker 
<https://bugs.python.org/issue1284670>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1284670] Allow to restrict ModuleFinder to get "direct" dependencies

2021-11-19 Thread mike mcleod

mike mcleod  added the comment:

I would like to help with this issue.

I note the history (using Git Dag) of the modulefinder.py shows that it has 
been modified with changes related here:

Author: Éric Araujo   2011-07-28 22:35:29
Committer: Éric Araujo   2011-07-28 22:35:29
Parent: 867754e3e3c907f87d1bb0282df628deb392cd62 (merge 11164)
Child:  cee6bb549946bb096aa380a49f3b11daf2d8713e (Fix bug I unwittingly added 
in 1521d9837d16 (found by Ezio Melotti))
Branches: main, remotes/origin/3.10, remotes/origin/3.6, remotes/origin/3.7, 
remotes/origin/3.8, remotes/origin/3.9, 
remotes/origin/bpo-45514/deprecate-importlib-resources-legacy, 
remotes/origin/buildbot-custom, remotes/origin/main, remotes/upstream/3.10, 
remotes/upstream/3.6, remotes/upstream/3.7, remotes/upstream/3.8, 
remotes/upstream/3.9, 
remotes/upstream/bpo-45514/deprecate-importlib-resources-legacy, 
remotes/upstream/buildbot-custom, remotes/upstream/main, 
remotes/upstream/windeepfreeze
Follows: v3.2.1
Precedes: v3.3.0a1

Modernize modulefinder module and tests a bit.

The tests don’t use an internal distutils function anymore, and use
regular assertEqual with sorted lists instead of a convoluted manual
diff.

and

Author: Éric Araujo   2011-08-01 14:29:07
Committer: Éric Araujo   2011-08-01 14:29:07
Parent: 1e3a68d36b08cd9d59084a37c8cb6c2d911868ce (Modernize modulefinder module 
and tests a bit.)
Child:  cb66eb0deca1d5cd232f97c76a215ecaab958d30 (Issue #13959: Deprecate 
imp.get_suffixes() for new attributes on)
Branches: main, remotes/origin/3.10, remotes/origin/3.6, remotes/origin/3.7, 
remotes/origin/3.8, remotes/origin/3.9, 
remotes/origin/bpo-45514/deprecate-importlib-resources-legacy, 
remotes/origin/buildbot-custom, remotes/origin/main, remotes/upstream/3.10, 
remotes/upstream/3.6, remotes/upstream/3.7, remotes/upstream/3.8, 
remotes/upstream/3.9, 
remotes/upstream/bpo-45514/deprecate-importlib-resources-legacy, 
remotes/upstream/buildbot-custom, remotes/upstream/main, 
remotes/upstream/windeepfreeze
Follows: v3.2.1
Precedes: v3.3.0a1

Fix bug I unwittingly added in 1521d9837d16 (found by Ezio Melotti)

And the modulefinder.py file has been subsequently modified by another 28 
changes.

So I am wondering if this issue is still relevant?

--
nosy: +mikecmcleod

___
Python tracker 
<https://bugs.python.org/issue1284670>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10483] http.server - what is executable on Windows

2021-11-18 Thread mike mcleod


mike mcleod  added the comment:

Hi Victor,

Ok I'll do that.

Regards,
Mike

On Thu, 18 Nov 2021 at 15:36, STINNER Victor  wrote:

>
> STINNER Victor  added the comment:
>
> I searched for open issues which contain "cgi" in their title. I found 43
> open issues. The oldest is 101 months ago.
>
> In 10 years, Lib/cgi.py got 43 commits. Only 13 commits in the last 5
> years (since 2016-01-01).
>
> It seems like the cgi module is not really maintained anymore. One option
> is to do nothing: I guess that the most basic features continue to work.
> Another option is to start deprecating all code related to CGI in the
> stdlib.
>
> While CGI is not "commonly" used, it seems like it remains popular for
> specific usages. So I don't think that it's time to deprecate it :-)
>
>
> > You can for sure make a pull request and see if a core dev will review
> and merge it
>
> Yep, just do that ;-) So far, nobody proposed a PR to fix this issue.
>
> --
>
> ___
> Python tracker 
> <https://bugs.python.org/issue10483>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue10483>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10202] ftplib doesn't check close status after sending file

2021-11-12 Thread mike mcleod


mike mcleod  added the comment:

I would like to help on this issue. I understand the arguments here but it has 
been a lone time since this was raised and there does not seem to be any 
further issues discussed or support for this issue.

--
nosy: +mikecmcleod

___
Python tracker 
<https://bugs.python.org/issue10202>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6669] TarFile.getmembers fails at struct.unpack: unpack requires a string argument of length 4

2021-11-12 Thread mike mcleod


mike mcleod  added the comment:

I would like to help with this issue.
I note that when I test against 3.10 this error does not show. Also, all tests 
for test_tarfile pass.
I am wondering if it may be reasonable to close this due to the age and 
currently its not an issue in the latest Python version.

--
nosy: +mikecmcleod

___
Python tracker 
<https://bugs.python.org/issue6669>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10483] http.server - what is executable on Windows

2021-11-10 Thread mike mcleod


mike mcleod  added the comment:

I have put the question on Discuss and wait for (any) responses,

--

___
Python tracker 
<https://bugs.python.org/issue10483>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21501] docs: mmap example for use in documentation

2021-11-10 Thread mike mcleod


mike mcleod  added the comment:

One of the things I did when the example code didn't work was to see what other 
examples could be found and there are I would argue plenty or just enough, eg:
https://medium.com/analytics-vidhya/memory-mapping-files-and-mmap-module-in-python-with-lot-of-examples-d1a9a45fe9a3
And google will fetch more if needed.
May I suggest back in 2014 when the issue was raised that this may have been a 
good example, but mmap is not so new and in the intervening time anybody who 
needed further examples simply googled them. Hence, I suggest its not needed.

--

___
Python tracker 
<https://bugs.python.org/issue21501>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21501] docs: mmap example for use in documentation

2021-11-10 Thread mike mcleod


mike mcleod  added the comment:

I would like to help with this issue.
I note that a few changes need to be made to the code example for compatibility 
for the latest version of Python. I can get this working but I am not sure this 
is a good example. Also, the example is more about threads and messaging 
between threads rather than mmap.
So my question is is this a good example?
And the suggestion of adding detailed explanation of the code, again, as to 
what it does not seem to be that relevant to mmap.

--
nosy: +mikecmcleod

___
Python tracker 
<https://bugs.python.org/issue21501>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10483] http.server - what is executable on Windows

2021-11-10 Thread mike mcleod


mike mcleod  added the comment:

Should I go ahead and make the changes as per msg122208 ? on my local copy and 
test?

--

___
Python tracker 
<https://bugs.python.org/issue10483>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2628] ftplib Persistent data connection

2021-11-02 Thread mike mcleod


mike mcleod  added the comment:

You're welcome.
Regards,
Mike

On Tue, 2 Nov 2021 at 05:52, Ethan Furman  wrote:

>
> Ethan Furman  added the comment:
>
> Ah.  Well, in that case closing seems like the best idea.
>
> Thank you, Jonathan, for getting the CLA signed and providing perspective.
>
> Thank you, Mike, for moving this issue forward.
>
> --
> resolution:  -> rejected
> stage: patch review -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> <https://bugs.python.org/issue2628>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue2628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10483] http.server - what is executable on Windows

2021-11-01 Thread mike mcleod

mike mcleod  added the comment:

Hi  Éric,

Then would the easiest way of dealing with this issue, to close it without
any further work?
Possibly adding to the documents it doesn't work on windows..
I can move to the next issue.

Regards,
Mike

On Sun, 31 Oct 2021 at 18:03, Éric Araujo  wrote:

>
> Éric Araujo  added the comment:
>
> I don’t know if CGI on windows servers is very relevant nowadays.
>
> --
> nosy: +eric.araujo
> versions:  -Python 3.2
>
> ___
> Python tracker 
> <https://bugs.python.org/issue10483>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue10483>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2628] ftplib Persistent data connection

2021-11-01 Thread mike mcleod


mike mcleod  added the comment:

I am happy to do any testing.
My reason for getting involved is I am new to helping with Cpython and thought 
this may be the least intrusive way of getting started with something that 
nobody really cares about that much.
Hence, the oldest issue I see can be either completed as first envisioned or 
can be closed and I am ok with either.

--

___
Python tracker 
<https://bugs.python.org/issue2628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10483] http.server - what is executable on Windows

2021-10-31 Thread mike mcleod


mike mcleod  added the comment:

Hi,
I would like to help on this issue.
Let me know what can be done?

--
nosy: +mikecmcleod

___
Python tracker 
<https://bugs.python.org/issue10483>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2628] ftplib Persistent data connection

2021-10-26 Thread mike mcleod


mike mcleod  added the comment:

Hi Ethan,

Thanks, awaiting reply..

Regards,
Mike

On Tue, 26 Oct 2021 at 01:36, Ethan Furman  wrote:

>
> Ethan Furman  added the comment:
>
> We don't have a CLA from jbell.  I've sent an email asking him to do so...
> we'll see what happens.
>
> --
> nosy: +ethan.furman
>
> ___
> Python tracker 
> <https://bugs.python.org/issue2628>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue2628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2628] ftplib Persistent data connection

2021-10-24 Thread mike mcleod


mike mcleod  added the comment:

Hi,

I would like to help on this issue.

--
nosy: +mikecmcleod

___
Python tracker 
<https://bugs.python.org/issue2628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   4   5   6   7   8   9   10   >