Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-10 Thread Albert-Jan Roskam via Python-list
On Mar 10, 2024 12:59, Thomas Passin via Python-list wrote: On 3/10/2024 6:17 AM, Barry wrote: > > >> On 8 Mar 2024, at 23:19, Thomas Passin via Python-list wrote: >> >> We just learned a few posts back that it might be specific to Linux; I ran it

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Albert-Jan Roskam via Python-list
On Mar 8, 2024 19:35, Thomas Passin via Python-list wrote: On 3/8/2024 1:03 PM, Albert-Jan Roskam via Python-list wrote: > Hi, > I was replacing some os.path stuff with Pathlib and I discovered this: > Path(256 * "x").i

pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Albert-Jan Roskam via Python-list
Hi, I was replacing some os.path stuff with Pathlib and I discovered this: Path(256 * "x").is_file() # OSError os.path.isfile(256 * "x") # bool Is this intended? Does pathlib try to resemble os.path as closely as possible? Best wishes,

Re: Postgresql equivalent of Python's timeit?

2023-09-17 Thread Albert-Jan Roskam via Python-list
On Sep 15, 2023 19:45, "Peter J. Holzer via Python-list" wrote: On 2023-09-15 17:42:06 +0200, Albert-Jan Roskam via Python-list wrote: >    This is more related to Postgresql than to Python, I hope this is ok. >    I want to measure Postgres queries N

Postgresql equivalent of Python's timeit?

2023-09-15 Thread Albert-Jan Roskam via Python-list
in the times. Is there a timeit-like function in Postgresql? Thanks! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: Passing info to function used in re.sub

2023-09-05 Thread Jan Erik Moström via Python-list
On 3 Sep 2023, at 18:10, Jan Erik Moström via Python-list wrote: > I'm looking for some advice for how to write this in a clean way Thanks for all the suggestion, I realize that I haven't written Python code in a while. I should have remembered this myself !!! Thanks for reminding me. =

Re: Passing info to function used in re.sub

2023-09-03 Thread Jan Erik Moström via Python-list
On 3 Sep 2023, at 19:13, MRAB via Python-list wrote: > You could use pass an anonymous function (a lambda) to re.sub: Of course !! Thanks. = jem -- https://mail.python.org/mailman/listinfo/python-list

Passing info to function used in re.sub

2023-09-03 Thread Jan Erik Moström via Python-list
I'm looking for some advice for how to write this in a clean way I want to replace some text using a regex-pattern, but before creating replacement text I need to some file checking/copying etc. My code right now look something like this: def fix_stuff(m): # Do various things that

[Python-announce] unittest_expander 0.4.4 released

2023-03-21 Thread Jan Kaliszewski
pander library provides. Homepage: https://github.com/zuo/unittest_expander PyPI: https://pypi.org/project/unittest-expander/ Documentation: https://unittest-expander.readthedocs.io/en/stable/ Cheers, Jan Kaliszewski (zuo) z...@kaliszewski.net ___

[Python-announce] unittest_expander 0.4.3 released

2023-03-20 Thread Jan Kaliszewski
ovides. Homepage: https://github.com/zuo/unittest_expander PyPI: https://pypi.org/project/unittest-expander/ Documentation: https://unittest-expander.readthedocs.io/en/stable/ Cheers, Jan Kaliszewski (zuo) ___ Python-announce-list mailing list -- python-an

[Python-announce] unittest_expander 0.4.0 released

2023-03-16 Thread Jan Kaliszewski
pander/ Documentation: https://unittest-expander.readthedocs.io/en/stable/ Cheers, Jan Kaliszewski (zuo) https://unittest-expander.readthedocs.io/en/stable/;>unittest_expander 0.4.0 - a library that provides flexible and easy-to-use tools to parametrize Python unit tests. (

RE: Python installation not full and python not working 3.11.0

