Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-03-28 Thread Dieter Maurer
lucas wrote at 2021-3-27 18:53 +0100:
>Following our previous discussion:
> https://www.talkend.net/post/287193.html
>
>I finally took time (thanks to Florian R.) to get a reproducible example
>of my problem, as asked previously by ChrisA.

I compared `xmlrpc.client.ServerProxy.__init__`
for Python 3.6 and Python 3.9(a5):
Python 3.6 uses `splittype` and `splithost` to parse *uri*
while Python 3.9 uses `urlparse` to complete decompose *uri*
and then uses `scheme`, `netloc` and `path` from the result.
As a consequence Python 3.9 misses any information in the "query string".

In my view, Python 3.6 behaves as documented (in the `ServerProxy` "docstring")
while Python 3.9 does not. At your place, I would file a bug
report at "https://bugs.python.org/";.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Code Formatter Questions

2021-03-28 Thread Cameron Simpson
On 28Mar2021 15:42, Travis Griggs  wrote:
>I've been looking into using a code formatter as a code base size has grown as 
>well as contributing developers. I've found and played with autopep, black, 
>and yapf. As well as whatever pycharm has (which may just be gui preferences 
>around one of those 3).
>2) I use more and type annotations (at least at the trivial level). But 
>I like to have variable annotations tightly bound to the identifier, 
>kind of like a subscript. So I want to see
>
>  def foo_bar(baz:int) -> bool:
>yak:str = 'howdy mates'
>
>And NOT
>
>  def foo_bar(baz: int) -> bool:
>yak: str = 'howdy mates'
>
>In other cases though (dictionaries for example), I'm fine with (and prefer) 
>the spacing.
>
>Is there anyway to make any of these formatters do this?

yapf has many tunings. Worth a look. It is my preferred formatter. By 
comparison, black is both opinionated and has basicly no tuning, 
something I greatly dislike.

>We write a lot of Swift and Kotlin as well as which uses the same 
>general syntax (identifier:Type) for type annotation, and we'd like to 
>have some consistency across the styles (we pack the couplets in those 
>two).

Then you probably want a more tunable formatter in each of these cases, 
raising the odds of formatting in your preferred style.

Finally, you could consider post processing formatted code if some 
specific tuning isn't what you want. (Or patch yapf to add the tuning, 
maybe.)

For example, if some formatter gets you 95% if the way there, maybe you 
can apply your type annotation special case with a simpler tool (eg, for 
me, sed) since you can have more confidence in the physical code layout 
and therefore less need to have a deep understanding of the syntax in 
the post process step.

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


Re: Code Formatter Questions

2021-03-28 Thread dn via Python-list
On 29/03/2021 04.42, Travis Griggs wrote:
> I've been looking into using a code formatter as a code base size has grown 
> as well as contributing developers. I've found and played with autopep, 
> black, and yapf. As well as whatever pycharm has (which may just be gui 
> preferences around one of those 3).
> 
> I have 2 questions:
> 1) Are there any major other formatters that I can/should look at? I see some 
> "online" pretty printers, but I'm after something I can run on whole 
> recursive directories of code.
> 
> 2) I use more and type annotations (at least at the trivial level). But I 
> like to have variable annotations tightly bound to the identifier, kind of 
> like a subscript. So I want to see 
> 
>   def foo_bar(baz:int) -> bool:
> yak:str = 'howdy mates'
> 
> And NOT 
> 
>   def foo_bar(baz: int) -> bool:
> yak: str = 'howdy mates'
> 
> In other cases though (dictionaries for example), I'm fine with (and prefer) 
> the spacing.
> 
> Is there anyway to make any of these formatters do this?
> 
> We write a lot of Swift and Kotlin as well as which uses the same general 
> syntax (identifier:Type) for type annotation, and we'd like to have some 
> consistency across the styles (we pack the couplets in those two).


Like you, I've found the ability to add such functionality to PyCharm,
VS-Codium, SublimeText (and others) useful. Such has undoubtedly
improved code-presentation.

However, there will always be differences in what I like to see, and
anyone/everyone else. Because I'm used to working in multiple
human-language/cultures, I extend similar courtesies and 'survival
tactics' into the coding world. If we're working-together and you
prefer/demand something be done in a particular way, ...

This is one reason why I like competent editor software. Let's take the
spaces/tab debate. (No, not an invitation to start that again!) It is
solved very quickly by the use of my editor's command to convert one
into the other. QED, and any frustration/anger/objections dissipate!


Sadly PyCharm is not on this machine. However, if memory serves, I have
it set-up to run checks across the entire project at every git-commit.
Any 'failures' are then reported and can either be accepted or the
commit postponed until such time as compliance with the machine's
bidding is achieved. (this may not be exactly what Q1 requires)


In some checkers (wish I could remember which), it is possible to turn
'off' certain 'complaints'. For example

