Campbell Barton added the comment:
Note, this bug is something we ran into in Blender, see:
https://developer.blender.org/T84752
--
___
Python tracker
<https://bugs.python.org/issue35
Campbell Barton added the comment:
Could this fix be applied to Python 3.7x?
Currently the visual effects platform for 2021 is using Python 3.7.x, see:
https://vfxplatform.com
Which means anyone using the VFX platform can run into this bug.
--
nosy: +ideasman42
Campbell Barton added the comment:
This patch is still relevant, mentioning this since the patch is from a while
ago.
--
___
Python tracker
<https://bugs.python.org/issue9
Campbell Barton added the comment:
Edit:
When calling 'PyDict_DelItem' on a key that isn't in the dictionary, a
'KeyError' is raised. This is not documented.
>From reading the current documentation, it only seems as if an error is raised
>if the key can't be
New submission from Campbell Barton :
When calling 'PyDict_DelItem' on a key that isn't in the hash a KeyError is
raised. This is not documented.
--
components: C API
messages: 377053
nosy: ideasman42
priority: normal
severity: normal
status: open
title: Missing documentation
Campbell Barton <ideasma...@gmail.com> added the comment:
Thanks for the info, in that case will there be a way to do this from the
CPython API which can work with raw strings? (utf8, wchat_t or similar types),
that doesn't require the GIL and alloc/free of PyO
New submission from Campbell Barton <ideasma...@gmail.com>:
Py_UNICODE_TOLOWER / Py_UNICODE_TOUPPER are marked as deprecated in the docs.
https://docs.python.org/3/c-api/unicode.html?highlight=py_unicode_tolower#c.Py_UNICODE_TOLOWER
Someone submitted a patch to our project whic
Campbell Barton added the comment:
@serhiy.storchaka, while a properly working function that uses getrandbits
isn't so complex, its not trivial either.
It needs to create smaller chunks and join them (also check zero size case
which raises an error if passed).
eg:
```
def
Campbell Barton added the comment:
@r.david.murray, yes, this avoids list creation, but is still quite slow.
To create 1mb of data, you can compare the following:
python -m timeit -s 'from os import urandom' 'print(len(urandom(100)))'
python -m timeit -s 'from random import
Campbell Barton added the comment:
Correction, meant to write: random.randbytes(n).
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
New submission from Campbell Barton:
Currently, getting random bits can be done with os.urandom,
However recently I was faced with having to make a test (with reproducible
behavior), so I needed to replace os.urandom with a random generator that took
a seed value.
It turns out there are 3
Campbell Barton added the comment:
@rhettinger, agree that very large ints in this case aren't going to give very
usable results.
On the other hand, this limit isn't imposed elsewhere (you can power-of
operator to create bigger numbers).
Nevertheless this isn't going to give good/usable
Campbell Barton added the comment:
> This probably isn't an issue on non-Windows or 64-bit systems.
In fact it is, the limitation applies to 64bit Linux too. (tested in CPython
3.5.1)
--
nosy: +ideasman42
___
Python tracker <rep...@bugs.pyth
Campbell Barton added the comment:
@haypo, I checked available info online and couldn't find any reference to byte
file-paths were deprecated since Python3.2.
On the contrary, the 3.2 release notes [0] state:
"countless fixes regarding bytes/string issues; among them full su
Changes by Campbell Barton ideasma...@gmail.com:
--
resolution: out of date - remind
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15859
Campbell Barton added the comment:
Updated the patch for '93049:d9a3d23cf8f0'
Note, the link for the original bug report has changed: See
https://developer.blender.org/T31856
--
status: closed - open
Added file: http://bugs.python.org/file36913/fix_unicode_v2.diff
Campbell Barton added the comment:
Hi, I just found a use for this feature, with `use_subprocess` being optional
its possible to load idle into a running python session.
--
import idlelib
import idlelib.PyShell
idlelib.PyShell.main()
--
This allows you to load idle inside
Campbell Barton added the comment:
@Roger, I should have mentioned I had to add -n to the argv so subprocess
would be disabled.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16123
Campbell Barton added the comment:
patch attached, simply wraps putenv()
--
keywords: +patch
Added file: http://bugs.python.org/file28144/pyos_putenv.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16129
Campbell Barton added the comment:
Agree PyOS_PutEnv would be good since its not restricted to string encoding and
resolves the problem of not being able to control env vars for an embedded
interpreter in general.
Having ways to change encoding is good too but a bit outside the scope
New submission from Campbell Barton:
note, I was asked to report this issue, posted on the py dev mailing list: see
- http://code.activestate.com/lists/python-dev/118015/
---
We've run into an issue recently with blender3d on ms-windows where we
want to enforce the encoding is UTF-8
Changes by Campbell Barton ideasma...@gmail.com:
--
components: +Unicode, Windows
nosy: +ezio.melotti
versions: +Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15859
New submission from Campbell Barton:
There is an inconsistency in PyUnicode_EncodeFSDefault(), on Linux its argument
is checked to be unicode, and NULL is returned when its not. On windows
however, this throws an assertion.
The problem with this is, in some CAPI code you may pass an argument
Campbell Barton ideasma...@gmail.com added the comment:
Shouldn't it be documented that it changes still? - since people are using
pytjon3.2 and its a stable release, _any_ breaking change should be documented
IMHO
--
___
Python tracker rep
New submission from Campbell Barton ideasma...@gmail.com:
In python 3.2 this works and prints class '__main__.Test',
in cpython hg: 71296:ab162f925761 it fails with:
NameError: global name '__class__' is not defined
Since this change is not documented I assume its a bug.
--- snip ---
class
Campbell Barton ideasma...@gmail.com added the comment:
checked for docs here:
http://docs.python.org/dev/whatsnew/3.3.html
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12530
New submission from Campbell Barton ideasma...@gmail.com:
python3.2mu -c import xml.dom.minidom ;
xml.dom.minidom.parse('gnome-cpu-frequency-applet.svg')
--- gives the following traceback
Traceback (most recent call last):
File string, line 1, in module
File /usr/lib/python3.2/xml/dom
New submission from Campbell Barton ideasma...@gmail.com:
On Linux - tested on: Arch linux @ Debian Squeeze, this fails
python -c __import__('webbrowser').open('http://python.org')
The exception thats raised is:
Traceback (most recent call last):
File string, line 1, in module
File /usr
New submission from Campbell Barton ideasma...@gmail.com:
Hi, Im buildiong blender3d with -Werror and python 3.2 gives an error which
doesnt happen in 3.1.
Tested with SVN r88378. on linux.
---
cc1: warnings being treated as errors
In file included from /opt/py32/include/python3.2d/Python.h
New submission from Campbell Barton ideasma...@gmail.com:
# create this path.
# it could be made by any application but including this line
# so encoding is not confused.
# c:\äöü
__import__(os).mkdir(b'c:\\\xe4\xf6\xfc')
# Now create a new script and save in the newly created dir
c:\äöü
Campbell Barton ideasma...@gmail.com added the comment:
This is fixed in 3.2a4.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10603
New submission from Campbell Barton ideasma...@gmail.com:
Attached is a script which works in linux but not windows XP 32bit with Python
3.1.3.
The problem is that the path can be written to when specified as bytes but when
escaped it fails.
--
components: IO
files
Campbell Barton ideasma...@gmail.com added the comment:
note, this bug was reported to me by a user running windows 7, 64bits.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10600
Campbell Barton ideasma...@gmail.com added the comment:
This bug is with blender3d, were the paths are stored internally in C as simple
char arrays - bytes.
We could expose all path names as bytes too through our C/python API, this
would at least be a 1:1 mapping, however Id prefer using
New submission from Campbell Barton ideasma...@gmail.com:
On linux I have a path which python reads as...
/data/test/num\udce9ro_bad/untitled.blend
os.listdir(/data/test/) returns this ['num\udce9ro_bad']
But the same path cant be given to the C api's Py_CompileString
Where fn is '/data/test
New submission from Campbell Barton ideasma...@gmail.com:
Some parts of the python api expect __main__ module dictionary to be the
namespace when executing a script, this is true when running a python script
from the python binary but NOT true when running a compiled script from the
C/API
New submission from Campbell Barton ideasma...@gmail.com:
Py_SetPythonHome takes a *wchar_t not a *char, this is obvious from
looking at the header,
However I tried using this function and couldn't get it working until I
made the home variable a static string.
when looking at the source
New submission from Campbell Barton ideasma...@gmail.com:
Py_SetPythonHome holds a pointer to the variable passed, this is not
documented so passing a variable on the stack will not work as expected
unless its static or allocated.
--
components: None
messages: 92642
nosy: ideasman42
New submission from Campbell Barton ideasma...@gmail.com:
This patch was made on python r74276
Often when writing in C/Python I want to append to a list within a C
loop of an unknown length.
When this is done for newly created PyObject (which is quite common) -
you need to assign each item
Campbell Barton ideasma...@gmail.com added the comment:
Hi Raymond, in general I agree with your comments that adding 2 ways to
do things is not great. The reason I still think this is an advantage is
that I know the API well enough (with manipulating dicts/lists etc) and
I still want
New submission from Campbell Barton ideasma...@gmail.com:
in python 3.2 (current rev 73893)
Demo/embed/demo.c passes a 'char **' to PySys_SetArgv rather then a
'wsize_t **'
Im also confused as to how this conversion should be made in a portable
way, without copying some farily large static
Changes by Campbell Barton ideasma...@gmail.com:
--
type: - compile error
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6439
___
___
Python-bugs
Campbell Barton ideasma...@gmail.com added the comment:
Thanks for the feedback, I wasnt aware of PyErr_Display, its not
documented as far as I know.
http://docs.python.org/dev/py3k/genindex-all.html
For blender, its development id still in progress so we don't yet have
an internal console
Campbell Barton ideasma...@gmail.com added the comment:
Updated with an PyErr_DisplayEx function that accepts a file argument.
--
Added file: http://bugs.python.org/file14308/PyErr_AsUnicode_r73443.diff
___
Python tracker rep...@bugs.python.org
http
New submission from Campbell Barton ideasma...@gmail.com:
This function returns the output of PyErr_Print as a unicode string.
We needed this in Blender3D because it has its own error logging system
which does not use the console.
The patch is made against python3k r73429
Campbell Barton ideasma...@gmail.com added the comment:
last patch was bad heres a new one.
--
Added file: http://bugs.python.org/file14300/PyErr_AsUnicode_r73429.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6284
Changes by Campbell Barton ideasma...@gmail.com:
Removed file: http://bugs.python.org/file14299/PyErr_AsUnicode_r73429.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6284
Changes by Campbell Barton ideasma...@gmail.com:
Removed file: http://bugs.python.org/file14300/PyErr_AsUnicode_r73429.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6284
Changes by Campbell Barton ideasma...@gmail.com:
Added file: http://bugs.python.org/file14301/PyErr_AsUnicode_r73429.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6284
New submission from Campbell Barton ideasma...@gmail.com:
simple patch, docs say that PyList_GetSlice() works like list[high:low],
but does not say that negative indices's dont work as with python slicing.
--
assignee: georg.brandl
components: Documentation
files: slice.diff
keywords
Changes by Campbell Barton ideasma...@gmail.com:
Removed file: http://bugs.python.org/file13922/slice.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5967
Campbell Barton ideasma...@gmail.com added the comment:
added to setslice too, fixed spelling error.
--
Added file: http://bugs.python.org/file13938/slice.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5967
52 matches
Mail list logo