Re: basic auth request

2021-08-17 Thread Barry Scott
;charset" auth-param, then seems to say that only allowed value is utf-8 and you most have the unicode Normalization Form C ("NFC"). Oh and if you have the freedom avoid Basic Auth as its not secure at all. > Robin Becker Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: basic auth request

2021-08-22 Thread Barry Scott
not add anything. The pain point in PKI is revocation. The gold standard is for a web site to use OCSP stapling. But that is rare sadly. And because of issues with revocation lists, (privacy, latency, need to fail open on failiure, DoD vector, etc) this is where the paranoid should look. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: basic auth request

2021-08-25 Thread Barry Scott
> On 22 Aug 2021, at 12:03, Chris Angelico wrote: > > On Sun, Aug 22, 2021 at 8:30 PM Barry Scott <mailto:ba...@barrys-emacs.org>> wrote: >> >> >> >> On 22 Aug 2021, at 10:37, Chris Angelico wrote: >> >> When it comes to security, on

Re: Definitive guide for Regex

2021-09-30 Thread Barry Scott
> On 30 Sep 2021, at 12:29, Shaozhong SHI wrote: > > Dear All, > > I am trying to look for a definitive guide for Regex in Python. > Can anyone help? Have you read the python docs for the re module? Barry > > Regards, > > David > -- > https://mai

Re: Definitive guide for Regex

2021-09-30 Thread Barry Scott
> On 30 Sep 2021, at 19:35, dn via Python-list wrote: > > On 01/10/2021 06.16, Barry Scott wrote: >> >> >>> On 30 Sep 2021, at 12:29, Shaozhong SHI wrote: >>> >>> Dear All, >>> >>> I am trying to look for a definitive gu

Re: Definitive guide for Regex

2021-10-02 Thread Barry Scott
> On 1 Oct 2021, at 10:58, Shaozhong SHI wrote: > > Hi, Barry, > > In cases of automating checking, validation and producing reports in the > context of data quality control and giving specific feedback to production > teams, regex is perhaps the only way. > >

Re: Unable to compile my C Extension on Windows: unresolved external link errors

2021-11-13 Thread Barry Scott
> On 13 Nov 2021, at 09:00, Barry wrote: > > > >> On 12 Nov 2021, at 22:53, Marco Sulla wrote: >> >> It seems that on Windows it doesn't find python3.lib, >> even if I put it in the path. So I get the `unresolved external link` >> errors. &g

Re: Unable to compile my C Extension on Windows: unresolved external link errors

2021-11-14 Thread Barry Scott
u can do your own build of python that exposes the symbols you want. But that build will be private to you and will not allow others to use your work (on the assumption that they will not use your private build of python). Maybe you could copy the code that you want and add it to your code? Ch

Re: Using astype(int) for strings with thousand separator

2021-11-14 Thread Barry Scott
; > row = df.iloc[0].astype(int) remove the "," from the sting seems the simplest things to do. Use string's replace() to remove the comma. Barry > > I get the following error > > ValueError: invalid literal for int() with base 10: '1,024&

Re: Eventfd with epoll BlockingIOError