def foo_bar ( baz:int ) -> bool:

might attract criticisms for the spaces outside the parentheses AND for
those immediately-inside. I agree with the former, but turn-off the
latter warning/grumble/complaint/reminder (because the inner-spaces aid
my ageing eyes).

Sadly, this informing of questionable/erroneous-formatting is somewhat
the opposite of your asking for something to *perform* a re-format.


Additionally, Q2 may require an ability to add rules to the checker.
I've not looked at such, but comments in "Auto formatters for Python"
(https://www.kevinpeters.net/auto-formatters-for-python) use phrases
such as "The tool will also do small additional checks" and
"configurable in a lot of ways" - which may/not coincide with the Qs.


Bulk re-formatting implies risk - unless you also have 100% 'bulk' and
automated testing!


Moving from one language to another can play mind-games with us. What
makes sense in one; may be right, OK, or possibly even plain-wrong, in
another. For (obvious) example, Python is unusual in that (in some
places) horizontal-spacing is a part of the language, but quite optional
in others. Accordingly, trying to generalise horizontal-formatting is
probably creating hoops-to-jump-through. Such may have been worthy of a
stereotypical (and much vilified) 1960s civil service; but not of
someone with expertise in modern programming languages. Embrace diversity!
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: firewall in python

2021-03-28 Thread Michael Torrie
On 3/28/21 12:33 PM, Quentin Bock wrote:
> Is it possible to create a firewall inside python and then run that instead
> of the windows defender firewall? If so how would that work or how would
> that be made?

Probably not.  The firewall is part of the kernel since it works
directly with the network drivers and the packets in memory (to avoid
copying data).  MS has an API for interacting with it, and controlling
and extending its behavior using an API:
https://docs.microsoft.com/en-us/windows-hardware/drivers/network/windows-filtering-platform-architecture-overview

This is what third-party firewall managers use.

Possibly Python could interact with portions of the firewall engine via
the callout API.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Code Formatter Questions

2021-03-28 Thread Skip Montanaro
> 1) Are there any major other formatters that I can/should look at? I see some 
> "online" pretty printers, but I'm after something I can run on whole 
> recursive directories of code.

I use Emacs, so I'm kind of biased, but I find its python-mode does a
good job, good enough that I wouldn't use a batch formatter to conform
to some other conventions, then wind up having a mixed set of
conventions after my next edit. I presume vim and all IDEs worth their
salt also do a suitable job of formatting code on-the-fly.

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


firewall in python

2021-03-28 Thread Quentin Bock
Is it possible to create a firewall inside python and then run that instead
of the windows defender firewall? If so how would that work or how would
that be made?
Thanks :)


Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python documentation

2021-03-28 Thread Michael Torrie
On 3/28/21 12:28 PM, Michael Torrie wrote:
> You want to use an obsolete version of Python and an obsolete version of
> Qt.  That's totally fine!  But why are you angry when people, who are
> strictly volunteers, are unable to help much here other than to strongly
> recommend you reconsider?

Oops. You weren't ever asking for help.  My bad.

However there was understandable push back to documenting and promoting
an obsolete distribution of Python 2 (and Qt4 no less!) to new users.
Definitely not something the documentation should be doing.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python documentation

2021-03-28 Thread Michael Torrie
On 3/27/21 1:02 PM, pyt...@blackward.eu wrote:
> You say: "The point is that there are those who use Python 2 and
> don't want to move to Python 3, claiming that it's easier to switch
> from Python 2 to some other language than from Python 2 to Python 3.
> That's what seems questionable." And I say, forcing people to do
> things they do not want to do is a little more questionable. There
> are reasons, why people "don't want to move to Python 3".
Sorry but that's not the way it works.  No one forces anyone to use
Python.  And no one forces anyone to move to Python 3.  But Python 2 is
not supported any longer, and you're on your own.  Plain and simple.
This is no different than if you chose to stay with, for example, an
obsolete version of some proprietary software package.  Lots of VB6
users out there still, but you can't seriously expect MS support or
official VB forums to be able to provided assistance do you?

You want to use an obsolete version of Python and an obsolete version of
Qt.  That's totally fine!  But why are you angry when people, who are
strictly volunteers, are unable to help much here other than to strongly
recommend you reconsider?

> Maybe you should concentrate more on developing 
> Python 3 a little more attractive then in burning witches?

And indeed Python 3 is a very attractive platform to move to!

> But for my part, this discussion is ended, it does not lead to anything. 
> At least in this point I agree with Chris.

Yes many new posters seem to come along and end up in this rut.  The
lack of emotional subtext in a mailing list doesn't help communication I
admit. I've been in your shoes before and I know how frustrating it can
be to not get the answers I want to hear, but I have to admit my own
attitude determined the outcome of some of the more frustrating
exchanges I've been a part of.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Code Formatter Questions

