python: setup.py: how NOT to install C extensions used only by tests

2022-11-30 Thread Bartosz Golaszewski
though none of the python sources from the tests/ directory gets installed when running setup.py install, the extension binary (and nothing else) is installed into site-packages/tests/. How can I prohibit setuptools from doing it? Best Regards, Bartosz Golaszewski -- https://mail.python.org/mailman

Re: Defining a Python enum in a C extension - am I doing this right?

2021-08-08 Thread Bartosz Golaszewski
On Fri, Aug 6, 2021 at 9:02 PM Serhiy Storchaka wrote: > > 03.08.21 13:03, Bartosz Golaszewski пише: > > Just a follow-up: this is how I did it eventually: > > I think it can be simpler. > > 1. No need to create the __main__ module. You can just create a dict. If > s

Re: Defining a Python enum in a C extension - am I doing this right?

2021-08-03 Thread Bartosz Golaszewski
On Sat, Jul 31, 2021 at 3:01 PM Bartosz Golaszewski wrote: > > On Fri, Jul 30, 2021 at 2:41 PM Serhiy Storchaka wrote: > > > > 23.07.21 11:20, Bartosz Golaszewski пише: > > > I'm working on a Python C extension and I would like to expose a > > > custom

Re: Defining a Python enum in a C extension - am I doing this right?

2021-07-31 Thread Bartosz Golaszewski
On Fri, Jul 30, 2021 at 2:41 PM Serhiy Storchaka wrote: > > 23.07.21 11:20, Bartosz Golaszewski пише: > > I'm working on a Python C extension and I would like to expose a > > custom enum (as in: a class inheriting from enum.Enum) that would be > > entirely defined in C. &

Re: Defining a Python enum in a C extension - am I doing this right?

2021-07-26 Thread Bartosz Golaszewski
On Sat, Jul 24, 2021 at 6:55 AM Dan Stromberg wrote: > > > On Fri, Jul 23, 2021 at 1:20 AM Bartosz Golaszewski wrote: >> >> Hi! >> >> I'm working on a Python C extension and I would like to expose a >> custom enum (as in: a class inheriting from enum.Enum)

Re: Defining a Python enum in a C extension - am I doing this right?

2021-07-23 Thread Bartosz Golaszewski
On Fri, Jul 23, 2021 at 5:08 PM MRAB wrote: > > On 2021-07-23 09:20, Bartosz Golaszewski wrote: > > Hi! > > > > I'm working on a Python C extension and I would like to expose a > > custom enum (as in: a class inheriting from enum.Enum) that would be > > enti

Defining a Python enum in a C extension - am I doing this right?

2021-07-23 Thread Bartosz Golaszewski
I call the PyType_Type object too to create the sub-type. This works and AFAICT results in a class that behaves exactly as expected, but... am I doing this right? Any feedback is appreciated. I want to use this in a real project, namely the v2 of libgpiod python bindings[1] so it's important to me to get this right. Best regards, Bartosz Golaszewski [1] https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ -- https://mail.python.org/mailman/listinfo/python-list

[issue44610] Format issue with strftime and %Y

2021-07-19 Thread Bartosz Kaznowski
Bartosz Kaznowski added the comment: Ok, thanks @iritkatriel. I have closed it as a duplicate. I did notice after posting this that in the cpython source code people work around this issue. Now I can see why. I guess I will just have to work around this issue too. Luckily it doesn't cause

[issue44610] Format issue with strftime and %Y

2021-07-12 Thread Bartosz Kaznowski
Change by Bartosz Kaznowski : -- versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue44610> ___ ___ Pytho

[issue44610] Format issue with strftime and %Y

2021-07-12 Thread Bartosz Kaznowski
Change by Bartosz Kaznowski : -- versions: +Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue44610> ___ ___ Python-bugs-list mailin

[issue44610] Format issue with strftime and %Y

2021-07-12 Thread Bartosz Kaznowski
New submission from Bartosz Kaznowski : When you convert a date pre the year 1000 to a string with `%Y` as the formatter and then back to a date again then it fails. This is because `%Y` expects it to be formatted with leading zeroes. For example, the year 1/01/01 (/mm/dd) should be 0001

[issue38963] multiprocessing processes seem to "bleed" user information (GID/UID/groups)

2021-04-09 Thread Bartosz Kwitniewski
Bartosz Kwitniewski added the comment: It works as intended - pool of 5 processes is being reused with new data: - First, 5 processes are created as root, - in first run of check_permission they drop their privileges to user, - when they finish processing check_permission function

