[issue16756] buggy assignment to items of a list created by a * operator

2012-12-23 Thread jp

New submission from jp:

The following code: 

li = [[1,0]]*5
a = [[1,10], [2,20], [3,30]]
for line in a:
li[line[0]][0] = 2
print(li)

prints [[2,0],[2,0],[2,0],[2,0],[2,0]], but should print 
[[1,0],[2,0],[2,0],[2,0],[1,0]]. 

The output is correct if you, instead of using li = [[1,0]]*5, initialize the 
array as follows:

li = []
for i in range(5): li.append([1,0])

--
components: Interpreter Core
messages: 177995
nosy: jenda.pet...@gmail.com
priority: normal
severity: normal
status: open
title: buggy assignment to items of a list created by a * operator
versions: Python 3.3

___
Python tracker 
<http://bugs.python.org/issue16756>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22177] Incorrect version reported after downgrade

2014-08-09 Thread jp

New submission from jp:

After downgrading from version 2.7.8 to 2.7.5 on Win7 x86 32bit Python, the 
interpreter continues to report version 2.7.8.

I have verified that the installation folder has the correct files belonging to 
2.7.5 as evidenced by python.exe having a 2013 timestamp. 

Ran python -V at windows CMD and sys.version in interpreter, both report 2.7.8.

--
messages: 225114
nosy: jpe5605
priority: normal
severity: normal
status: open
title: Incorrect version reported after downgrade
type: behavior
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue22177>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22177] Incorrect version reported after downgrade

2014-08-09 Thread jp

jp added the comment:

Forget to mention this downgrade was installed over the existing python 
installation.

--

___
Python tracker 
<http://bugs.python.org/issue22177>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22177] Incorrect version reported after downgrade

2014-08-09 Thread jp

jp added the comment:

Have you checked if there are pyc files left around by the previous 
installation? -- Yes, hundreds! After making a backup, i deleted all 900+ 
occurrences of "*.pyc" in c:\python27 and it still reports 2.7.8.

Have you specified the full path to python.exe from cmd while running python 
-V?-- Yes, i've attached the console output

If you start the interpreter and print sys.version what do you get?  Does 
anything change if you reload(sys)? -- 2.7.8 again, no.

--
Added file: http://bugs.python.org/file36329/console.txt

___
Python tracker 
<http://bugs.python.org/issue22177>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46966] c_void_p array is a footgun on I32LP64 systems

2022-03-08 Thread JP Sugarbroad


New submission from JP Sugarbroad :

The following code will likely crash on I32LP64 systems:

dim = lib.get_array_size(opaque)
ptrs = (c_void_p * dim)()
lib.get_array_values(opaque, ptrs)
for ptr in ptrs:
print(lib.get_object_value(ptr))

What happens is that `ptr` is not a `c_void_p` -- it's just a bare number. And 
when it's passed to another function it goes in as a (32-bit) `c_int`, 
resulting in a truncation.

I'm not sure what can be done here (maybe a truncation warning?) but it's 
definitely a difficult bug to notice when reviewing code.

--
components: ctypes
messages: 414783
nosy: taralx
priority: normal
severity: normal
status: open
title: c_void_p array is a footgun on I32LP64 systems
type: behavior
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46966>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46966] c_void_p array is a footgun on I32LP64 systems

2022-03-09 Thread JP Sugarbroad


JP Sugarbroad  added the comment:

That matches our expectation. A subclass works - perhaps `c_void_p` could be 
deprecated in favor of a built-in subclass for generic opaque pointers as well?

Glad you agree that a warning would be useful here.

--

___
Python tracker 
<https://bugs.python.org/issue46966>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36561] Python argparse doesn't work in the presence of my custom module

2019-04-08 Thread JP Zhang


New submission from JP Zhang :

Github repo for reproducing: https://github.com/zjplab/gc-mc-pytorch/tree/bug, 
test.py. 

In the presence of my custom data_loader, it will error as unrecognized 
argument. But without importing it(comment it out) everything is just fine.

--
components: Library (Lib)
messages: 339646
nosy: JP Zhang
priority: normal
severity: normal
status: open
title: Python argparse doesn't work in the presence of my custom module
versions: Python 3.7

___
Python tracker 
<https://bugs.python.org/issue36561>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36561] Python argparse doesn't work in the presence of my custom module

2019-04-08 Thread JP Zhang


JP Zhang  added the comment:

>>>python test.py --num_epochs 200
usage: test.py [-h] [--data_type DATA_TYPE]
test.py: error: unrecognized arguments: --num_epochs 200

I have a created a colab share link. You can check: 
https://colab.research.google.com/drive/1TUvt4CCv2d43GD1ccmuRNBJlkbUPXN8Z

--

___
Python tracker 
<https://bugs.python.org/issue36561>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15994] memoryview to freed memory can cause segfault

2018-10-08 Thread JP Sugarbroad


Change by JP Sugarbroad :


--
nosy: +taralx

___
Python tracker 
<https://bugs.python.org/issue15994>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10292] tarinfo should use relative symlinks

2010-11-01 Thread JP St. Pierre

New submission from JP St. Pierre :

With all the tools I've used, the target of a symlink appears to be relative to 
the actual symlink entry. Fix this.

--
components: Library (Lib)
messages: 120208
nosy: magcius
priority: normal
severity: normal
status: open
title: tarinfo should use relative symlinks
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue10292>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10292] tarinfo should use relative symlinks

2010-11-01 Thread JP St. Pierre

Changes by JP St. Pierre :


--
keywords: +patch
Added file: http://bugs.python.org/file19462/tarinfo-10292.diff

___
Python tracker 
<http://bugs.python.org/issue10292>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7552] uploading fails on long passwords

2009-12-20 Thread JP St. Pierre

New submission from JP St. Pierre :

Uploading a file to PyPI fails when a user has a long password, as
base64.encodestring linewraps data. Either replace '\n' with '', or use
base64.standard_b64encode

--
assignee: tarek
components: Distutils
messages: 96709
nosy: magcius, tarek
severity: normal
status: open
title: uploading fails on long passwords
versions: Python 2.6

___
Python tracker 
<http://bugs.python.org/issue7552>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7552] uploading fails on long passwords

2009-12-20 Thread JP St. Pierre

JP St. Pierre  added the comment:

This patch should fix the bug.

--
keywords: +patch
Added file: http://bugs.python.org/file15631/auth_7552.patch

___
Python tracker 
<http://bugs.python.org/issue7552>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com