2021-11-25 Thread Barry Scott
rom Python > 8 Writing to Python > Failed epoll_wait Bad file descriptor > 5 Received from Python > -1time taken 0.000548 > Failed to close epoll file descriptor > Unlink_shm status: Bad file descriptor > fn() took 0.000648 seconds to execute > [Inferior 1 (process 12618

Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Barry Scott
info to: https://www.microsoft.com/security/portal/submission/submit.aspx <https://www.microsoft.com/security/portal/submission/submit.aspx> I have done this for a false positive in the past and they do resolve the false positive. Barry > > pyinstaller.exe --onefile --noconsole -i fex.ico fextasy

Re: Eventfd with epoll BlockingIOError

2021-11-27 Thread Barry Scott
you want to know if python has read the value written? If so then wait for the fd to be writeable... > > fprintf(stdout, " Received from Python \n%ld", rdval); How do you know if the value read is from python? Why isn't it the value you wrote above? If you want two way

Re: Python child process in while True loop blocks parent

2021-11-30 Thread Barry Scott
ing by not setting os.O_NONBLOCK. You should not use O_RDWR when you only need O_RDONLY access or only O_WRONLY access. You may find man 2 open useful to understand in detail what is behind os.open(). Barry > > > Nov 29, 2021, 14:12 by ba...@barrys-emacs.org: > >

Re: Python child process in while True loop blocks parent

2021-12-04 Thread Barry Scott
p/0321637739/ref=dp_ob_image_bk <https://www.amazon.co.uk/Programming-Environment-Addison-Wesley-Professional-Computing-dp-0321637739/dp/0321637739/ref=dp_ob_image_bk> It's a great book and covers a wide range of Unix systems programming topics. Have you created a small C program

Re: Python child process in while True loop blocks parent

2021-12-06 Thread Barry Scott
threads are called light-weight > processes. No Peter and I are not confused. > > Or maybe I'm confused :) Yes you are confused. > > If you have other information, please let me know. Thanks. Please get the book I recommended, or another that covers systems program

Re: threading and multiprocessing deadlock

2021-12-06 Thread Barry Scott
08:20:37) > ([GCC 10.3.0] on linux). > > Here's the code: I suggest that you include the threading.current_thread() in your messages. Then you can see which thread is saying what. Barry > > > import time > import multiprocessing > import threading > > def

Re: Python child process in while True loop blocks parent

2021-12-06 Thread Barry Scott
next I can give you a > complete picture of what I'm doing. > > Your comments, and those of Peter Holzer and Chris Angelico, are most > appreciated. Barry > > > Dec 6, 2021, 10:37 by ba...@barrys-emacs.org: > > On 6 Dec 2021, at 17:09, Jen Kris via Pytho

Re: Python child process in while True loop blocks parent

2021-12-09 Thread Barry Scott
> On 8 Dec 2021, at 17:11, Jen Kris wrote: > > I started this post on November 29, and there have been helpful comments > since then from Barry Scott, Cameron Simpson, Peter Holzer and Chris > Angelico. Thanks to all of you. > > I've found a solution that works

Re: Py_TRASHCAN_SAFE_BEGIN/END in C extension?

2021-12-22 Thread Barry Scott
> On 22 Dec 2021, at 08:14, Marco Sulla wrote: > > Yes, it's deprecated, but I need it for Python 3.7, since there was > yet no Py_TRASHCAN_BEGIN / END Hopefully the bug report will makes clear what you have to do in your code to get things working. Barry > > On Tu

Re: Selection sort

2021-12-24 Thread Barry Scott
nge(b+1,len(arr)-1): >if arr[b]>arr[a+1]: >arr[b],arr[a+1]=arr[a+1],arr[b] >return arr > > arr=[3,5,9,8,2,6] > print(selectionsort(arr)) What are you expecting the code to do? Barry > -- > > https://mail.python.org/mailman/lis

Re: What's the public API alternative to _PyObject_GC_IS_TRACKED()?

2021-12-26 Thread Barry Scott
does its thing as an implementation detail of python. Barry > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Uninstall old python version(Python 3.9.7)

2021-12-26 Thread Barry Scott
I don't know how to fix it. Please help > me. You seem to saying that you need 3.9, but you have removed it. I'm guessing there is more going on then you have explained. Otherwise simply reinstall python 3.9. Barry p.s. You signature contains an advert for outlook. You might want to get rid of that. -- https://mail.python.org/mailman/listinfo/python-list

Re: recover pickled data: pickle data was truncated

2021-12-26 Thread Barry Scott
sts and lock access to the file. How you do that depends your OS. If is unix OS then its likely you will want to use fcntl.flock(). Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: recover pickled data: pickle data was truncated

2022-01-02 Thread Barry Scott
> On 1 Jan 2022, at 16:13, Marco Sulla wrote: > > I agree with Barry. You can create a folder or a file with > pseudo-random names. I recommend you to use str(uuid.uuid4()) At work and personally I use iso-8601 timestamps to make the files unique and easy to find out when they w

Re: Who wrote Py_UNREACHABLE?

2022-01-02 Thread Barry Scott
We've reached an unreachable state. Anything is possible.\n" \ >"The limits were in our heads all along. Follow your dreams.\n" \ >"https://xkcd.com/2200";) use git blame to find out the commit then use git log to read the commit message. Barry > > etc > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Barry Scott
python libs that you need installed and use that. You would use podman and its tools to build and run the container on Centos 8. For my work I'm planning to use 3.6 on Centos 8 as that is one thing I can avoid packaging and maintaining myself. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Puzzling behaviour of Py_IncRef

2022-01-19 Thread Barry Scott
your drive the C API without needed to worry about ref counting. There are lots of other libraries as well that aim to do the same thing. http://cxx.sourceforge.net/ <http://cxx.sourceforge.net/> Barry > > Extension function : > > static PyObject *_Node_test_ref_coun

Re: How to test for maildir 'folder' in Python?

2022-01-23 Thread Barry Scott
g prefixed with a "." and uses a "." between folder name parts. An example from my Maildir is ".Python.Users/" for a folder that client shows as Python/Users You can see this by doing: ls -a ~/Maildir Barry > > -- > Chris Green > · > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

Re: Puzzling behaviour of Py_IncRef

2022-01-27 Thread Barry Scott
> On 27 Jan 2022, at 07:46, Tony Flury wrote: > > > On 26/01/2022 22:41, Barry wrote: >> >> >> Run python and your code under a debugger and check the ref count of the >> object as you step through the code. >> >> Don’t just step through y

Re: Data unchanged when passing data to Python in multiprocessing shared memory

2022-02-02 Thread Barry Scott
> On 1 Feb 2022, at 23:40, Jen Kris wrote: > > Barry, thanks for your reply. > > On the theory that it is not yet possible to pass data from a non-Python > language to Python with multiprocessing.shared_memory, I bypassed the problem > by attaching 4 bytes to my F

Re: venv and executing other python programs

2022-02-14 Thread Barry Scott
is good or bad. ;-) It's not that *I* use it, but > several progs in /usr/bin/. At least for Fedora it does not allow packages to install programs that use /usr/bin/env because of issues like you are seeing. Barry > > Thanks for your time. > -- > https://mail.python.org/mailm

