New submission from Oren :
In python2, calling Handler.handleError may not be strictly correct, but it
doesn't raise an exception. However, this has regressed since this patch:
https://hg.python.org/cpython/rev/d7b868cdd9bb
$ cat logbug.py
import logging
class CustomHandler(logging.Ha
Oren added the comment:
I realize that there is a legitimate argument that handleError() is being used
wrong in the example, but since it used to work, it'd be nice if it still did.
I came across this after converting a codebase to python3 and it took a while
for this problem to a
Change by Oren :
--
nosy: +vinay.sajip
___
Python tracker
<https://bugs.python.org/issue34086>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren added the comment:
I totally agree that this involves misusing handleError. I ended up fixing the
code that originally caused the problem, since it was wrong in the first place.
The reason I filed this bug and that I think it's worth fixing is that in
previous versions, the pr
Oren added the comment:
The code that was causing this problem looked something like:
--
def emit(self, record):
...
response = requests.post(...)
if not response.ok:
self.handleError(record)
...
--
In this case, something does apparently go wrong, but it doesn't act
Oren added the comment:
You're right - I misread those examples, sorry about that. It looks like my
former colleague may have invented the bad code in question.
I'm ok with closing as "not a bug" - I do think not fixing it adds a small
potential friction for people upg
Oren Held added the comment:
Anything wrong with the following simple approach? (e.g. is it bad to depend on
win32file?)
def win_ismount(path):
import win32file
volume_path = win32file.GetVolumePathName(path)
return volume_path == path # May have to ignore a trailing backslash
Oren Held added the comment:
Any tip on how to make this patch get committed? :)
--
___
Python tracker
<http://bugs.python.org/issue11102>
___
___
Python-bug
Oren Held added the comment:
ajaksu2: the ticket you referred to fixed it for Darwin only, afaik. HP-UX,
regardless of versions, still use the old dynload_hpux.c.
--
nosy: +Oren_Held
___
Python tracker
<http://bugs.python.org/issue1516
Changes by Oren Held :
--
nosy: +Oren_Held
___
Python tracker
<http://bugs.python.org/issue1487481>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Held added the comment:
Just adding some info:
This bug is not Solaris-specific; I reproduced it on HP-UX 11.31.
On Python 2.6.4, thread_test.py fails with the same RunTime error exception.
On Python 2.6.6, it passes and things look good.
--
nosy: +Oren_Held
Oren Held added the comment:
I confirm that on Python 2.7.1, on HP-UX 11.31, ia64 architecture).
dlmalloc.c is the problematic file, a part of libffi.
I reported the same problem and solution + patch in here:
http://sourceware.org/ml/libffi-discuss/2010/msg00203.html
--
nosy
New submission from Oren Held :
In the "what's new in 2.7", there is some mistake in the description of issue
7902.
7902, afaik, disables the fallback to absolute import, when requesting a
relative import fails. If I got it right, the description states the opposite.
New submission from Oren Held :
The effect eventually is that on HP-UX v3 there are no os.major() and
os.minor() functions.
I tried to dig deeper to find out what's wrong, and it seems that 'configure'
script fails on 'major' check and thus disables the 'majo
Oren Held added the comment:
Attaching a patch I've made for fixing the problem in HP-UX, simply by
#including sys/types.h on the configure test..
1. I'm not sure it'll be good for all platforms; maybe we need more 'configure'
magic here to make it #include on this
Oren Held added the comment:
Just a small note: after this patch applied, building Python 2.7.1 was
successful on Linux (SLES 11, RHEL 5, Ubuntu 10.10), Solaris 10, and HP-UX 11
v3. (I didn't get to build Python on other platforms)
--
___
P
Oren Held added the comment:
quick update: libffi (upstream) has this fixed now in git commit dc411e8f991 .
--
___
Python tracker
<http://bugs.python.org/issue10
New submission from Oren Tirosh <[EMAIL PROTECTED]>:
The comments in the following modules contain references to PEP 291 or
to remaining compatible with version 2.x. However, they all include non
backward compatible python 3 syntax like "except x as y".
decimal.py
modulefind
Changes by Oren Held :
--
nosy: +Oren_Held
___
Python tracker
<http://bugs.python.org/issue7902>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Oren Held :
A. Description
When running os._execvpe with a relative pathname that does not exist, I'd
expect to get ENOENT error. But there is an edge case in which Python throws
ENOTDIR error - when the LAST element in PATH is a regular file (e.g. /bin/ls).
This ca
Changes by Oren Held :
--
title: _execvpe should behaves inconsistently when PATH includes a filename ->
_execvpe behaves inconsistently when PATH includes a filename
___
Python tracker
<http://bugs.python.org/iss
Oren Milman added the comment:
How do we proceed?
should I update (if needed) each of the patches I uploaded in March
to eliminate commit conflicts? or can someone review them as they are
now?
--
___
Python tracker
<http://bugs.python.org/issue15
New submission from Oren Milman:
in listobject.c, in case list_extend() receives an 'iterable' which isn't 'self'
nor a tuple nor a list, we have the following (heavily edited for brevity):
mn = Py_SIZE(self) + PyObject_LengthHint(iterable);
list_resize(self,
New submission from Oren Milman:
in Objects/object.c, Py_ReprEnter() does the following:
- try to retrieve the Py_Repr list from the thread-state dict.
- in case the list is not in the dict, add it to the dict as an empty list.
- check whether the received object is in the Py_Repr
Changes by Oren Milman :
--
title: a mostly useless check in list_extend() -> a suboptimal check in
list_extend()
___
Python tracker
<http://bugs.python.org/issu
Oren Milman added the comment:
thank you for the elaborate reply :)
do you feel the same about changing the check to
(Py_SIZE(self) < (self->allocated >> 1)) ?
--
___
Python tracker
<http://bugs.python
Oren Milman added the comment:
I replied to your comments in Rietveld, Serhiy.
(http://bugs.python.org/review/28261)
also, i found two places with a quite similar issue:
- in Objects/exceptions.c in ImportError_init:
>>> ImportError(1, 2, 3, 4, a=5, b=6, c=7)
Traceback (mo
Oren Milman added the comment:
After more looking, I found this issue in two more places:
- in Modules/itertoolsmodule.c in product_new:
>>> itertools.product(0, a=1, b=2, c=3, d=4, e=5, f=6)
Traceback (most recent call last):
File "", line 1, in
TypeError:
Changes by Oren Milman :
--
title: Deprecated silent truncations in socket.htons and socket.ntohs. ->
silent truncations in socket.htons and socket.ntohs
___
Python tracker
<http://bugs.python.org/issu
Changes by Oren Milman :
--
title: silent truncations in socket.htons and socket.ntohs -> keyword arguments
___
Python tracker
<http://bugs.python.org/issu
Changes by Oren Milman :
--
title: keyword arguments -> Deprecated silent truncations in socket.htons and
socket.ntohs.
___
Python tracker
<http://bugs.python.org/issu
Changes by Oren Milman :
--
pull_requests: +3157
___
Python tracker
<http://bugs.python.org/issue28261>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Oren Milman:
Some functions produce wrong error messages in case they receive too many
keyword arguments:
- in Objects/exceptions.c - ImportError_init:
>>> ImportError(1, 2, 3, 4, a=5, b=6, c=7)
TypeError: ImportError() takes at most 2 arguments (3 given)
-
Changes by Oren Milman :
--
keywords: +patch
Added file: http://bugs.python.org/file47091/issue31229_ver1.diff
___
Python tracker
<http://bugs.python.org/issue31
New submission from Oren Milman:
currently, we have the following:
>>> min(0, a=1)
TypeError: 'a' is an invalid keyword argument for this function
>>> max(0, a=1)
TypeError: 'a' is an invalid keyword argument for this function
>>>
Changes by Oren Milman :
--
pull_requests: +3181
___
Python tracker
<http://bugs.python.org/issue31236>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
I am not sure I understood your question, Igor.
I compiled with https://github.com/python/cpython/pull/3006, and got:
class T(ctypes.Array):
_type_ = ctypes.c_int
_length_ = 2 ** 1000
Traceback (most recent call last):
File "&quo
Changes by Oren Milman :
--
pull_requests: +3199
___
Python tracker
<http://bugs.python.org/issue29832>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
here is a dirty script to test my PR.
the script contains tests to anything I managed to test using my
Windows 10 and Ubuntu 16.04 VM, i.e. all of the changes, except for
the 'unsupported CAN protocol' message, and the changes of the code
that h
New submission from Oren Milman:
according to the docs
(https://docs.python.org/3.7/c-api/arg.html?highlight=pyarg_parsetuple#c.PyArg_ParseTuple),
PyArg_ParseTuple
returns true for success or false for failure. I also looked at the
implementation in Python/getargs.c, and it seems that indeed
Oren Milman added the comment:
it seems that I have missed some places which are part of this issue, at least
in Modules/_io/textio.c (one of them is mentioned in #31243).
also, when fixing these, we should also add a check before the call to
PyArg_ParseTuple (in case such check doesn't al
Oren Milman added the comment:
yes, soon.
(just wanted to hear your opinion before doing that.)
--
___
Python tracker
<http://bugs.python.org/issue31243>
___
___
Oren Milman added the comment:
I already wrote a patch, but I thought it would be better to wait until
#31236 is resolved.
this is because #31236 would change the error messages of min() and max(), and
test_call tests exact error messages in
CFunctionCallsErrorMessages, which is where I thought
Changes by Oren Milman :
--
pull_requests: +3208
___
Python tracker
<http://bugs.python.org/issue31243>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Oren Milman :
--
pull_requests: +3218
___
Python tracker
<http://bugs.python.org/issue31229>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Oren Milman :
--
pull_requests: +3237
___
Python tracker
<http://bugs.python.org/issue28261>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Oren Milman:
currently, the following causes an assertion in Modules/_io/textio.c in
_io_TextIOWrapper_write_impl() to fail:
import codecs
import io
class BadEncoder():
def encode(self, dummy):
return 42
def _get_bad_encoder(dummy):
return BadEncoder
Changes by Oren Milman :
--
pull_requests: +3240
___
Python tracker
<http://bugs.python.org/issue31271>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
Just checked on current 3.6 on my Windows 10.
The assertion failes, and it is in line 1337.
oh my.
--
___
Python tracker
<http://bugs.python.org/issue31
Oren Milman added the comment:
As Serhiy pointed out on github, the assertion failure can be easily reproduced
by the following:
import codecs
import io
rot13 = codecs.lookup("rot13")
rot13._is_text_encoding = True
t = io.TextIOWrapper(io.BytesIO(b'foo'), encoding=&
Oren Milman added the comment:
sure
--
___
Python tracker
<http://bugs.python.org/issue28261>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Oren Milman added the comment:
all three versions do 'self->pending_bytes_count += PyBytes_GET_SIZE(b);',
while 'b' is the object the encoder returned.
in 3.6 and 3.7, the implementation of PyBytes_GET_SIZE() includes
'assert(PyBytes_Check(op))',
Changes by Oren Milman :
--
pull_requests: +3247
___
Python tracker
<http://bugs.python.org/issue31271>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Oren Milman :
--
pull_requests: +3248
___
Python tracker
<http://bugs.python.org/issue28261>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Oren Milman :
--
pull_requests: +3251
___
Python tracker
<http://bugs.python.org/issue28261>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Oren Milman:
1.
the following causes an assertion failure in Python/_warnings.c in
show_warning():
import warnings
class BadLoader:
def get_source(self, fullname):
class BadSource:
def splitlines(self):
return [42]
return
Oren Milman added the comment:
on a second thought, BadSource could be a subclass of str, so maybe we
should just check whether
module_globals['__loader__'].get_source(module_globals['__name__']).splitlines()[lineno-1]
is a str,
and whether
module_globals['__loader__
Changes by Oren Milman :
--
pull_requests: +3259
___
Python tracker
<http://bugs.python.org/issue31285>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Oren Milman:
on Windows, assuming the file 'foo.zip' exists, the following would cause an
assertion failure in Modules/zipimport.c in
zipimport_zipimporter_get_data_impl():
import zipimport
class BadStr(str):
def replace(self, old, new):
Changes by Oren Milman :
--
pull_requests: +3269
___
Python tracker
<http://bugs.python.org/issue31291>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
ISTM that your solution is better than mine, Serhiy, so I updated the PR.
--
___
Python tracker
<http://bugs.python.org/issue31
New submission from Oren Milman:
both of the following true division and multiplication operations crash the
interpreter:
import datetime
class BadFloat(float):
def as_integer_ratio(self):
return (1 << 1000) - 1
datetime.timedelta() / BadFloat()
datetime.timedelta() * Ba
Oren Milman added the comment:
i am working on a patch.
BTW, is there anywhere a list of what counts as an extension
module, and what counts as the interpreter core?
--
___
Python tracker
<http://bugs.python.org/issue31
Changes by Oren Milman :
--
pull_requests: +3270
___
Python tracker
<http://bugs.python.org/issue31293>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
I guess you meant for me to check whether the following has any problem:
import decimal
class BadFloat(float):
def as_integer_ratio(self):
return 1 << 1000
decimal.Decimal.from_float(BadFloat())
so it doesn't crash.
if IIUC, this is be
Oren Milman added the comment:
I understand that our goal is to make Python better, not to make me happier :)
anyway, I haven't checked, but I am quite sure that similar code might
crash the interpreter on a release build of Python.
(just wanted to clarify that, as you used the term '
Oren Milman added the comment:
just checked, and indeed on my Windows 10 the original code I posted here
crashes the interpreter.
The patch in the PR undermines duck-typing, and that's why I added a comment
there, stating I wasn't sure about the patch.
an alternate solution would be
Changes by Oren Milman :
--
pull_requests: +3275
___
Python tracker
<http://bugs.python.org/issue31243>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Oren Milman :
--
pull_requests: +3276
___
Python tracker
<http://bugs.python.org/issue31243>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Oren Milman :
--
pull_requests: +3287
___
Python tracker
<http://bugs.python.org/issue31291>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Oren Milman:
The following code causes PyCData_setstate() (in Modules/_ctypes/_ctypes.c) to
raise a SystemError:
import ctypes
class BadStruct(ctypes.Structure):
def __dict__(self):
pass
BadStruct().__setstate__({}, b'foo')
this is because PyCDat
Oren Milman added the comment:
typo - change the format to "O!s#"
--
___
Python tracker
<http://bugs.python.org/issue31311>
___
___
Python-bugs-l
Changes by Oren Milman :
--
title: SystemError raised by PyCData_setstate() in case __dict__ is not a dict
-> a SystemError and a crash in PyCData_setstate() when __dict__ is bad
___
Python tracker
<http://bugs.python.org/issu
Changes by Oren Milman :
--
pull_requests: +3298
___
Python tracker
<http://bugs.python.org/issue31311>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Oren Milman :
--
pull_requests: +3299
___
Python tracker
<http://bugs.python.org/issue31311>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Oren Milman :
--
components: +ctypes -Extension Modules
___
Python tracker
<http://bugs.python.org/issue31311>
___
___
Python-bugs-list mailin
New submission from Oren Milman:
The following code causes an assertion failure in get_encoded_name(), which is
called by _PyImport_LoadDynamicModuleWithSpec() (in Python/importdl.c):
import imp
class BadSpec:
name = 42
origin = 'foo'
imp.create_dynamic(BadSpec())
this
Oren Milman added the comment:
do you mean that we should fix it to raise a TypeError?
the assertion is there, but not explicitly.
get_encoded_name() calls PyUnicode_FindChar(), which calls
PyUnicode_READY(), which does assert(_PyUnicode_CHECK).
so i get:
>>> import imp
>>>
Changes by Oren Milman :
--
pull_requests: +3301
___
Python tracker
<http://bugs.python.org/issue31315>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Oren Milman:
at least on my Windows, the following code:
import sys
sys.modules = []
- when run interactively, causes weird behavior, e.g. exit() doesn't exit the
interpreter, and print() doesn't print.
then, pressing Ctrl+C causes 'Assertion failed:
Oren Milman added the comment:
just in case it was missed - I have opened two PRs for this issue.
--
___
Python tracker
<https://bugs.python.org/issue31
New submission from Oren Milman:
The following code crashes the interpreter:
import decimal
import fractions
class BadRational(fractions.Fraction):
numerator = None
denominator = 42
decimal.Decimal() < BadRational()
this is because numerator_as_decimal() (in Modules/_deci
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3467
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31406>
___
___
Py
New submission from Oren Milman:
The following code causes warn_explicit() (in Python/_warnings.c) to raise a
SystemError:
import warnings
warnings.filterwarnings('once')
warnings.onceregistry = None
warnings.warn_explicit(message='foo', category=Wa
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3475
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31411>
___
___
Py
New submission from Oren Milman:
The following code causes an assertion failure in warn_explicit() (in
Python/_warnings.c):
import warnings
warnings.filters = [(None, None, Warning, None, 0)]
warnings.warn_explicit(message='foo', category=Warning, filename='bar',
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3489
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31416>
___
___
Py
New submission from Oren Milman:
The following code causes an assertion failure in PyErr_WriteUnraisable() (in
Python/errors.c):
class BadException(Exception):
__module__ = None
class BadClass:
def __del__(self):
raise BadException
foo = BadClass()
del foo
this is because
New submission from Oren Milman:
The following code causes ElementTree.Element.__deepcopy__() to raise a
SystemError:
class BadMemo:
def get(*args):
return None
import xml.etree.ElementTree
xml.etree.ElementTree.Element('foo').__deepcopy__(BadMemo())
this
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3507
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
New submission from Oren Milman:
the following code causes an assertion failure on my Windows:
import io
def _bad_open(*args):
return 42
io.open = _bad_open
1/0
this is because _Py_DisplaySourceLine() (in Python/traceback.c) assumes that
the return value of io.open() is valid.
IIUC, this
New submission from Oren Milman:
the following code causes a ResourceWarning:
import io
def _bad_TextIOWrapper(*args):
return None
io.TextIOWrapper = _bad_TextIOWrapper
1/0
this is because _Py_DisplaySourceLine() (in Python/traceback.c) assumes that
io.TextIOWrapper() returned a stream
Oren Milman added the comment:
what do you mean by 'Implicit converting to str can raise a warning or
exception if __module__ is a bytes object.'?
should we treat __module__ differently in case it is a bytes object?
--
___
Python track
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3534
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31418>
___
___
Py
New submission from Oren Milman:
The following code causes an assertion failure on Windows:
class BadEnv(dict):
keys = None
import subprocess
import sys
subprocess.Popen([sys.executable, "-c", "pass"], env=BadEnv())
this is because getenvironment() (in Modu
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3570
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
New submission from Oren Milman:
The following code causes an assertion failure:
class BadInt(int):
def __abs__(self):
return None
import random
random.seed(BadInt())
this is because random_seed() (in Modules/_randommodule.c) assumes that
PyNumber_Absolute() returned an int, and
Oren Milman added the comment:
in 2.7 getenvironment() is in PC/_subprocess.c, and it also calls
PyMapping_Values()
immediately after calling PyMapping_Keys().
however, _PyObject_FastCallDict() doesn't exist here.
in case of an error in both PyMapping_Keys() and PyMapping_Values(), the
err
Oren Milman added the comment:
sure.
but what about the TypeError message? should it complain about
the return value of abs(seed)? (the docs of random.seed don't mention abs().)
--
___
Python tracker
<https://bugs.python.org/is
Oren Milman added the comment:
OK.
but there isn't an assertion failure to test in 2.7, so is adding a test
still relevant?
--
___
Python tracker
<https://bugs.python.org/is
1 - 100 of 383 matches
Mail list logo