New submission from YoSTEALTH :
Getting compilation error for an Cython project, since upgrade from `3.11.0a3`
to `3.11.0a4`, same code.
/opt/python/3.11/bin/python3 setup.py build_ext --inplace -j18 clean --all
# 3.11.0a3
#
prefix/usr
includedir
YoSTEALTH added the comment:
Thanks @iritkatriel will close this, seems like people are aware of this bug as
working on fix it :)
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/i
New submission from YoSTEALTH :
class Some_Class:
def error(self):
if not getattr(self, 'boo', None):
raise Exception(f'`class {self.__class__.__name__}:` raised some
error!')
something = Some_Class()
something.error()
# Thi
YoSTEALTH added the comment:
I didn't receive any notification of replay on this topic.
`_default_mime_types()` should never have been a function. This function should
be safe to remove as its an internal function. This would avoid unneeded
function call and globals used.
Stuff
YoSTEALTH added the comment:
I am closing this topic as its right for python to raise OSError as `-errno`
must be assigned to e.g. `OSError(-errno, os.strerror(-errno))` to raise
appropriate exception.
--
resolution: -> not a bug
stage: -> resolved
status: open -&g
New submission from YoSTEALTH :
# enum in C
# -
enum {
a,
b,
c
}
# a = 0
# b = 1
# b = 2
# enum in Python
# --
class Count(enum.IntEnum):
a = enum.auto()
b = enum.auto()
c = enum.auto()
# a = 1
# b = 2
# b = 3
I am not sure why the `enum.auto
Change by YoSTEALTH :
--
keywords: +patch
pull_requests: +17288
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17872
___
Python tracker
<https://bugs.python.org/issu
Change by YoSTEALTH :
--
pull_requests: +17294
pull_request: https://github.com/python/cpython/pull/17878
___
Python tracker
<https://bugs.python.org/issue39
New submission from YoSTEALTH :
import os
try:
no = -62
raise OSError(-no, os.strerror(-no))
except TimeoutError:
print('Success')
except OSError as e:
print('Failed:', e)
# Failed: [Errno 62] Timer expired
Shouldn't `TimeoutError` catch this er
YoSTEALTH added the comment:
Since I provide `OSError` with appropriate `errono`, it raises that error for
example:
import os
try:
no = -11
raise OSError(-no, os.strerror(-no))
except BlockingIOError as e:
print('Success:', e)
# Success: [Errno 11] Resource t
YoSTEALTH added the comment:
First example prints
# Failed: [Errno 62] Timer expired
Second example prints
# Success: [Errno 11] Resource temporarily unavailable
--
___
Python tracker
<https://bugs.python.org/issue39
YoSTEALTH added the comment:
I am on Linux 5.5.2-1-MANJARO
>>> sorted(errno.errorcode.items())
[(1, 'EPERM'), (2, 'ENOENT'), (3, 'ESRCH'), (4, 'EINTR'), (5, 'EIO'), (6,
'ENXIO'), (7, 'E2BIG'), (8, 'ENOEXEC
YoSTEALTH added the comment:
If nothing else, it could be a feature of next Python release as its
appropriate that `TimeoutError` catches both `ETIME` and `ETIMEDOUT`.
--
versions: +Python 3.9 -Python 3.8
___
Python tracker
<ht
New submission from YoSTEALTH :
>>> /opt/python/3.8.1/lib/python3 setup.py build_ext --inplace
Traceback (most recent call last):
File "./setup.py", line 1, in
from setuptools import setup, find_packages
File "/opt/python/3.8.1/lib/python3.8/site-package
YoSTEALTH added the comment:
How did you get the Python installed in /opt/python/3.8.1?
- I custom installed python.
Maybe it was compiled against libffi 6, then you updated the system to libffi
7, so that Python would need a rebuild.
- Yes, you are right about this.
So i did rebuild and no
Change by YoSTEALTH :
--
keywords: +patch
pull_requests: +19603
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20335
___
Python tracker
<https://bugs.python.org/issu
Change by YoSTEALTH :
--
pull_requests: +19604
pull_request: https://github.com/python/cpython/pull/20336
___
Python tracker
<https://bugs.python.org/issue37
YoSTEALTH added the comment:
terry.reedy ok, recreated the patch.
--
___
Python tracker
<https://bugs.python.org/issue37129>
___
___
Python-bugs-list mailin
New submission from YoSTEALTH :
`errno` https://docs.python.org/3/library/errno.html is missing description for
symbols like `ECANCELED`
https://www.gnu.org/software/libc/manual/html_node/Error-Codes.html There might
be others missing description as well, i haven't investigated fu
Change by YoSTEALTH :
--
keywords: +patch
pull_requests: +19882
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/20665
___
Python tracker
<https://bugs.python.org/issu
Change by YoSTEALTH :
--
type: -> enhancement
versions: +Python 3.7, Python 3.8, Python 3.9
___
Python tracker
<https://bugs.python.org/issue40869>
___
___
Py
Change by YoSTEALTH :
--
versions: +Python 3.10
___
Python tracker
<https://bugs.python.org/issue40869>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by YoSTEALTH :
--
components: +C API
___
Python tracker
<https://bugs.python.org/issue40869>
___
___
Python-bugs-list mailing list
Unsubscribe:
YoSTEALTH added the comment:
Hello Arpit,
Welcome to python bugs. I have already created the patch at
https://github.com/python/cpython/pull/20665 if you feel like i missed
something you can comment on it. That said there is always something to do with
python, just keep your eye out for it
New submission from YoSTEALTH :
import os
import stat
import os.path
def problem(tmp_path):
# result:
# ---
# check: False
# mode: 416
# create temp file
fd = os.open(tmp_path, os.O_CREAT, 0o660)
os.close(fd)
# Directory is effected as well
# os.mkdir
YoSTEALTH added the comment:
I am closing this as its not a issue anymore... I was trying to solve a problem
that has become a core feature!
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/i
Change by YoSTEALTH :
--
keywords: +patch
nosy: +YoSTEALTH
nosy_count: 5.0 -> 6.0
pull_requests: +20758
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/21616
___
Python tracker
<https://bugs.p
Change by YoSTEALTH :
--
versions: +Python 3.7
___
Python tracker
<https://bugs.python.org/issue41314>
___
___
Python-bugs-list mailing list
Unsubscribe:
YoSTEALTH added the comment:
@gvanrossum I found couple of odd places where 4.0 is mentioned like
https://docs.python.org/3/library/array.html for example, should a new issue be
created? I am not sure how many more there are.
--
___
Python
New submission from YoSTEALTH :
>>> /opt/python/3.9.0/bin/python3 -m test -uall
== CPython 3.9.0b5 (default, Jul 22 2020, 13:13:23) [GCC 10.1.0]
== Linux-5.8.0-1-MANJARO-x86_64-with-glibc2.31 little-endian
== cwd: /tmp/test_python_39605æ
== CPU count: 16
== encodings: locale=UTF-8, FS=u
YoSTEALTH added the comment:
while compiling i got this warning, maybe its related!
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter
-Wno-missing-field-initializers -Werror=implicit-function
YoSTEALTH added the comment:
>>> /opt/python/3.9.0/bin/python3 -m test.pythoninfo
Python debug information
CC.version: gcc (GCC) 10.1.0
Py_DEBUG: No (sys.gettotalrefcount() missing)
_decimal.__libmpdec_version__: 2.5.0
builtins.float.double_format: IEEE, litt
YoSTEALTH added the comment:
I compiled and tested for same issues in 3.8.5 and they exist as well.
--
___
Python tracker
<https://bugs.python.org/issue41
YoSTEALTH added the comment:
Start and end position of the signature must be accounted for, not all file
signature start at ``0`` or ``< 512`` bytes
Rather then writing all the signatures manually might be a good idea to use
already collected resource like
https://www.garykessler.
YoSTEALTH added the comment:
@rhettinger https://bugs.python.org/issue41314
--
nosy: +YoSTEALTH
___
Python tracker
<https://bugs.python.org/issue41475>
___
___
YoSTEALTH added the comment:
@cool-RR since your patch focuses on ``3.7`` there might be a merge issue.
There might be other place where ``4.0`` is mentioned though. Its better to let
core dev like Raymond make the call.
--
___
Python tracker
Change by YoSTEALTH :
--
nosy: +YoSTEALTH
___
Python tracker
<https://bugs.python.org/issue37129>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from YoSTEALTH :
from asyncio import run
async def true():
return True
async def false():
return False
async def error():
a = false()
b = true()
return await (a or b)
# Good Error
# "RuntimeWarning: coroutine 'true' was neve
YoSTEALTH added the comment:
Yes, this was the previous conclusion.
In a large code base, its hard to find such solution easily! There are many
cases where `await` is not called and `RuntimeWarning` is not raised. Hard to
narrow down the exact problem.
Maybe there needs to be a better way
YoSTEALTH added the comment:
As far as i can tell "static analyzers" like flake8 and "type hints" like mypy
does not detect this problem
--
___
Python tracker
<https://bug
YoSTEALTH added the comment:
"Writing test suites is very helpful, and you might want to plan your code
based on expectation of making it easy for testing."
--
nosy: +YoSTEALTH
___
Python tracker
<https://bugs.python.o
YoSTEALTH added the comment:
programmers "plan" their code, they don't "design" it, as far as i know!
--
___
Python tracker
<https:
New submission from YoSTEALTH :
import os
import ctypes
# Stdlib
# --
def test_preadv_stdlib(path):
fd = os.open(path, os.O_RDWR | os.O_CREAT)
buffer = bytearray(10)
buffers = [buffer]
try:
length = os.preadv(fd, buffers, 0, os.RWF_NOWAIT)
# OSError: [Errno
New submission from YoSTEALTH:
Asynchronous, Non-blocking Buffered File Read
"RWF_NONBLOCK" flag for os.open()
Link:
https://lwn.net/Articles/612483/
https://lwn.net/Articles/613068/
https://lwn.net/Articles/636967/
--
messages: 301508
nosy: YoSTEALTH
priority: normal
severi
YoSTEALTH added the comment:
Martin, your points got me thinking... to make a proper copy of a file, it
should be done using bytes! Text IO could easily lead to corrupting your file.
for example (current function):
with open(old_path, 'r', encoding='latin-1') as fsr
Change by YoSTEALTH :
--
keywords: +patch
pull_requests: +5013
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32529>
___
___
Python-
Change by YoSTEALTH :
--
pull_requests: -5004
___
Python tracker
<https://bugs.python.org/issue32529>
___
___
Python-bugs-list mailing list
Unsubscribe:
YoSTEALTH added the comment:
Ok, updated the patch to account for:
- improved memory usage for bytes io using readinto
- still supporting negative length
- potential encoding mismatch bug fix while using text io
did i miss anything?
--
___
Python
Change by YoSTEALTH :
--
pull_requests: +5014
___
Python tracker
<https://bugs.python.org/issue32529>
___
___
Python-bugs-list mailing list
Unsubscribe:
YoSTEALTH added the comment:
here is the links to benchmark:
https://repl.it/@altendky/timeit-of-proposed-shutilfileobjcopy
https://gist.github.com/altendky/ff5ccee2baf9822dce69ae8aa66a0fdf
https://paste.pound-python.org/show/urORPXztcbDlqXKTORAj/ # time ./file.py
the problem is
YoSTEALTH added the comment:
preadv2(2) syscall with RWF_NONBLOCK feature is now released starting linux4.14
https://kernelnewbies.org/Linux_4.14#Asynchronous_buffered_I.2FO_support
--
___
Python tracker
<https://bugs.python.org/issue31
YoSTEALTH added the comment:
There will be lot of confusion using "buffered" & "unbuffered" terminology,
since python already has BufferedIOBase (as mentioned by Martin). It would be
more appropriate to create io.CachedIOBase and add non-blocking argument to
open(b
YoSTEALTH added the comment:
According to this nginx test
https://www.nginx.com/blog/thread-pools-boost-performance-9x/ there is a huge
boost in performance when using thread poll for File IO. It is postulated that
when preadv2() & RWF_NONBLOCK feature are available it would further ben
Change by YoSTEALTH :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue32529>
___
___
Python-bugs-
YoSTEALTH added the comment:
Thank you Pablo Galindo for your amazingly hard work. Also Victor Stinner for
your guidance, thanks you :)
--
___
Python tracker
<https://bugs.python.org/issue31
YoSTEALTH added the comment:
Since "ensure_disabled" is a class
https://docs.python.org/3.7/library/gc.html#gc.ensure_disabled it should be
"EnsureDisabled" according to
https://www.python.org/dev/peps/pep-0008/#class-names
---
YoSTEALTH added the comment:
ps, maybe a better name "DisabledZone" ?
--
___
Python tracker
<https://bugs.python.org/issue31356>
___
___
Python-bugs-l
YoSTEALTH added the comment:
Actually i don't remember the last time where i saw anyone call a function
using a "with" statement. This is very sloppy, sure PEP8 isn't ironclad but
this is going to lead to confusion and we might have another case of datetime
model (where
Change by YoSTEALTH :
--
pull_requests: +5293
___
Python tracker
<https://bugs.python.org/issue31368>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from YoSTEALTH :
# current
if timeout is None:
timeout = -1
elif timeout <= 0:
timeout = 0
# changed
if timeout is None:
timeout = -1
elif timeout < -1:
timeout = 0
what if "timeout=-1" ?
- currently it would result in being timeout=0
--
Change by YoSTEALTH :
--
keywords: +patch
pull_requests: +5472
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32842>
___
___
Python-
Change by YoSTEALTH :
--
pull_requests: +5474
___
Python tracker
<https://bugs.python.org/issue32842>
___
___
Python-bugs-list mailing list
Unsubscribe:
YoSTEALTH added the comment:
my confusion comes from epoll.poll(timeout=-1, maxevents=-1) has nothing to do
with selectors.BaseSelector.select(timeout=None)
--
resolution: -> not a bug
stage: patch review -> resolved
status: open -&g
YoSTEALTH added the comment:
I am using 3.7.0b1 i don't think this issue is fixed!
# simple mockup:
# --
def accept(sock):
client, addr = sock.accept()
inside = socket(fileno=client.fileno())
print(inside)
# <__main__.Socket fd=5, family=AddressFamily.AF_INE
YoSTEALTH added the comment:
Christian thank you for your reply, i really appreciate it.
Lets analyze this a bit:
- Technically speaking i can "return client" directly and it would NOT close
the socket.
- Shouldn't "inside" having reference to same fd mean +1 to refe
YoSTEALTH added the comment:
It would be nice if "python" accounted for such low level os things. None the
less client.detach() method works fine.
I really did enjoy your talk, kinda bummed it was short and didn't get into
more details.
Thanks for your help and pat
New submission from YoSTEALTH :
I tried to install python3.7.0a3 just to test it out and i keep getting error:
Traceback (most recent call last):
File "/tmp/psi/Python-3.7.0a3/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/t
YoSTEALTH added the comment:
Yes, it does work without pip.
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/i
New submission from YoSTEALTH :
improved "copyfileobj" function to use less memory
--
messages: 309784
nosy: YoSTEALTH
priority: normal
pull_requests: 5004
severity: normal
status: open
title: improved shutil.py function
type: performance
versions:
YoSTEALTH added the comment:
I can't at the moment, i am out of country for couple more months.
--
___
Python tracker
<https://bugs.python.org/is
New submission from YoSTEALTH :
How about adding basic "mime_type" method to "pathlib.Path" ?
Code would do something like:
import mimetypes
def mime_type(name):
"""Mime-type of the file."""
find = name.rfind(
New submission from YoSTEALTH :
When a user uses from import, there is a flaw in how mimetype.init() updates
its global references.
# Option-1 (flawed)
# -
from mimetypes import init, types_map
print(types_map.get('.gz')) # None
init() # <- initialize
print(
Change by YoSTEALTH :
--
components: -Extension Modules
___
Python tracker
<https://bugs.python.org/issue34926>
___
___
Python-bugs-list mailing list
Unsub
New submission from YoSTEALTH:
Type Hints Syntax
-
Goal: Is to make it easy to read function/methods arguments, yet keep the new
and cool Type Hints.
For example this is a code from one of my function. Its getting to that point
of what the heck is going on here?
def
YoSTEALTH added the comment:
I was told to post this in python-ideas and also i totally missed the most
important part (type aliases) in my example (rushed it)
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issu
New submission from YoSTEALTH:
Link:
https://docs.python.org/3/library/contextlib.html#contextlib.ContextDecorator
"from contextlib import ContextDecorator
class mycontext(ContextBaseClass, ContextDecorator):"
"ContextBaseClass" is referenced but its no where t
YoSTEALTH added the comment:
@SilentGhost
You are right, I see it now!
If this is the case maybe "ContextBaseClass" should be changed to
"UserDefinedContextClass" (or something...) having "Base" in the class name was
confusing, since module "io" has IO
YoSTEALTH added the comment:
typo:
def ContextBase:
to
class ContextBase:
--
___
Python tracker
<http://bugs.python.org/issue29134>
___
___
Python-bugs-list mailin
New submission from YoSTEALTH:
TimeoutError isn't being raised?
My Python Version: 3.5.1 (64bit, linux)
# Document:
https://docs.python.org/3/library/exceptions.html#TimeoutError
""" exception TimeoutError
Raised when a system function timed out at the system level. C
Changes by YoSTEALTH :
--
resolution: -> not a bug
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue29186>
___
___
Python-bugs-list
New submission from YoSTEALTH:
I read this new article that explains Typosquatting well:
http://incolumitas.com/2016/06/08/typosquatting-package-managers/ making it
known here so python developers can address this issue accordingly!
--
messages: 268692
nosy: YoSTEALTH
priority: normal
New submission from YoSTEALTH:
# Link: https://docs.python.org/3/library/itertools.html#itertools-recipes
# Function pairwise() in Itertools -> Recipes could be improved!? Here is the
code:
import time
import itertools
def pairwise(iterable):
"s -> (s0,s1), (s1,s2), (s2, s3),
YoSTEALTH added the comment:
Tim, I get what you are saying good point.
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue27751>
___
_
New submission from YoSTEALTH:
# Maybe a Recipe for itertools
from collections.abc import Iterable
def flatten_all(iterable):
# -> 'one'
# <- ['one']
# -> ['one', [b'two', b'three'], ['four', ('five'
YoSTEALTH added the comment:
Currently there is flatten() function in itertools Recipes section. This is
what it does:
-> a = ['one', 'plus', [b'two', b'three'], ['four', ('five', (1, {'e', 'ee'},
(2, (3,
YoSTEALTH added the comment:
note: sqlite_namedtuplerow.patch _cache method conflicts with attached database
with say common table.column name like "id"
Using namedtuple method over sqlite3.Row was a terrible idea for me. I thought
namedtuple is like tuple so should be faster then d
New submission from YoSTEALTH:
A very simple but useful enhancement for shutil.chown function
Currently "shutil.chown" function effects only one directory or file user/group
permission by adding "recursive" parameter it can easily effect all
sub-directories/
YoSTEALTH added the comment:
I am new to this, not exactly sure how to go about doing that!
--
___
Python tracker
<http://bugs.python.org/issue25790>
___
___
Pytho
YoSTEALTH added the comment:
Thanks David.
I hope this is what a patch file should be! Attached.
--
keywords: +patch
Added file: http://bugs.python.org/file41230/shutil.patch
___
Python tracker
<http://bugs.python.org/issue25
YoSTEALTH added the comment:
Can this chowntree() function proposed here be implemented? It would have saved
me a bunch of time and its a good feature to have.
--
nosy: +YoSTEALTH, r.david.murray
___
Python tracker
<http://bugs.python.
90 matches
Mail list logo