Re: venv and executing other python programs

2022-02-15 Thread Barry Scott
thon3. Indeed its a feature that if you use /usr/bin/env you obviously want to use the executable from the activated venv. I avoid all these issues by not activating the venv. Python has code to know how to use the venv libraries that are installed in it when invoked. It does not depend on the

Re: Best way to check if there is internet?

2022-02-25 Thread Barry Scott
gramers. Seeing a 6 year old present their working project is wonderful to behold. Barry > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: One-liner to merge lists?

2022-02-27 Thread Barry Scott
uct the list). But if you know that the lists aren't > too large or too numerous, here's another method that works: > >>>> sum(d.values(), []) > ['aaa', 'bbb', 'ccc', 'fff', 'ggg'] > > It's simply adding all the lists together, though you have to tell it > that you don't want a numeric summation. If you code is performance sensitive do not use sum() as it creates lots of tmp list that are deleted. I have an outstanding ticket at work to replace all use of sum() on lists as when we profiled it stands out as a slow operation. We have a lots of list of list that we need to flatten. Barry > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > <https://mail.python.org/mailman/listinfo/python-list> -- https://mail.python.org/mailman/listinfo/python-list

Re: ping script

2022-02-27 Thread Barry Scott
hon.org <http://python.org/> with $ host python3.org And compare: $ dig -t A python.org <http://python.org/> $ dig -t MX python.org <http://python.org/> with $ dig -t A python3.org <http://python.org/> $ dig -t MX python3.org <http://python.org/> Barry

Re: Getting Syslog working on OSX Monterey

2022-02-28 Thread Barry Scott
> On 28 Feb 2022, at 21:41, Peter J. Holzer wrote: > > On 2022-02-27 22:16:54 +0000, Barry wrote: >> If you look at the code of the logging modules syslog handle you will see >> that >> it does not use syslog. It’s assuming that it can network to a syslog >>

Re: Behavior of the for-else construct

2022-03-03 Thread Barry Scott
x27;t be > sure it is already an iterator), and then -- if there are any elements > -- processing > the first element separately before the for-loop, which means > duplicating the loop body. You can see the whole thing gets really > ugly really quickly... > > What are your th