[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2021-04-05 Thread Bartosz
Bartosz added the comment: Done so: https://github.com/python/cpython/pull/25197 Signed the CLA thing too, it seems it'll take a while to update tho. -- ___ Python tracker <https://bugs.python.org/issue41

[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2021-04-05 Thread Bartosz
Change by Bartosz : -- pull_requests: +23936 pull_request: https://github.com/python/cpython/pull/25197 ___ Python tracker <https://bugs.python.org/issue41

[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2021-04-04 Thread Bartosz
Bartosz added the comment: The docs for this should probably be updated to reflect the change: https://docs.python.org/3/library/typing.html#typing.runtime_checkable -- nosy: +DevilXD ___ Python tracker <https://bugs.python.org/issue41

Re: Tracking a memory leak in C extension - interpreting the output of PYTHONMALLOCSTATS

2018-07-24 Thread Bartosz Golaszewski
2018-07-24 13:30 GMT+02:00 Bartosz Golaszewski : > 2018-07-24 12:09 GMT+02:00 Bartosz Golaszewski : >> 2018-07-23 21:51 GMT+02:00 Thomas Jollans : >>> On 23/07/18 20:02, Bartosz Golaszewski wrote: >>>> Hi! >>> >>> Hey! >>> >>>> A

Re: Tracking a memory leak in C extension - interpreting the output of PYTHONMALLOCSTATS

2018-07-24 Thread Bartosz Golaszewski
2018-07-24 12:09 GMT+02:00 Bartosz Golaszewski : > 2018-07-23 21:51 GMT+02:00 Thomas Jollans : >> On 23/07/18 20:02, Bartosz Golaszewski wrote: >>> Hi! >> >> Hey! >> >>> A user recently reported a memory leak in python bindings (C extension >>&g

Re: Tracking a memory leak in C extension - interpreting the output of PYTHONMALLOCSTATS

2018-07-24 Thread Bartosz Golaszewski
2018-07-23 21:51 GMT+02:00 Thomas Jollans : > On 23/07/18 20:02, Bartosz Golaszewski wrote: >> Hi! > > Hey! > >> A user recently reported a memory leak in python bindings (C extension >> module) to a C library[1] I wrote. I've been trying to fix it since >> b

Tracking a memory leak in C extension - interpreting the output of PYTHONMALLOCSTATS

2018-07-23 Thread Bartosz Golaszewski
d. I tried the same for PyObject_Malloc and still nothing. How do I use the info produced by PYTHONMALLOCSTATS do get to the culprit of the leak? Is there anything wrong in my reasoning here? Best regards, Bartosz Golaszewski [1] https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ -- h

[issue33829] C API: provide new object protocol helper

2018-06-11 Thread Bartosz Gołaszewski
New submission from Bartosz Gołaszewski : If we want to call an object's method from C code and pass it the args and kwargs tuples unchanged, we need to first retrieve the callable object using PyObject_GetAttrString(), then call it using PyObject_Call(). I would like to propose wrapping

[issue14037] Allow grouping of argparse subparser commands in help output

2013-01-29 Thread Bartosz S
Changes by Bartosz S tosz...@gmail.com: -- nosy: +toszter ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14037 ___ ___ Python-bugs-list mailing

[issue11288] Python installed from MSI doesn't work

2011-02-23 Thread Bartosz
Bartosz sspame...@gmail.com added the comment: I've got English version too. Python is 32 bit and operating system is also 32 bit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11288

[issue11288] Python installed from MSI doesn't work

2011-02-23 Thread Bartosz
Bartosz sspame...@gmail.com added the comment: I have found a problem and sollution: previously I have used Python 2.x and when I removed that version and next installed Python32, PYTHONPATH in system variabled indicated still to Python2.x. Removing all python paths to old version solved

[issue11288] Python installed from MSI doesn't work

2011-02-22 Thread Bartosz
Bartosz sspame...@gmail.com added the comment: I've got the same situation. Windows 7 (32bit) python-3.2.msi installations puts through, but when I try to lunch python appears error : Fatal Python error: Py_Initialize: unable to load the file system codec LookupError: no codec search functions

Re: How to launch a function at regular time intervals ?

2009-08-12 Thread Bartosz Wroblewski
in a time.time() call where appropriate. -- | )-, | ''The good-enough is the enemy of the excellent.'' - John Miles | (_==/ |---,- | ='- | Bartosz Wroblewski | bawr from holyhandgrenade.info or int8.org -- http://mail.python.org/mailman

[issue4099] dir on a compiled re does not show pattern as a part of the list

2008-10-10 Thread Bartosz Radaczyński
New submission from Bartosz Radaczyński [EMAIL PROTECTED]: It does not show a few other things that are listed here: http://www.python.org/doc/2.5.2/lib/re-objects.html -- components: Regular Expressions messages: 74632 nosy: bartoszr severity: normal status: open title: dir

[issue4099] dir on a compiled re does not show pattern as a part of the list

2008-10-10 Thread Bartosz Radaczyński
Bartosz Radaczyński [EMAIL PROTECTED] added the comment: Cool. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4099 ___ ___ Python-bugs-list mailing list

Multi-Screen display

2005-09-16 Thread Bartosz Ptaszynski
Hi, Currently I'm working on a project in which I have to display a window on each of the monitors connected to the PC. I've been looking around for a way to detect how many monitors are connected to the machine (windows box) and how to force a window to launch at specific monitor, without