2023-03-10 Thread Jan Vasko
.0 (full 64bit installer from python.org) * Downloaded from: Python Release Python 3.11.0 | Python.org<https://www.python.org/downloads/release/python-3110/> cmd: [cid:image006.png@01D953B0.4E12E170] This is resulting that I cannot use interpreter in VS Code and continue development. Any o

Re: LRU cache

2023-02-18 Thread Albert-Jan Roskam
On Feb 18, 2023 17:28, Rob Cliffe via Python-list wrote: On 18/02/2023 15:29, Thomas Passin wrote: > On 2/18/2023 5:38 AM, Albert-Jan Roskam wrote: >>     I sometimes use this trick, which I learnt from a book by Martelli. >>     Instead of try/exc

Re: LRU cache

2023-02-18 Thread Albert-Jan Roskam
:         _cache.pop()     try:         return _cache[arg]     except KeyError:         result = expensivefunc(arg)         _cache[arg] = result         return result Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: Fast lookup of bulky "table"

2023-01-16 Thread Albert-Jan Roskam
On Jan 15, 2023 05:26, Dino wrote: Hello, I have built a PoC service in Python Flask for my work, and - now that the point is made - I need to make it a little more performant (to be honest, chances are that someone else will pick up from where I left off, and implement

Re: How to enter escape character in a positional string argument from the command line?

2022-12-21 Thread Albert-Jan Roskam
On Dec 21, 2022 06:01, Chris Angelico wrote: On Wed, 21 Dec 2022 at 15:28, Jach Feng wrote: > That's what I am taking this path under Windows now, the ultimate solution before Windows has shell similar to bash:-) Technically, Windows DOES have a shell similar to bash.

Re: Keeping a list of records with named fields that can be updated

2022-12-17 Thread Albert-Jan Roskam
On Dec 15, 2022 10:21, Peter Otten <__pete...@web.de> wrote: >>> from collections import namedtuple >>> Row = namedtuple("Row", "foo bar baz") >>> row = Row(1, 2, 3) >>> row._replace(bar=42) Row(foo=1, bar=42, baz=3) Ahh, I always thought these are

Re: Yaml.unsafe_load error

2022-10-19 Thread Albert-Jan Roskam
On Oct 19, 2022 13:02, Albert-Jan Roskam wrote:    Hi,    I am trying to create a celery.schedules.crontab object from an external    yaml file. I can successfully create an instance from a dummy class "Bar",    but the crontab class seems call __setsta

Yaml.unsafe_load error

2022-10-19 Thread Albert-Jan Roskam
code below. Thanks! Albert-Jan Python 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import yaml >>> f

Re: Find the path of a shell command

2022-10-14 Thread Albert-Jan Roskam
On Oct 14, 2022 18:19, "Peter J. Holzer" wrote: On 2022-10-14 07:40:14 -0700, Dan Stromberg wrote: > Alternatively, you can "ps axfwwe" (on Linux) to see environment > variables, and check what the environment of cron (or similar) is.  It > is this environment (mostly)

Re: python developer

2022-10-03 Thread Jan van den Broek
2022-10-01, orzodk schrieb: > Jan van den Broek writes: > >> 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 re

Re: python developer

2022-10-01 Thread Jan van den Broek
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 Broek balgl...@dds.nl --

Re: python developer

2022-09-30 Thread Jan van den Broek
2022-09-29, Mike Dewhirst schrieb: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) Why? [Schnipp] -- Jan v/d Broek balgl...@dds.nl -- https://mail.python.org/mailman/listinfo/python-list

Book/resource recommendation about Celery?

2022-09-15 Thread Albert-Jan Roskam
Hi, I'm using Flask + Celery + RabbitMQ. Can anyone recommend a good book or other resource about Celery?  Thanks! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Fwd:

2022-09-09 Thread Jan Poort
error by starting up windows 10 i get this message -- Forwarded message - Van: Jan Poort Date: do 8 sep. 2022 om 15:49 Subject: To: -- *Jan Poort* -- https://mail.python.org/mailman/listinfo/python-list

Re: Register multiple excepthooks?