Re: Getting Syslog working on OSX Monterey

2022-03-03 Thread Barry Scott
fine on OSX Big Sur, but on OSX Monterey > it doesn't work at all. Users that haven't updated are having the program > produce logs as it has for years through logging.handlers.SysLogHandler. Mac > OSX definitely has a listening socket at '/var/run/syslog' which shows

Re: Getting Syslog working on OSX Monterey

2022-03-05 Thread Barry Scott
> On 4 Mar 2022, at 21:23, Peter J. Holzer wrote: > > On 2022-02-28 22:05:05 +0000, Barry Scott wrote: >> On 28 Feb 2022, at 21:41, Peter J. Holzer wrote: >>> On 2022-02-27 22:16:54 +, Barry wrote: >>>> I have always assumed that if I want a logger sy

Re: virtualenv and make DESTDIR=

2022-03-05 Thread Barry Scott
with mock as the network is disabled inside the build for security reasons. I package two of my projects this was for Fedora as RPMs. Barry > > > -- > Schönen Gruß > Hartmut Goebel > Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer > Information Sec

Re: virtualenv and make DESTDIR=

2022-03-05 Thread Barry Scott
> On 5 Mar 2022, at 16:59, Marco Sulla wrote: > > On Sat, 5 Mar 2022 at 17:36, Barry Scott wrote: >> Note: you usually cannot use pip when building an RPM with mock as the >> network is disabled inside the build for >> security reasons. > > Can't he pr

Re: virtualenv and make DESTDIR=

2022-03-05 Thread Barry Scott
> On 5 Mar 2022, at 19:56, Hartmut Goebel wrote: > > Am 05.03.22 um 17:34 schrieb Barry Scott: >> Have the RPM install all the pythone code and dependencies and also install >> a short script that >> sets up PYTHONPATH, LD_LIBRARY_PATH, etc and execs the python3 .py

Re: virtualenv and make DESTDIR=

2022-03-05 Thread Barry Scott
> On 5 Mar 2022, at 19:56, Hartmut Goebel wrote: > > Am 05.03.22 um 17:34 schrieb Barry Scott: >> Have the RPM install all the pythone code and dependencies and also install >> a short script that >> sets up PYTHONPATH, LD_LIBRARY_PATH, etc and execs the python3 .py

Re: virtualenv and make DESTDIR=

2022-03-06 Thread Barry Scott
> On 5 Mar 2022, at 19:56, Hartmut Goebel wrote: > > Am 05.03.22 um 17:34 schrieb Barry Scott: >> Have the RPM install all the pythone code and dependencies and also install >> a short script that >> sets up PYTHONPATH, LD_LIBRARY_PATH, etc and execs the pyt

Re: convenience

2022-03-23 Thread Barry Scott
ve on interpreters and compilers? On the positive side aliases are very useful to improve the speed of hot-path code. read = this.that.the_other.read while condition: buf = read() ... As with all optimisations only do this if you can justify it with benchmark results. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Why exception from os.path.exists()?

2018-06-01 Thread Barry Scott
;) This is because a posix system only sees '/home'. Surely ValueError is reasonable? Once you know that all of the string you provided is given to the operating system it can then do whatever checks it sees fit to and return a suitable result. As an aside Windows has lots of special filenames that you have to know about if you are writting robust file handling. AUX, COM1, \this\is\also\COM1 etc. Barry > > > Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Why exception from os.path.exists()?

2018-06-04 Thread Barry Scott
> On 1 Jun 2018, at 14:23, Paul Moore wrote: > > On 1 June 2018 at 13:15, Barry Scott wrote: >> I think the reason for the \0 check is that if the string is passed to the >> operating system with the \0 you can get surprising results. >> >> If \0 was not che

Re: Why exception from os.path.exists()?

2018-06-10 Thread Barry Scott
> open('a\0b', 'w') Traceback (most recent call last): File "", line 1, in ValueError: embedded null character >>> Singling out os.path.exists as a special case I do think is reasonable. All functions that take paths need to have a consistent response to data that is impossible to pass to the OS. When it is impossible to get the OS to see all of the users data I'm not sure what else is reasonable for python to do then what it already does not NUL. With the exception that I do not think this is documented and the docs should be fixed. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Why exception from os.path.exists()?