2021-03-28 Thread Paul Bryan
On Sun, 2021-03-28 at 15:42 +, Travis Griggs wrote:
> I've been looking into using a code formatter as a code base size has
> grown as well as contributing developers. I've found and played with
> autopep, black, and yapf. As well as whatever pycharm has (which may
> just be gui preferences around one of those 3).
> 
> I have 2 questions:
> 1) Are there any major other formatters that I can/should look at? I
> see some "online" pretty printers, but I'm after something I can run
> on whole recursive directories of code.

I assume you mean autopep8. I'm not aware of any other currently
popular formatters. 

> 2) I use more and type annotations (at least at the trivial level).
> But I like to have variable annotations tightly bound to the
> identifier, kind of like a subscript. So I want to see 
> 
>   def foo_bar(baz:int) -> bool:
>     yak:str = 'howdy mates'
> 
> And NOT 
> 
>   def foo_bar(baz: int) -> bool:
>     yak: str = 'howdy mates'
> 
> In other cases though (dictionaries for example), I'm fine with (and
> prefer) the spacing.
> 
> Is there anyway to make any of these formatters do this?

Formatters are typically strongly opinionated (autopep8 being an
exception), so I think you'll be going against the grain by trying to
make exceptions. I suggest accepting their opinions (pick the formatter
that most closely aligns with your taste), or, if you can make a case
for general use, suggest/request one change their opinions.

Paul

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


Code Formatter Questions

2021-03-28 Thread Travis Griggs
I've been looking into using a code formatter as a code base size has grown as 
well as contributing developers. I've found and played with autopep, black, and 
yapf. As well as whatever pycharm has (which may just be gui preferences around 
one of those 3).

I have 2 questions:
1) Are there any major other formatters that I can/should look at? I see some 
"online" pretty printers, but I'm after something I can run on whole recursive 
directories of code.

2) I use more and type annotations (at least at the trivial level). But I like 
to have variable annotations tightly bound to the identifier, kind of like a 
subscript. So I want to see 

  def foo_bar(baz:int) -> bool:
yak:str = 'howdy mates'

And NOT 

  def foo_bar(baz: int) -> bool:
yak: str = 'howdy mates'

In other cases though (dictionaries for example), I'm fine with (and prefer) 
the spacing.

Is there anyway to make any of these formatters do this?

We write a lot of Swift and Kotlin as well as which uses the same general 
syntax (identifier:Type) for type annotation, and we'd like to have some 
consistency across the styles (we pack the couplets in those two).


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


Re: i am getting the following error code while trying to reinstall pip

2021-03-28 Thread Igor Korot
Hi,



On Sun, Mar 28, 2021, 9:29 AM ACE 012  wrote:

> ValueError: bad marshal data (digit out of range in long)
>

Why do you need to re-install it?
What was wrong?

Thank you.

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


i am getting the following error code while trying to reinstall pip

2021-03-28 Thread ACE 012
ValueError: bad marshal data (digit out of range in long)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-03-28 Thread Terry Reedy

On 3/27/2021 6:10 PM, lucas wrote:


I hope it will solve it too. Do i need to do anything ?


Review the patch by trying it out on your system.  If necessary because 
you do not have a local cpython clone, backup installed 3.9 
Lib/xmlrpc.py and hand-edit. Then report OS, python used, and result. 
(If it works, you can keep the patched version ;-).


For many issues, reviews are the bottleneck for getting fixes released.

--
Terry Jan Reedy

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


Re: Help Please

2021-03-28 Thread D'Arcy Cain

On 2021-03-26 12:42 p.m., Igor Korot wrote:

On top of that - usual stanza applies:

1. OS - Windows, Linux, Mac?
2. OS version?
3. Python version?
4. Are you able to run python interpretor?
5. Socks version you are trying to install?
6. Was install successful?


7. Use a subject that describes the actual issue.

--
D'Arcy J.M. Cain
Vybe Networks Inc.
A unit of Excelsior Solutions Corporation - Propelling Business Forward
http://www.VybeNetworks.com/
IM:da...@vybenetworks.com VoIP: sip:da...@vybenetworks.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-03-28 Thread Chris Angelico
On Sun, Mar 28, 2021 at 9:12 AM lucas  wrote:
>
> Thank you ChrisA !
>
> I hope it will solve it too. Do i need to do anything ?
>
> Thank you for your time and help.
>

There are a couple of things you can do actually! First off, here's
the pull request, which will be where further comments happen:

https://github.com/python/cpython/pull/25045

Since you actually use xmlrpc, you'd be the best person to devise some
useful tests. Also, the question has been raised regarding the
fragment. I suspect that a fragment is inappropriate here, since it's
effectively an external URL, but that's for you to answer; if
fragments are to be stripped, that definitely needs to be mentioned.

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