2022-08-04 Thread Albert-Jan Roskam
On Aug 1, 2022 19:34, Dieter Maurer wrote: Albert-Jan Roskam wrote at 2022-7-31 11:39 +0200: >   I have a function init_logging.log_uncaught_errors() that I use for >   sys.excepthook. Now I also want to call another function (ffi.dlclose()) >   upon

Register multiple excepthooks?

2022-07-31 Thread Albert-Jan Roskam
log_uncaught_errors() so it does both things? Thanks! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

What's up with modern Python programmers rewriting everything in Rust?

2022-06-20 Thread jan Anja via Python-list
Dude, it's called CPython for a reason. -- https://mail.python.org/mailman/listinfo/python-list

Re: new sorting algorithm

2022-05-02 Thread jan via Python-list
fix this pathology? cheers jan On 02/05/2022, Chris Angelico wrote: > On Mon, 2 May 2022 at 09:20, Dan Stromberg wrote: >> >> >> On Sun, May 1, 2022 at 1:44 PM Chris Angelico wrote: >>> >>> On Mon, 2 May 2022 at 06:43, Dan Stromberg wrote: >>> > On Su

Re: Style for docstring

2022-04-23 Thread jan via Python-list
"return true iff this". I like this. jan On 23/04/2022, Stefan Ram wrote: > Rob Cliffe writes: >>I'm curious as to why so many people prefer "Return" to "Returns". > > The commands, er, names of functions, use the imperative mood >

Re: Tuple unpacking inside lambda expressions

2022-04-20 Thread Albert-Jan Roskam
On Apr 20, 2022 13:01, Sam Ezeh wrote: I went back to the code recently and I remembered what the problem was. I was using multiprocessing.Pool.pmap which takes a callable (the lambda here) so I wasn't able to use comprehensions or starmap Is there anything for

Re: flask app convert sql query to python plotly.