2018-06-11 Thread Barry Scott
> On 11 Jun 2018, at 01:28, Steven D'Aprano > wrote: > > On Sun, 10 Jun 2018 22:09:39 +0100, Barry Scott wrote: > >> Singling out os.path.exists as a special case I do think is reasonable. >> All functions that take paths need to have a consistent response

Re: Why exception from os.path.exists()?

2018-06-11 Thread Barry Scott
ee what actually > happened. :) As interesting as it is to see the way applications transform user input into filenames its does not affect the API that python presents. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Moderation and slight change of (de facto) policy

2016-04-18 Thread Barry Warsaw
r some lists, posts start out moderated until the person builds some positive reputation. Then the admin can turn off their moderation bit and their posts will go straight through. Cheers, -Barry -- https://mail.python.org/mailman/listinfo/python-list

C API version of str(exception) is not the same as pure python version

2019-02-10 Thread Barry Scott
ot;Simple Module", -1, myMethods }; // Initializes our module using our above struct PyMODINIT_FUNC PyInit_simple(void) { return PyModule_Create(&simple); } --- simple_test.py --- import sys import simple def simple_eval( arg ): return eval( arg ) simple.test_error() --- end -- Barry -- https://mail.python.org/mailman/listinfo/python-list

C API PyObject_GetAttrString returns not the object I expected

2019-02-10 Thread Barry Scott
After calling PyObject_GetAttrString() I expected to get a PyObject string back but I found that I had been given a instead. (gdb) p *args_o $4 = What is going on and how do I get from the to the object I want? Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: [solved] C API version of str(exception) is not the same as pure python version

2019-02-10 Thread Barry Scott
On Sunday, 10 February 2019 11:59:16 GMT Barry Scott wrote: > When I use the C API to get the str() of an execption I see this text: > > > > But python reports the following for the same exception: > > TypeError: unsupported operand type(s) for +: 'int

Re: C API PyObject_GetAttrString returns not the object I expected

2019-02-10 Thread Barry Scott
On Sunday, 10 February 2019 13:58:57 GMT Stefan Behnel wrote: > Barry Scott schrieb am 10.02.19 um 13:08: > > After calling PyObject_GetAttrString() I expected to get a PyObject string > > back but I found that I had been given a instead. > > > > (gdb) p *args_o >

Re: where is math_sin defined?

2019-02-10 Thread Barry Scott
used. The result is always exact.") 1176FUNC1(sin, sin, 0, 1177 "sin($module, x, /)\n--\n\n" 1178 "Return the sine of x (measured in radians).") 1179FUNC1(sinh, sinh, 1, 1180 "sinh($module, x, /)\n--\n\n" (gdb) Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: where is math_sin defined?

2019-02-11 Thread Barry Scott
> On 10 Feb 2019, at 16:43, Chris Angelico wrote: > > On Mon, Feb 11, 2019 at 3:37 AM Barry Scott wrote: >> >> On Sunday, 10 February 2019 15:15:32 GMT Jon Ribbens wrote: >>> As an aside, how is 'math.sin' actually implemented? mathmodule.c >&g

Re: What's up with Activestate Python?

2019-02-18 Thread Barry Scott
> On 18 Feb 2019, at 08:49, Thomas Jollans wrote: > > Anaconda also has its moments, and has some packages that PyPI doesn't > (for my use case, this is primarily PyQt5). Odd I use PyQt5 from PyPI all the time and have for a few years now. Barry -- https://mail.python.org

Re: User failed to install PIP

2019-06-24 Thread Barry Scott
python? Once python is installed you can run PIP like this: C:\Users\barry> py -m pip Usage: C:\Python37.win64\python.exe -m pip [options] Barry > On 23 Jun 2019, at 14:27, Sagar Jape wrote: > > I'm not able to install pip in my pc it gives foll

Re: [RELEASE] Python 3.8.0b2 is now available for testing

2019-07-08 Thread Barry Warsaw
I’ve updated the official images to include 3.8.0b2: https://gitlab.com/python-devs/ci-images/tree/master Cheers, -Barry > On Jul 4, 2019, at 15:05, Łukasz Langa wrote: > > Signed PGP part > After a few days of delay, but somewhat cutely timed with the US Independence > Day

Re: unable to import pip installed packages and modules in python 3.7.3

2019-07-09 Thread Barry Scott
If you included an image of the screen it was striped from your email. Use the mouse to select the text in the cmd window and paste that into the email. Show the command you issued and all the messages it prints. There i no need for upper case text. Barry > On 9 Jul 2019, at 17:13, pro_

Re: Difficulties configuring LTO on macOS with clang

2019-07-09 Thread Barry Scott
or -llvm-ar... no > checking for llvm-ar... '' > configure: error: llvm-ar is required for a --with-lto build with clang but > could not be found. I see /opt/local/bin/llvm-ar-mp-4.0 which ends up running the llvm-ar from /opt/local/libexec/llvm-4.0/bin Just a guess but maybe you

Re: Difficulties configuring LTO on macOS with clang

2019-07-10 Thread Barry Scott
bin from your PATH does that help configure find the tools it needs? Barry > > Thanks, > Scott > > On Tue, Jul 9, 2019, at 15:39, Barry Scott wrote: >> >> >> > On 9 Jul 2019, at 19:28, Scott Colby wrote: >> > >> > Hello all, >

Re: super or not super?

2019-07-15 Thread Barry Scott
e its critical and you did not use it. super() is always right (I think by design) but calling C1.__init__(self) can go wrong and is often hard to debug. Barry > > Thanks for any comments. > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

PyPi twine check does not like my README.rst files anymore

2019-07-15 Thread Barry Scott
on https://github.com/barry-scott/namedstruct where you can see the README.rst rendered in full. Where as at https://pypi.org/project/namedstruct/ only the first line is rendered. Checking distribution dist\namedstruct-1.2.1-py3-none-any.whl: warning: `long_description_content_type` missing

Re: PyPi twine check does not like my README.rst files anymore

2019-07-16 Thread Barry Scott
> On 16 Jul 2019, at 05:43, dieter wrote: > > Barry Scott writes: >> I am update some PyPI projects and found that twine was refusing the upload. >> ... >> Failed >> The project's long_description has invalid markup which will not be rendered >&g

Re: Class initialization with multiple inheritance

2019-07-16 Thread Barry Scott
ce that I explicitly derived from object that is the default. But here you see that class object is always there even if I omit it. >>> class Foo: ... pass ... >>> Foo.__mro__ (, ) Barry > > Thanks, > jlc > > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Counting Python threads vs C/C++ threads

2019-07-16 Thread Barry Scott
the number of Thread objects currently alive. The returned count is equal to the length of the list returned by enumerate() . Try running strace on the process to see what system calls its making. You could also connect gdb to the process and find out what code the threads are running.

Re: Counting Python threads vs C/C++ threads

2019-07-17 Thread Barry Scott
> On 16 Jul 2019, at 20:48, Dan Stromberg wrote: > > > > On Tue, Jul 16, 2019 at 11:13 AM Barry Scott <mailto:ba...@barrys-emacs.org>> wrote: > I'm going to assume you are on linux. > Yes, I am. Ubuntu 16.04.6 LTS sometimes, Mint 19.1 other times.

Re: Embedding Python in C

2019-07-17 Thread Barry Scott
Python3/simple.cxx <https://sourceforge.net/p/cxx/code/HEAD/tree/trunk/CXX/Demo/Python3/simple.cxx> Barry PyCXX maintainer > > Please advise. > > Thank you. > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Embedding Python in C

2019-07-18 Thread Barry Scott
> On 17 Jul 2019, at 19:39, Jesse Ibarra wrote: > > On Wednesday, July 17, 2019 at 11:55:28 AM UTC-6, Barry Scott wrote: >>> On 17 Jul 2019, at 16:57, wrote: >>> >>> I am using Python3.6: >>> >>> [jibarra@redsky ~]$ python3.6 >&

Re: Proper shebang for python3

2019-07-21 Thread Barry Scott
t all. Often I'm testing on many python versions. And end up with something like this to test on all interesting python versions. for PTYHON in python3.6 python3.7 python3.8 do $PYTHON my_script.py done Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: PyPi twine check does not like my README.rst files anymore