2022-04-04 Thread Albert-Jan Roskam
On Apr 2, 2022 20:50, Abdellah ALAOUI ISMAILI wrote: i would like to convert in my flask app an SQL query to an plotly pie chart using pandas. this is my code : def query_tickets_status() :     query_result = pd.read_sql ("""     SELECT

Fwd: dict.get_deep()

2022-04-04 Thread Albert-Jan Roskam
-- Forwarded message -- From: Marco Sulla Date: Apr 2, 2022 22:44 Subject: dict.get_deep() To: Python List <> Cc: A proposal. Very often dict are used as a deeply nested carrier of data, usually decoded from JSON. 

Marshmallow: json-to-schema helper?

2022-04-04 Thread Albert-Jan Roskam
://marshmallow.readthedocs.io/en/stable/api_reference.html#marshmallow.Schema.from_dict https://docs.python.org/3/library/inspect.html#inspect.getsource Thanks! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

[issue47161] pathlib method relative_to doesnt work with // in paths

2022-03-30 Thread Jan Bronicki
Jan Bronicki added the comment: Hmm..., I get it, but Im not gonna lie it's pretty confusing given that in other places `//` works as a substitute for `/`. Maybe it should be mentioned in the documentation? -- ___ Python tracker <ht

[issue47161] pathlib method relative_to doesnt work with // in paths

2022-03-30 Thread Jan Bronicki
Jan Bronicki added the comment: But shouldn't it just work with `//` as a `/`? It seems like this is the behavior elsewhere. Sure I get that it cannot be done for 3.8. But the new error message implies that either `//` is not a subpath of `/` which it is, or that one is relative

[issue47161] pathlib method relative_to doesnt work with // in paths

2022-03-30 Thread Jan Bronicki
New submission from Jan Bronicki : The `//` path should be equivalent to `/`, and in some ways, it does behave like that in pathlib. But in the `relative_to` method on a `Path` object, it does not work This is causing our CI pipeline to fail. In the documentation here you can see `//` being

Re: SQLAlchemy: JSON vs. PickleType vs. raw string for serialised data

2022-02-28 Thread Albert-Jan Roskam
On Feb 28, 2022 10:11, Loris Bennett wrote: Hi, I have an SQLAlchemy class for an event:   class UserEvent(Base):   __tablename__ = "user_events"   id = Column('id', Integer, primary_key=True)   date = Column('date', Date, nullable=False)  

Re: One-liner to merge lists?

2022-02-25 Thread Albert-Jan Roskam
If you don't like the idea of 'adding' strings you can 'concat'enate: >>> items = [[1,2,3], [4,5], [6]] >>> functools.reduce(operator.concat, items) [1, 2, 3, 4, 5, 6] >>> functools.reduce(operator.iconcat, items, []) [1, 2, 3, 4, 5, 6] The latter is the

Re: Long running process - how to speed up?

2022-02-19 Thread Albert-Jan Roskam
On Feb 19, 2022 12:28, Shaozhong SHI wrote: I have a cvs file of 932956 row and have to have time.sleep in a Python script.  It takes a long time to process. How can I speed up the processing?  Can I do multi-processing? Perhaps a dask df: 

Re: Error installing requirements

2022-02-19 Thread Albert-Jan Roskam
On Feb 18, 2022 08:23, Saruni David wrote: >> Christian Gohlke's site has a Pillow .whl for python 2.7: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow -- https://mail.python.org/mailman/listinfo/python-list

Re: Pypy with Cython

2022-02-03 Thread Albert-Jan Roskam
On Feb 3, 2022 17:01, Dan Stromberg wrote: > The best answer to "is this slower on > Pypy" is probably to measure. > Sometimes it makes sense to rewrite C > extension modules in pure python for pypy. Hi Dan, thanks. What profiler do you recommend I normally

Pypy with Cython

2022-02-03 Thread Albert-Jan Roskam
of the program (e.g a modulo 11 digit check) are implemented in Cython. Should I use pure Python instead when using Pypy? I compiled the Cython modules for pypy and they work, but I'm afraid they might just slow things down. Thanks! Albert-Jan -- https://mail.python.org/mailman/listinfo/python

Re: Waht do you think about my repeated_timer class

2022-02-03 Thread Albert-Jan Roskam
On Feb 2, 2022 23:31, Barry wrote: > On 2 Feb 2022, at 21:12, Marco Sulla wrote: > > You could add a __del__ that calls stop :) Didn't python3 make this non deterministic when del is called? I thought the recommendation is to not rely on __del__ in python3

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

2022-01-08 Thread Albert-Jan Roskam
to easily set the transfer encoding to gzip Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

[issue46270] Comparison operators in Python Tutorial 5.7

2022-01-06 Thread Jan
Jan added the comment: Sounds reasonable. -- resolution: works for me -> fixed ___ Python tracker <https://bugs.python.org/issue46270> ___ ___ Python-bugs-lis

[issue46270] Comparison operators in Python Tutorial 5.7

2022-01-05 Thread Jan
Jan added the comment: I really like this solution because it mentions the buzz word "membership". But I would change "container" to "sequence" because the term "container" doesn't appear in chapter 5, "sequence" on the other hand multi

[issue46270] Comparison operators in Python Tutorial 5.7

2022-01-05 Thread Jan
New submission from Jan : In chapter 5.7 in the official Python tutorial (see: https://docs.python.org/3/tutorial/datastructures.html), there is the following paragraph: "The comparison operators in and not in check whether a value occurs (does not occur) in a sequence. The oper

[issue41945] http.cookies.SimpleCookie.parse error after [keys] or some JSON data values

2022-01-04 Thread Jan Novak
Jan Novak added the comment: New examples with the structured data. Problems are with quotes and spaces inside { or [ cookie-script.com set those cookie data: CookieScriptConsent={"action":"accept","categories":"[\\"performance\\"]"} Py

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Jan Novak
Jan Novak added the comment: It is interesting that pathlib.Path works fine: >>> pathlib.Path('jpg').suffix '.jpg' >>> pathlib.Path('path/jpg').suffix '.jpg' -- ___ Python tracker <https://bugs.

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Jan Novak
Jan Novak added the comment: Thank you all for discussion and partial solution in latest Python versions and extending documentation. For the future development of Python the initial question remains. How to easy detect extensions for each file with standard python library function. Without

Re: Call julia from Python: which package?

2021-12-21 Thread Albert-Jan Roskam
this Julia/Python interaction might work. The little bit of experience with Julia more or less coincides with what Oscar mentioned: a lot of "warm up" time. This is actually a py2.7 project that I inherited. I was asked to convert it to py3.8. Thanks and merry xmas!

Call julia from Python: which package?

2021-12-17 Thread Albert-Jan Roskam
# * https://pypi.org/project/juliacall/ * https://github.com/JuliaPy/PyCall.jl Thanks in advance! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs

2021-12-12 Thread Jan Kaliszewski
Jan Kaliszewski added the comment: Sure. But don't you think there should be ``.__get__(a, type(a))`` rather than ``.__get__(a, A)``? Then the whole statement would be true regardless of whether A is the actual type of a, or only a superclass of the type of a. That would also be more

[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs

2021-12-07 Thread Jan Kaliszewski
Jan Kaliszewski added the comment: I am very sorry, I just noticed another mistake. It should be: A dotted lookup such as ``super(A, obj).x`` (where ``obj`` is an instance of ``A`` or of a subclass of ``A``) searches ``type(obj).__mro__`` for such a base class ``B`` that follows

[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs

2021-12-07 Thread Jan Kaliszewski
Jan Kaliszewski added the comment: Sorry, a few mistakes distorted my proposal. It should be: A dotted lookup such as ``super(A, obj).x`` (where ``obj`` is an instance of ``A`` or of a subclass of ``A``) searches ``A.__mro__`` for a base class whose `__dict__` contains name ``&q

[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs

2021-12-07 Thread Jan Kaliszewski
Jan Kaliszewski added the comment: So the current (after the aforementioned commit) form of the description is: A dotted lookup such as ``super(A, a).x`` searches ``obj.__class__.__mro__`` for a base class ``B`` following ``A`` and then returns ``B.__dict__['x'].__get__

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Albert-Jan Roskam
> df['URL'] = df.apply(lambda x: connect(df['URL']), axis=1) I think you need axis=0. Or use the Series, df['URL'] = df.URL.apply(connect) -- https://mail.python.org/mailman/listinfo/python-list

Ansible, pip and virtualenv

2021-10-31 Thread Albert-Jan Roskam
in advance! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

[issue45505] Remove unneeded ZipFile IO

2021-10-17 Thread Jan Wolski
New submission from Jan Wolski : Currently in the ZipFile class implementation, when processing the zip file headers "extra" field, a .read() call is used without using the returned value in any way. This call could be replaced with a .seek() to avoid actually doing the IO. The ch

[issue34897] distutils test errors when CXX is not set

2021-10-14 Thread Jan Pieczkowski
Jan Pieczkowski added the comment: This issue also still affects Python versions 3.6.15 and 3.7.12 IMHO it would make sense to backport this patch to the 3.6 and 3.7 branches, especially as it only affects one line of code and doesn't seem to affect anything else, but solves the same issue

[issue45031] [Windows] datetime.fromtimestamp(t) when t = 253402210800 fails on Python 3.8

2021-08-27 Thread Jan Ripke
New submission from Jan Ripke : When executing the following statement on a Windows machine it fails. On a linux machine it returns the expected date (-31-12 00:00:00) The Error we get on Windows is: OSError: [Errno 22] Invalid argument In another manor it was reported before: https

Re: Tracing in a Flask application

2021-08-09 Thread Albert-Jan Roskam
Hi, logging.basicConfig(level="DEBUG") ..in e.g __init__.py AJ On 4 Aug 2021 23:26, Javi D R wrote: Hi I would like to do some tracing in a flask. I have been able to trace request in plain python requests using sys.settrace(), but this doesnt work with

[issue44762] getpass.getpass on Windows fallback detection is bad

2021-07-28 Thread jan matejek
Change by jan matejek : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue44762> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44762] getpass.getpass on Windows fallback detection is bad

2021-07-28 Thread jan matejek
Change by jan matejek : -- versions: -Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue44

[issue44762] getpass.getpass on Windows fallback detection is bad

2021-07-28 Thread jan matejek
jan matejek added the comment: For that matter, in standard Windows Command Prompt `sys.stdin` and `sys.__stdin__` are also identical, but `isatty()` reports True. I suspect is that the code has drifted and `sys.stdin` is _always_ identical to `sys.__stdin__

[issue44762] getpass.getpass on Windows fallback detection is bad

2021-07-28 Thread jan matejek
jan matejek added the comment: ...this is a problem because: When the check incorrectly infers that it can use `msvcrt` while its stdin is a pipe, the calls to `putwch` and `getwch` are going into the void and the program effectively freezes waiting for input that never comes. See also

[issue44762] getpass.getpass on Windows fallback detection is bad

2021-07-28 Thread jan matejek
New submission from jan matejek : The fallback detection for `win_getpass` checks that `sys.stdin` is different from `sys.__stdin__`. If yes, it assumes that it's incapable of disabling echo, and calls `default_getpass` which reads from stdin. If they are the same object, it assumes it's

Re: argparse support of/by argparse

2021-07-23 Thread Albert-Jan Roskam
>>> [1] https://pypi.org/project/clize/ I use and like docopt (https://github.com/docopt/docopt). Is clize a better choice? -- https://mail.python.org/mailman/listinfo/python-list

Re: Optimizing Small Python Code

2021-06-24 Thread jan via Python-list
f an object, such as a piece of text, is the length of a shortest computer program (in a predetermined programming language) that produces the object as output". cheers jan On 24/06/2021, Avi Gross via Python-list wrote: > Jan, > > As an academic discussion, yes, many enhancements

Re: Optimizing Small Python Code

2021-06-24 Thread jan via Python-list
it would become obvious. jan On 24/06/2021, Avi Gross via Python-list wrote: > Yes, I agree that if you do not need to show your work to a human, then the > problem specified could be solved beforeand and a simple print statement > would suffice. > > Ideally you want to make a

Re: Terminology: EU language skills, and Master to Main (or ...)

2021-06-13 Thread jan via Python-list
pt rather than do anything constructive. That may be reporting bias though so my view may be of questionable reliability. Basically I've not seen much if any value in this PC stuff. > > > What do you think a professionally-recognisable series of skill-levels > for programmers? Fine. If you can do it in any meaningful sense. jan > > -- > Regards, > =dn > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Recommendation for drawing graphs and creating tables, saving as PDF

2021-06-11 Thread Jan Erik Moström
I'm doing something that I've never done before and need some advise for suitable libraries. I want to a) create diagrams similar to this one https://www.dropbox.com/s/kyh7rxbcogvecs1/graph.png?dl=0 (but with more nodes) and save them as PDFs or some format that can easily be converted to

Async code across Python versions

2021-06-03 Thread Albert-Jan Roskam
, is it better to use 3rd party libraries? It seems that things get a little easier with newer Python versions, so it might also a reason to simplify the code. Cheers! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: Async requests library with NTLM auth support?

2021-06-03 Thread Albert-Jan Roskam
> Asyncio and httpx [1] look promising but don't seem to support ntlm. Any tips? ==> https://pypi.org/project/httpx-ntlm/ Not sure how I missed this in the first place. :-) -- https://mail.python.org/mailman/listinfo/python-list

Async requests library with NTLM auth support?

2021-06-01 Thread Albert-Jan Roskam
Hi, I need to make thousands of requests that require ntlm authentication so I was hoping to do them asynchronously. With synchronous requests I use requests/requests_ntlm. Asyncio and httpx [1] look promising but don't seem to support ntlm. Any tips? Cheers! Albert-Jan [1

Re: Python install failing. Install log is available.

2021-05-21 Thread jan via Python-list
OK, but 1. should the installer work for administrator + all users or not? 2. if not, should the installer work for me (a non-admin) and install python correctly and successfully for my account if I run it in my account, not the admin? thanks jan On 20/05/2021, Terry Reedy wrote: > On 5

Python install failing. Install log is available.

2021-05-20 Thread jan via Python-list
istrator\.dotnet\tools It's there, but from a non-admin console (I work just a normal user): C:\Users\jan>whoami antik\jan C:\Users\jan>echo %path% C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\dotnet\;C:\Program F

Re: [OT] Annoying message duplication, was Re: Unsubscribe/can't login

2021-05-05 Thread Jan van den Broek
rbird's context menu: Followup to > Newsgroup. > > Does that appear once or twice? Here, once. -- Jan v/d Broek balgl...@dds.nl -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] Annoying message duplication, was Re: Unsubscribe/can't login

2021-05-05 Thread Jan van den Broek
this this thread are dupes for me and I > can't remember the last time I saw a dupe from you. Are you reading this via the mailinglist or Usenet? -- Jan v/d Broek balgl...@dds.nl -- https://mail.python.org/mailman/listinfo/python-list

Re: Unsubscribe/can't login

2021-05-05 Thread Jan van den Broek
On 2021-05-05, Peter Otten <__pete...@web.de> wrote: > On 05/05/2021 13:03, Jan van den Broek wrote: >> On 2021-05-05, Peter Otten <__pete...@web.de> wrote: >> >> Perhaps there's something wrong on my side, but I'm >> seeing this message twice: [Schnipp]

Re: Unsubscribe/can't login

2021-05-05 Thread Jan van den Broek
Return-Path: python-python-l...@m.gmane-mx.org -- Jan v/d Broek balgl...@dds.nl -- https://mail.python.org/mailman/listinfo/python-list

[issue39812] Avoid daemon threads in concurrent.futures

2021-04-26 Thread Jan Konopka
Jan Konopka added the comment: Hi all! While browsing StackOverflow I came across this question: https://stackoverflow.com/q/67273533/2111778 The user created a ThreadPoolExecutor which started a Process using multiprocessing. The Process produces an exitcode of 0 in Python 3.8

Re: .title() - annoying mistake

2021-03-21 Thread Albert-Jan Roskam
On 20 Mar 2021 23:47, Cameron Simpson wrote: On 20Mar2021 12:53, Sibylle Koczian wrote: >Am 20.03.2021 um 09:34 schrieb Alan Bawden: >>The real reason Python strings support a .title() method is surely >>because Unicode supports upper, lower, _and_ title case letters, and

Re: Packaging/MANIFEST.in: Incude All, Exclude .gitignore

2021-03-13 Thread Albert-Jan Roskam
you could call a simple bash script in a git hook that syncs your MANIFEST.in with your .gitignore. Something like: echo -n "exclude " > MANIFEST.in cat .gitignore | tr '\n' ' ' >> MANIFEST.in echo "graft $(readlink -f ./keep/this)" >> MANIFEST.in

[issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB

2021-02-05 Thread Jan Steinke
Change by Jan Steinke : -- nosy: +jan-xyz ___ Python tracker <https://bugs.python.org/issue42853> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42050] ensurepip fails if cwd contains illformed setup.cf

2021-01-30 Thread Jan Christoph
Jan Christoph added the comment: Just wanted to say, I ran into this while using direnv. See the issue I opened before knowing of this one: https://bugs.python.org/issue43038 -- nosy: +con-f-use Added file: https://bugs.python.org/file49779/shell-session.txt

[issue43038] ensurepip: tries to use setup.py/setup.cfg

2021-01-27 Thread Jan Christoph
New submission from Jan Christoph : Running python3 -Im ensurepip --upgrade --default-pip in a directory that contains a setup.cfg / setup.py combination, caused ensurepip to try and use these files, leading to distutils.errors.DistutilsOptionError: error in setup.cfg: command 'build' has

Library for text substitutions with calculations?

2020-12-15 Thread Jan Erik Moström
I want to do some text substitutions but a bit more advanced than what string.Template class can do. I addition to plain text substitution I would like to be able to do some calculations: $value+1 - If value is 16 this would insert 17 in the text. I would also like to subtract. $value+1w -

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2020-12-03 Thread Jan Tojnar
Jan Tojnar added the comment: One benefit of using a compile time feature over a runtime method is that the former allows for more predictable dedenting by first dedenting and only then interpolating variables. For example, the following code does not dedent the test string at all

[issue41945] http.cookies.SimpleCookie.parse error after [keys]

2020-11-05 Thread Jan Novak
Jan Novak added the comment: Possible patch, load parts one by one: http_cookie = 'id=12345; [object Object]=data; something=not_loaded' for cookie_key in http_cookie.split(';'): c.load(cookie_key) print c Set-Cookie: id=12345 Set-Cookie: something=not_loaded

[issue42173] Drop Solaris support

2020-10-30 Thread Jan Poctavek
Jan Poctavek added the comment: I'm speaking officially for Danube Cloud, an advanced project which is open-source virtualization platform similar to Proxmox, XCP-NG, oVirt, Joyent Triton, etc. Our base platform is SmartOS and we have everything written in Python. If you drop support

[issue42079] Why does tarfile.next swallow InvalidHeaderError

2020-10-19 Thread Jan Schatz
New submission from Jan Schatz : I have a tar gz archive that fails to be extracted via tarfile.extractall(). By adding some debug code I found that at some point InvalidHeaderError is raised inside tarfile.next(). But the function just swallows the exception, because the offset isn't 0 (see

[issue41945] http.cookies.SimpleCookie.parse error after [keys]

2020-10-05 Thread Jan Novak
New submission from Jan Novak : If brackets [] are around cookie name, next cookie names are not loaded. try: import http.cookies as Cookie except ImportError: import Cookie c = Cookie.SimpleCookie() c.load('id=12345; [object Object]=data; something=not loaded') print(c) Note: It could

[issue41417] SyntaxError: assignment expression within assert

2020-07-28 Thread Jan Češpivo
Jan Češpivo added the comment: Hi Ronald, thank you. It works! :) -- ___ Python tracker <https://bugs.python.org/issue41417> ___ ___ Python-bugs-list mailin

[issue41417] SyntaxError: assignment expression within assert

2020-07-28 Thread Jan Češpivo
New submission from Jan Češpivo : Hi, it should be useful if assignment expression works within assertion. For example (real use-case in tests): assert r := re.match(r"result is (\d+)", tested_text) assert int(r.group(1)) == expected_number I haven't found a mention about

[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups

2020-06-29 Thread Jan Hudec
Jan Hudec added the comment: Confirming the fixed version linked in previous comment by Thomas Waldmann is correct and matches what `hostname -f` does. -- nosy: +bulb versions: +Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

[issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7.

2020-04-27 Thread BenTen Jan
BenTen Jan added the comment: First and foremost thanks for replying, 1. I don't have any virus scanner installed. 2. I have tried running "python -m ensurepip" it shows me Following error C:\Python>Python get-pip.py Traceback (most recent call last): File "get-p

[issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7.

2020-04-26 Thread BenTen Jan
New submission from BenTen Jan : I downloaded python 3.8.2 which is the latest version of python for windows. Run as admin , changed path of installation though its getting empty Scripts folder. though setup shows successful. Please find attached log files from my %temp% folder. Thanks

[issue34028] Python 3.7.0 wont compile with SSL Support 1.1.0 > alledged missing X509_VERIFY_PARAM_set1_host() support

2020-04-24 Thread Jan Wilmans
Jan Wilmans added the comment: I couldn't get this to work at all, python 3.7 compiled fine, but at the end it reports: ''' *** WARNING: renaming "_ssl" since importing it failed: libssl.so.1.1: cannot open shared object file: No such file or directory *** WARNING: renaming "

  1   2   3   4   5   6   7   8   9   10   >