2019-07-23 Thread Barry Scott
I tried the twine check on Fedora and the test pass. This looks looks like a bug in twine on Windows which I have reported in https://github.com/pypa/twine/issues/476 <https://github.com/pypa/twine/issues/476> Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Proper shebang for python3

2019-07-24 Thread Barry Scott
org/wiki/Features/UsrMove <https://fedoraproject.org/wiki/Features/UsrMove> Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: [python-committers] [RELEASE] Python 3.8.0b3 is now available for testing

2019-07-29 Thread Barry Warsaw
I have updated the official docker images with 3.8b3: https://gitlab.com/python-devs/ci-images/tree/master -Barry > On Jul 29, 2019, at 14:48, Łukasz Langa wrote: > > Signed PGP part > This time without delays, I present you Python 3.8.0b3: > > https://www.python.org/downlo

Re: Using pycurl to obtain the download speed in real-time for a huge file.

2019-08-02 Thread Barry Scott
> On 2 Aug 2019, at 08:37, Hongyi Zhao wrote: > > Hi, > > I want to use pycurl to obtain the download speed in real-time for a huge > file. Is this possible or not? Yes > Any hints on this issue? Google for python pycurl progress Barry > > Reg

Re: Application Preferences

2019-08-19 Thread Barry Scott
% that is named after your app. You should find the folder by doing a win32 API call to get the value. See getPreferencesDir() in https://github.com/barry-scott/scm-workbench/blob/master/Source/Common/wb_platform_win32_specific.py <https://github.com/barry-scott/scm-workbench/blob/master/Source

Re: Application Preferences

2019-08-20 Thread Barry Scott
er to store app files into. The app then needs to store that folder somewhere. I would ask the user for the their preferred location and store that folder in a OS standard location. I do exactly that with Scm-Workbench. The user picks the folder to check out repos into and I store that choice in t

Announcing Scm Workbench 0.9.3 for Git, Mercurial and Subversion

2019-09-02 Thread Barry Scott
downloads, git source, user guide and further information on SCM Workbench. New in 0.9.3 • Lots of improvement since the last release • Update to use python3.7, PyQt5 5.12 and pysvn with svn 1.12 Barry -- https://mail.python.org/mailman/listinfo/python-list

CVE-2019-9636 - Can this be exploit over the wire?

2019-09-04 Thread Barry Scott
ppend(ToUnicode(label)) File "/usr/lib64/python2.7/encodings/idna.py", line 139, in ToUnicode raise UnicodeError("IDNA does not round-trip", label, label2) UnicodeError: ('IDNA does not round-trip', 'xn--combing-xr93b', &

Re: CVE-2019-9636 - Can this be exploit over the wire?

2019-09-05 Thread Barry Scott
> On 5 Sep 2019, at 16:18, Random832 wrote: Thanks for taking the time to reply. > > On Wed, Sep 4, 2019, at 13:36, Barry Scott wrote: >> The conclusion I reached is that the CVE only applies to client code >> that allows a URL in unicode to be entered. >>

Re: fileinput module not yielding expected results

2019-09-07 Thread Barry Scott
pass # process a non-header line here If you always know you can skip the first line I use this pattern with fileinput ...: next(f) # skip header for line in f: # process a non-header line here Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: WedWonder: Scripts and Modules

2019-09-12 Thread Barry Scott
e__ == '__main__' is important to allow this. I often have modules that are part of a larger program that have their own main() functions to unittest or give access to parsers etc. In large projects with many modules import with side-effect can make for a maintenance burden. Barry >

Re: Email messages from grouped email using IMAPClient in Python.

2019-09-12 Thread Barry Scott
not available by default imaplib.Commands['MOVE'] = ('SELECTED',) As DL said you need to print out what you get back from the search() and check that it is what you expect. Barry > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: regular expressions help

2019-09-20 Thread Barry Scott
When I'm debugging a regex I make the regex shorter and shorter to figure out what the problem is. Try starting with re.compile(r'm') and then add the chars one by one seeing what happens as the string gets longer. Barry > On 19 Sep 2019, at 09:41, Pradeep Patra wrote: >

Re: Synchronous and Asynchronous callbacks

2019-09-29 Thread Barry Scott
em wait, they can complete their work in one call. sync == async-that-does-not-await Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: pathlib

2019-09-30 Thread Barry Scott
f: f.write( data ) while True: save( generate_data() ) time.sleep( interval ) If the rename of the file changed the path the above code will fail. Barry > > > Sample code, below, shows pathlib identifying a data-file and then renaming > it. Yet,

Re: Synchronous and Asynchronous callbacks

2019-09-30 Thread Barry Scott
> On 29 Sep 2019, at 21:41, Eko palypse wrote: > > Am Sonntag, 29. September 2019 19:18:32 UTC+2 schrieb Barry Scott: >>> On 29 Sep 2019, at 14:14, Eko palypse wrote: >>> >>> Unfortunately, I can't make all callbacks synchronous or asynchronous >

Re: pathlib

2019-09-30 Thread Barry Scott
up > > Also, it will not necessarily be as obvious as in the above example. > Everywhere you write > > p = q > > you produce an occasion to unexpectedly change a file reference. Generally, > it's easier to reason about immutable objects. > > What might be helpful

Announcing config-path an OS independent configuration file paths

2019-09-30 Thread Barry Scott
path = conf_path.saveFilePath( mkdir=True ) with path.open() as f: f.write( config_data ) And to read the config: path = conf_path.readFilePath() if path is not None: # path exists and config can be read with path.open() as f: config = json.loads( f ) else: con

Announcing colour-text and colour-print

2019-09-30 Thread Barry Scott
nt "<>error Error: This is an error message<>" And you can also pass in arguments in a printf or python % style, only %s is supported. $ colour-print "<>info Info:<> Home folder is %s" "$HOME" Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: pathlib

2019-09-30 Thread Barry Scott
> On 30 Sep 2019, at 12:51, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> > wrote: > > On 9/30/19 4:28 AM, Barry Scott wrote: >>> On 30 Sep 2019, at 05:40, DL Neil via Python-list >>> wrote: >>> Should pathlib reflect changes it has made to th

Re: pathlib

2019-09-30 Thread Barry Scott
u can write this: pathlib.Path("name").open() Which is the same as: open(pathlib.Path("name")) Which is the same as: open("name") You would not expect str to track the file, why expect Path() to? Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Announcing config-path an OS independent configuration file paths

2019-09-30 Thread Barry Scott
1st run the config may be in a system directory which the user cannot write to. Saving a config file will go into the users config file. On the 2nd run that users config should be read not the system config. appdirs covers the location of more type of files, like cache and data. Barr

Re: pathlib

2019-09-30 Thread Barry Scott
his discussion seems to fall into the "wrong model" world that leads to a expectation failure. Have we moved on to how we can improve the situation? Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: pathlib

2019-10-02 Thread Barry Scott
> On 2 Oct 2019, at 09:14, DL Neil via Python-list > wrote: > > On 2/10/19 12:52 AM, Rhodri James wrote: >> On 01/10/2019 06:03, DL Neil via Python-list wrote: >>> On 30/09/19 9:28 PM, Barry Scott wrote: >>>>> On 30 Sep 2019, at 05

Re: pathlib

2019-10-04 Thread Barry Scott
ific PurePath's, WindowPurePath and PosixPurePath. The OS Specific Path's with IO operations. WindowsPath and PosixPath. And lets not forget the Path is a factory for for one of OS Specific objects. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: pathlib

2019-10-04 Thread Barry Scott
raise expects if the rename does not work. Or do you mean it does not mutate the path on a rename? Thats a feature not a bug. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Get __name__ in C extension module

2019-10-06 Thread Barry Scott
I. Its a pain to use and get right, get the ref counts wrong and you get memory leaks of worse crash python. There are lots of good alternative. Personal I use PyCXX, but then I'm the maintainer :-) https://sourceforge.net/projects/cxx/ <https://sourceforge.net/projects/cxx/> Barry

Re: Get __name__ in C extension module

2019-10-07 Thread Barry Scott
ion functions? The only thing I can think of >> would be to save it in a static variable, but static variables seem to >> be a no-no in extensions. >> > Can an extension module be instantiated twice? If so, would they share static > variables? If they don't, then it'

<    1   2   3   4   5   6   7   >