[issue43197] random.shuffle() returning None

2021-02-10 Thread Pablo


New submission from Pablo :

import random
mylist = ["apple", "banana", "cherry"]
print(random.shuffle(mylist))

Result: None
Expected result: A shuffle list

It works in Python 3.7.3 but it fails in Python 3.8.5 (Ubuntu 20.04.2)

--
messages: 386807
nosy: pablonana
priority: normal
severity: normal
status: open
title: random.shuffle() returning None
type: behavior
versions: Python 3.8

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



[issue43197] random.shuffle() returning None

2021-02-10 Thread Pablo


Pablo  added the comment:

```
import random
mylist = ["apple", "banana", "cherry"]
print(random.shuffle(mylist))
```

Result: None
Expected result: A shuffled list

It works in Python 3.7.3 but it fails in Python 3.8.5 (Ubuntu 20.04.2)

--

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



[issue43197] random.shuffle() returning None

2021-02-10 Thread Pablo


Pablo  added the comment:

random shuffle is supposed to change the list in place.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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



[issue31294] ZeroMQSocketListener and ZeroMQSocketHandler examples in the Logging Cookbook not working

2017-08-28 Thread Pablo

New submission from Pablo:

There are two documentation issues regarding the ZeroMQSocketListener and 
ZeroMQSocketHandler examples in the Logging Cookbook:


The first issue is that in the 'init' method for the 'ZeroMQSocketListener' the 
base class 'init' is never called and therefore the internal variables are not 
correctly initialized. This leads to an empty 'handlers' attribute and a 
undefined 'queue' attribute.

The second issue is that zmq.Socket.send and zmq.Socket.setsockopt only admits 
bytecode variables and therefore it fails in Python3 when using plain strings.

--
assignee: docs@python
components: Documentation
messages: 300960
nosy: docs@python, pablogsal
priority: normal
pull_requests: 3273
severity: normal
status: open
title: ZeroMQSocketListener and ZeroMQSocketHandler examples in the Logging 
Cookbook not working

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



[issue31776] Inconsistent exception chaining in /Lib/xml/etree/ElementPath.py

2017-10-12 Thread Pablo

New submission from Pablo :

Based on bpo-29762 
(https://github.com/python/cpython/commit/5affd23e6f42125998724787025080a24839266e),
 there is an inconsistency on one exception chain in 
/Lib/xml/etree/ElementPath.py:

 try:
 selector.append(ops[token[0]](next, token))
 except StopIteration:
raise SyntaxError("invalid path")

should be

  raise SyntaxError("invalid path") from None

--
components: Library (Lib)
messages: 304288
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Inconsistent exception chaining in /Lib/xml/etree/ElementPath.py
type: behavior

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



[issue31776] Missing "raise from None" in /Lib/xml/etree/ElementPath.py

2017-10-12 Thread Pablo

Change by Pablo :


--
title: Inconsistent exception chaining in /Lib/xml/etree/ElementPath.py -> 
Missing "raise from None" in /Lib/xml/etree/ElementPath.py

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



[issue31776] Missing "raise from None" in /Lib/xml/etree/ElementPath.py

2017-10-12 Thread Pablo

Change by Pablo :


--
keywords: +patch
pull_requests: +3953
stage:  -> patch review

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



[issue29762] Use "raise from None"

2017-10-12 Thread Pablo

Change by Pablo :


--
pull_requests: +3954

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



[issue29696] Use namedtuple in string.Formatter.parse iterator response

2017-10-12 Thread Pablo

Change by Pablo :


--
keywords: +patch
pull_requests: +3956
stage:  -> patch review

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



[issue31780] Using format spec ',x' displays incorrect error message

2017-10-14 Thread Pablo

Change by Pablo :


--
keywords: +patch
pull_requests: +3975
stage: needs patch -> patch review

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



[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-14 Thread Pablo

Change by Pablo :


--
keywords: +patch
pull_requests: +3976
stage:  -> patch review

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



[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-15 Thread Pablo

Pablo  added the comment:

I have added a Pull Request fixing this issue. The current implementation is 
checking in the syscall if the value for ms before rounding was negative.

To test for this, I call poll.poll in a thread and check that the thread is 
alive after a join with timeout (so this means it has blocked). Then to clean 
up, I write to a pipe and therefore it unblocks.

The implementation is available in the PR:

https://github.com/python/cpython/pull/4003

--
nosy: +pablogsal

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



[issue24027] IMAP library lacks documentation about expected parameter types

2015-04-22 Thread Pablo

New submission from Pablo:

I used the IMAP library and I feel it lacks a lot of documentation regarding 
types and encoding.

Example:
IMAP4.list([directory[, pattern]]):
It doesn't state if it expects the directory argument to be an string (unicode) 
or a imap_utf7 encoded string or bytes.
It also expects names with spaces to be between double quotation marks and it 
doesn't state that it returns a bytes raw output.

This is valid for every function that receives a directory or mailbox argument. 
Also for most return values.

Documentation aside, I think it would be a nice improvement in the 
implementation to add an imap_utf7 convertion function, and check every 
directory or mailbox argument to see if it has characters outside the imap_utf7 
charset and attempts to convert them automatically.

--
assignee: docs@python
components: Documentation
messages: 241812
nosy: docs@python, pmoleri
priority: normal
severity: normal
status: open
title: IMAP library lacks documentation about expected parameter types
type: enhancement
versions: Python 3.4

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



[issue24030] IMAP library encoding enhancement

2015-04-22 Thread Pablo

New submission from Pablo:

IMAP library doesn't encode parameters to the required charset.
The library is useful, but when it comes to complex mailbox names, the user 
needs to convert strings to and from the custom imap_utf7 encoding.
I think this conversion could be implemented in the library and applied 
transparently to all the arguments that need it.

Example:
IMAP4.select(mailbox='INBOX', readonly=False):
For the method to work, the mailbox argument needs to be encoded to imap_utf7 
and if it has spaces it needs to be double quoted. All this hassle could be 
handled by the library.

The same applies to every function that uses a mailbox or directory argument.

When it comes to the mailbox argument I can identify the following cases:
a. bytes: It should be treated as an already imap_utf7 encoded string. If 
necessary it can be converted to string using ascii charset.
b. string:
  b.1: It's a valid imap_utf7 string without '&' -> doesn't need encoding. Eg.: 
INBOX
  b.2: An already encoded imap_utf7 string with '&' character -> doesn't need 
encoding. Eg.: Test&AOk-
  b.3: Any other case (invalid imap_utf7 string) -> needs to be encoded

Proposal:
1. Impelement an imap_utf7_encode() method
2. Implement a strict imap_utf7_decode() method, it must return an error if the 
input doesn't conform to imap_utf7 encoding.
3. Implement a method to ensure arguments are in imap_utf7 encoding:
   * bytes -> arg.decode('ascii')
   * string && imap_utf7_decode(arg) -> arg
   * otherwise -> imap_utf7_encode(arg)
   * In every case if it has spaces double quote the whole string
5. In every method that receives a mailbox or directory argument call this new 
method to ensure it's imap_utf7 encoded.

--
components: Library (Lib), email
messages: 241821
nosy: barry, pmoleri, r.david.murray
priority: normal
severity: normal
status: open
title: IMAP library encoding enhancement
type: enhancement
versions: Python 3.6

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



[issue2830] Copy cgi.escape() to html

2010-08-22 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

I'm attaching a patch against py3k trunk that moves the function to the html 
module and fixes the documentation as Brett asked for. It also changes all the 
occurrences of cgi.escape I found for html.escape .

--
keywords: +patch
nosy: +pablomouzo
Added file: http://bugs.python.org/file18612/issue2830.diff

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



[issue2830] Copy cgi.escape() to html

2010-08-23 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

Thanks Georg for the review, I'm attaching a new patch with those problems 
fixed.
The new patch escapes ' when the quote parameter is true, and / always.

--
Added file: http://bugs.python.org/file18619/issue2830.diff

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



[issue2830] Copy cgi.escape() to html

2010-08-23 Thread Pablo Mouzo

Changes by Pablo Mouzo :


Removed file: http://bugs.python.org/file18612/issue2830.diff

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



[issue2830] Copy cgi.escape() to html

2010-08-24 Thread Pablo Mouzo

Changes by Pablo Mouzo :


Removed file: http://bugs.python.org/file18619/issue2830.diff

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



[issue2830] Copy cgi.escape() to html

2010-08-24 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

Sorry about that, I have no idea how I managed to generate that diff.

I'm attaching the correct patch.

About the slash, there's a link in #9061 that recommends to escape the slash 
too because it's used to close tags in HTML. Is there any chance that escaping 
it could cause problems?

--
Added file: http://bugs.python.org/file18636/issue2830.diff

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



[issue2830] Copy cgi.escape() to html

2010-08-28 Thread Pablo Mouzo

Changes by Pablo Mouzo :


Removed file: http://bugs.python.org/file18636/issue2830.diff

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



[issue2830] Copy cgi.escape() to html

2010-08-28 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

I'm attaching a new patch without escaping the slash.

--
Added file: http://bugs.python.org/file18667/issue2830.diff

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



[issue2830] Copy cgi.escape() to html

2010-08-29 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

I'm attaching a new patch with the documentation updated.

I agree with Georg that it'd be better to escape everything by default. Are 
there any good reasons not to?

--
Added file: http://bugs.python.org/file18677/issue2830.diff

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



[issue2830] Copy cgi.escape() to html

2010-08-29 Thread Pablo Mouzo

Changes by Pablo Mouzo :


Removed file: http://bugs.python.org/file18667/issue2830.diff

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



[issue5673] Add timeout option to subprocess.Popen

2010-09-20 Thread Pablo Bitton

Pablo Bitton  added the comment:

Has anybody had a chance to look into the problem I encountered yet?

Do you need more information?

--

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



[issue11664] Add patch method to unittest.TestCase

2011-03-26 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

I'm attaching a draft patch for patch. Éric, is this patch implementing patch 
as you expected?

This patch is not finished because there are many cases where patch can leave 
patched objects if it fails to unpatch.

--
keywords: +patch
nosy: +pablomouzo
Added file: http://bugs.python.org/file21412/patch.diff

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



[issue5673] Add timeout option to subprocess.Popen

2010-12-07 Thread Pablo Bitton

Pablo Bitton  added the comment:

Has anybody had a chance to look into the problem I encountered yet?

Do you need more information?

--

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



[issue7723] sqlite only accept buffer() for BLOB objects (input/output)

2010-01-22 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

I'm attaching a correction to sqlite3 documentation, removing all 'buffer' 
references and setting bytes as BLOB equivalent.

--
keywords: +patch
nosy: +pablomouzo
Added file: http://bugs.python.org/file15977/issue7723-py3k-docs.diff

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



[issue6045] Fix dbm interfaces

2010-01-22 Thread Pablo Mouzo

Changes by Pablo Mouzo :


--
nosy: +pablomouzo

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



[issue7911] unittest.TestCase.longMessage should default to True in Python 3.2

2010-02-25 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

The patch changes the default to True, and updates the tests and the docs to 
reflect this.

--
keywords: +patch
nosy: +pablomouzo
Added file: http://bugs.python.org/file16377/issue7834.diff

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



[issue7300] Unicode arguments in str.format()

2010-03-07 Thread Pablo Mouzo

Changes by Pablo Mouzo :


--
nosy: +pablomouzo

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



[issue4881] Python's timezon handling: daylight saving option

2009-01-08 Thread Pablo Castagnino

New submission from Pablo Castagnino :

Something in python's timezone handling needs to be
updated. Python does not take into account 'daylight saving' clock time
changes.

The thing is my clock time is correct. If you
ask anyone here for the time, they will tell you it's X. However, Python
believes (correct) current time is X + 1 hour. In fact, this is the case
most of the time, but because of 'daylight saving' measures, official
time has been changed. So, without a doubt, this needs to be fixed.

A solution could be adding the possibility to set a 'daylight saving'
option which helps dealing with this. So, if I set this option to 3600
secs, then Python could +/- this remainder to the, let's call it,
'expected current time' according to the timezone.

--
components: Library (Lib)
messages: 79415
nosy: earendili510
severity: normal
status: open
title: Python's timezon handling: daylight saving option
type: feature request

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



[issue4881] Python's timezon handling: daylight saving option

2009-01-09 Thread Pablo Castagnino

Pablo Castagnino  added the comment:

Ok, first of all I want to say I'm no Python programmer/developer.
However, I recently posted a 'bug' for a Linux/Windows program I'm using
very much which is based in Python. The program is called Anki and it's
designed to help you remember facts (such as words and phrases in a
foreign language) as easily, quickly and efficiently as possible.

Here, http://code.google.com/p/anki/issues/detail?id=613, you'll find my
explanation of the 'bug'.

Briefly, I live in Argentina and the current administration has changed
current time because of 'daylight saving'. However, when syncing my
decks (which store all my cards) with Anki's server, it tells me my
current time is wrong and that I need to change it. In fact, it's not MY
clock which is wrong, but Anki's. So, I posted this bug and the
developer, as you can see, told me that: it's not really anki's job - a
setting to shift the clock would need changes all throughout the code.
probably something in python's timezone handling needs to be updated.
could you post about the daylight savings issue on the python mailing
list and see what they say? So, this is what I'm doing. 

Right now I will notify the developer of this program that, actually,
Python already handles 'time saving'.

Thanks for your help. Any other comments/ideas would be greatly appreciated.

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



[issue4881] Python's timezon handling: daylight saving option

2009-01-11 Thread Pablo Castagnino

Pablo Castagnino  added the comment:

the last post on that link is the point - python supports daylight
savings, but if
your city recently started using daylight savings, and didn't before,
then either
python or linux needs to be updated to know that.

I'm using Ubuntu Intrepid Ibex.

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



[issue4881] Python's timezon handling: daylight saving option

2009-01-12 Thread Pablo Castagnino

Pablo Castagnino  added the comment:

Ok, everything seems to be working now in Ubuntu. However, I can't get
it work in WIN XP (at work). :(

Thanks for all your help!

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



[issue4881] Python's timezon handling: daylight saving option

2009-01-13 Thread Pablo Castagnino

Pablo Castagnino  added the comment:

Ok. I installed the WIN XP patch loewis talked about...and now
everything works smoothly in Windows too. Thanks!

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




[issue47020] float('nan')==math.nan does NOT evaluate to True (as suggested by documentation).

2022-03-14 Thread Pablo Dumas


New submission from Pablo Dumas :

float('nan')==math.nan  does NOT evaluate to True (as suggested by 
documentation).
On the other hand, float('inf')==math.inf  DOES evaluate to True (as 
suggested by documentation).

Documentation we're referring to: https://docs.python.org/3.8/library/math.html

--
assignee: docs@python
components: Documentation
messages: 415213
nosy: docs@python, w0rthle$$
priority: normal
severity: normal
status: open
title: float('nan')==math.nan  does NOT evaluate to True (as suggested by 
documentation).
type: behavior
versions: Python 3.8

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



[issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS.

2021-04-06 Thread Pablo Conesa


New submission from Pablo Conesa :

Hi, one of our users is reporting this starting to happen in a GPFS. All has 
been working fine for NTFS so far for many years.

I had a look at my shutil code, and I can see the try/except code trying to 
fall back to the "slower" copyfileobj(fsrc, fdst).

But it seems, by the stacktrace bellow that the "catch" is not happening.

Any idea how to fix this?

I guess something like:

import shutil
shutil._USE_CP_SENDFILE = False

should avoid the fast_copy attempt.



> Traceback (most recent call last):
>   File 
> "/opt/pxsoft/scipion/v3/ubuntu20.04/scipion-em-esrf/esrf/workflow/esrf_launch_workflow.py",
>  line 432, in 
> project.scheduleProtocol(prot)
>   File 
> "/opt/pxsoft/scipion/v3/ubuntu20.04/anaconda3/envs/.scipion3env/lib/python3.8/site-packages/pyworkflow/project/project.py",
>  line 633, in scheduleProtocol
> pwutils.path.copyFile(self.dbPath, protocol.getDbPath())
>   File 
> "/opt/px/scipion/v3/ubuntu20.04/anaconda3/envs/.scipion3env/lib/python3.8/site-packages/pyworkflow/utils/path.py",
>  line 247, in copyFile
> shutil.copy(source, dest)
>   File 
> "/opt/pxsoft/scipion/v3/ubuntu20.04/anaconda3/envs/.scipion3env/lib/python3.8/shutil.py",
>  line 415, in copy
> copyfile(src, dst, follow_symlinks=follow_symlinks)
>   File 
> "/opt/pxsoft/scipion/v3/ubuntu20.04/anaconda3/envs/.scipion3env/lib/python3.8/shutil.py",
>  line 272, in copyfile
> _fastcopy_sendfile(fsrc, fdst)
>   File 
> "/opt/pxsoft/scipion/v3/ubuntu20.04/anaconda3/envs/.scipion3env/lib/python3.8/shutil.py",
>  line 169, in _fastcopy_sendfile
> raise err
>   File 
> "/opt/pxsoft/scipion/v3/ubuntu20.04/anaconda3/envs/.scipion3env/lib/python3.8/shutil.py",
>  line 149, in _fastcopy_sendfile
> sent = os.sendfile(outfd, infd, offset, blocksize)
> BlockingIOError: [Errno 11] Resource temporarily unavailable: 
> 'project.sqlite' -> 'Runs/02_ProtImportMovies/logs/run.db'

--
components: IO
messages: 390297
nosy: p.conesa.mingo
priority: normal
severity: normal
status: open
title: BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS.
type: crash
versions: Python 3.8

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



[issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS.

2021-05-10 Thread Pablo Conesa


Pablo Conesa  added the comment:

So, is it ok, when the fast copy fails, not to _GiveupOnFastCopy(err)?

I can understand that fast copy might fail, but then the Giveup part should 
happen and it wasn't.

Additionally, _USE_CP_SENDFILE could be taken, optionally from an environment 
variable to cancel the fastcopy once we know it will fail?

--

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



[issue44617] Undesired Behavior on `match` using Singleton object

2021-07-12 Thread Pablo Aguilar


New submission from Pablo Aguilar :

Hey, I'm not sure if this is really a bug but I'd like to show to prevent some 
undesired behavior!

I'm working in the `match` support for returns 
(https://github.com/dry-python/returns) library when I saw a behavior similar 
to the described in `Constant Value Patterns` section on PEP-622 
(https://www.python.org/dev/peps/pep-0622/#constant-value-patterns).

A very small and reproducible example:
```python
from typing import Any, ClassVar, Optional


class Maybe:
empty: ClassVar['Maybe']
_instance: Optional['Maybe'] = None

def __new__(cls, *args: Any, **kwargs: Any) -> 'Maybe':
if cls._instance is None:
cls._instance = object.__new__(cls)
return cls._instance


Maybe.empty = Maybe()


if __name__ == '__main__':
my_maybe = Maybe()
match my_maybe:
case Maybe.empty:
print('FIRST CASE')
case _:
print('DEFAULT CASE')
```

The output here is `FIRST CASE`, but if I delete `__new__` method the output is 
`DEFAULT CASE`.

Is that the correct behavior?

Python version: 3.10.0a7

--
components: Interpreter Core
messages: 397380
nosy: thepabloaguilar
priority: normal
severity: normal
status: open
title: Undesired Behavior on `match` using Singleton object
type: behavior
versions: Python 3.10

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



[issue44617] Undesired Behavior on `match` using Singleton object

2021-07-13 Thread Pablo Aguilar


Pablo Aguilar  added the comment:

But, `Maybe.empty` works like a `Literal Pattern` or `Constant Pattern`?

--

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



[issue44617] Undesired Behavior on `match` using Singleton object

2021-07-13 Thread Pablo Aguilar


Pablo Aguilar  added the comment:

In fact, I'm worried about how to explain some behaviors.

Look here:
```python
# `Maybe` here is the same class described in the first message
Nothing = Maybe()
Maybe.empty = Nothing


if __name__ == '__main__':
my_maybe = Maybe()
match my_maybe:
case Nothing:
print('FIRST CASE')
case _:
print('DEFAULT CASE')
```

I can't use `Nothing` to match the values even though it's a variable but using 
`Maybe.empty` it works.

--

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



[issue41277] documentation: os.setxattr() errno EEXIST and ENODATA

2020-07-10 Thread Pablo Dumas


New submission from Pablo Dumas :

Shouldn't os.setxattr() errno EEXIST be when "XATTR_CREATE was specified, and 
the attribute exists already" and errno ENODATA be when "XATTR_REPLACE was 
specified, and the attribute does not exist."? In the current os module 
documentation, it's the other way around: "If XATTR_REPLACE is given and the 
attribute does not exist, EEXISTS will be raised. If XATTR_CREATE is given and 
the attribute already exists, the attribute will not be created and ENODATA 
will be raised."... Thanks!

--
messages: 373516
nosy: w0rthle$$
priority: normal
severity: normal
status: open
title: documentation: os.setxattr() errno EEXIST and ENODATA
type: behavior
versions: Python 3.8

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



[issue14922] mailbox.Maildir.get_message() may fail when Maildir dirname is a unicode string

2012-05-25 Thread Pablo Oliveira

New submission from Pablo Oliveira :

I'm using Python 2.7.3rc2 from debian sid packages.

If a mailbox.Maildir object is created with a unicode dirname,
retrieving a message tagged with maildir flags with get() or get_message() 
fails with the following exception:

Traceback (most recent call last):
  File "reproduce.py", line 21, in 
mb.get_message(key)
  File "/usr/lib/python2.7/mailbox.py", line 343, in get_message
msg.set_info(name.split(self.colon)[-1])
  File "/usr/lib/python2.7/mailbox.py", line 1480, in set_info
raise TypeError('info must be a string: %s' % type(info))
TypeError: info must be a string: 


Since python os.path module seems to cope with unicode paths 
http://docs.python.org/howto/unicode.html, it would be nice to fix this issue.

Attached is a simple script reproducing the bug.

The following patch seems to solve the issue for me:
--- /usr/lib/python2.7/mailbox.py   2012-04-23 01:25:48.0 +0200
+++ mailbox.py  2012-05-26 00:34:03.585347627 +0200
@@ -1474,7 +1474,7 @@
 
 def set_info(self, info):
 """Set the message's "info" string."""
-if isinstance(info, str):
+if isinstance(info, basestring):
 self._info = info
 else:
 raise TypeError('info must be a string: %s' % type(info))


Regards,

Pablo Oliveira.

--
components: Library (Lib)
files: reproduce.py
messages: 161629
nosy: poliveira
priority: normal
severity: normal
status: open
title: mailbox.Maildir.get_message() may fail when Maildir dirname is a unicode 
string
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file25710/reproduce.py

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



[issue21712] fractions.gcd failure

2014-06-10 Thread Pablo Acosta

New submission from Pablo Acosta:

The Greatest Common Divisor (gcd) algorithm sometimes breaks because the modulo 
operation does not always return a strict integer number, but one very, very 
close to one. This is enough to drive the algorithm astray from that point on.

Example:

>> import fractions
>> fractions.gcd(48, 18)
>> 6

Which is corret, but:

>> fractions.gcd(2.7, 107.3)
>> 8.881784197001252e-16

when the answer should be 1. The fix seems simple, just cast the mod() 
operation in the algorithm:

while b:
   a, b = b, int(a%b)
return a

--
components: Library (Lib)
messages: 220221
nosy: pacosta
priority: normal
severity: normal
status: open
title: fractions.gcd failure
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue21712] fractions.gcd failure

2014-06-10 Thread Pablo Acosta

Pablo Acosta added the comment:

Actually probably int(round(a%b)) would be better.

--

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



[issue21712] fractions.gcd failure

2014-06-10 Thread Pablo Acosta

Pablo Acosta added the comment:

I will correct myself one more time (hopefully the last):



while b:
a, b = b, round(a % b, 10)
return a



a   b   fractions.gcd   proposed_algorithm
--
48  18  6   6
3   4   1   1
2.7 107.3   8.881784197001252e-16   0.1
200.1   333 2.842170943040401e-14   0.3
0.050.023.469446951953614e-18   0.01

--

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



[issue21712] fractions.gcd failure

2014-06-11 Thread Pablo Acosta

Pablo Acosta added the comment:

Understood and agreed. My bad too for not reading the documentation more 
carefully. Thank you for the detailed explanation.

Pablo

> On Jun 11, 2014, at 2:52 PM, Tim Peters  wrote:
> 
> 
> Tim Peters added the comment:
> 
> @pacosta, if Mark's answer is too abstract, here's a complete session showing 
> that the result you got for gcd(2.7, 107.3) is in fact exactly correct:
> 
>>>> import fractions
>>>> f1 = fractions.Fraction(2.7)
>>>> f2 = fractions.Fraction(107.3)
>>>> f1
> Fraction(3039929748475085, 1125899906842624) # the true value of "2.7"
>>>> f2
> Fraction(7550566250263347, 70368744177664)   # the true value of "107.3"
>>>> fractions.gcd(f1, f2)  # computed exactly with rational arithmetic
> Fraction(1, 1125899906842624)
>>>> float(_)
> 8.881784197001252e-16
> 
> But this will be surprising to most people, and probably useless to all 
> people.  For that reason, passing non-integers to gcd() is simply a Bad Idea 
> ;-)
> 
> --
> 
> ___
> Python tracker 
> <http://bugs.python.org/issue21712>
> ___

--

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2014-07-07 Thread Pablo Sole

Pablo Sole added the comment:

I found another case where the result of ismount() is misleading. I'm using a 
FUSE-based filesystem controlled by a python supervisor daemon. 

When the fuse daemon dies and you try to access the filesystem with os.stat() 
it returns:
OSError: [Errno 107] Transport endpoint is not connected: '/tmp/fuse-test'. 
Although, the filesystem is actually mounted and you can verify this:
# cat /proc/self/mountinfo | grep fuse
26 25 0:20 / /tmp/fuse-test rw,nosuid,nodev,relatime - fuse /dev/fuse 
rw,user_id=1000,group_id=1000,default_permissions,allow_other

If the idea of ismount() is to show what paths are mountpoints, in this case it 
should return True, even if it's non-accessible (the fuse daemon died in this 
case, it might also happen for a stale NFS mount *not checked* ).

--
nosy: +pablo.sole

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



[issue6845] ftplib rest support for storbinary

2009-09-05 Thread Pablo Mouzo

New submission from Pablo Mouzo :

FPT class doesn't support the rest parameter in storbinary method.

--
components: None
messages: 92287
nosy: pablomouzo
severity: normal
status: open
title: ftplib rest support for storbinary
type: feature request
versions: Python 2.7

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



[issue6845] ftplib rest support for storbinary

2009-09-05 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

I attached a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file14841/issue6845.patch

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



[issue6845] ftplib rest support for storbinary

2009-09-06 Thread Pablo Mouzo

Changes by Pablo Mouzo :


--
nosy: +facundobatista

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



[issue6845] ftplib rest support for storbinary

2009-09-10 Thread Pablo Mouzo

Changes by Pablo Mouzo :


Removed file: http://bugs.python.org/file14841/issue6845.patch

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



[issue6845] Restart support in binary upload for ftplib

2009-09-10 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

I'm changing the title to something clearer (I hope).
The patch I submitted adds the retr optional parameter to the storbinary
method.

--
title: ftplib rest support for storbinary -> Restart support in binary upload 
for ftplib
Added file: http://bugs.python.org/file14876/issue6845.patch

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



[issue6845] Restart support in binary upload for ftplib

2009-10-02 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

I attached some tests.

--
Added file: http://bugs.python.org/file15027/issue6845.diff

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



[issue6845] Restart support in binary upload for ftplib

2009-10-06 Thread Pablo Mouzo

Changes by Pablo Mouzo :


Removed file: http://bugs.python.org/file14876/issue6845.patch

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



[issue6845] Restart support in binary upload for ftplib

2009-10-08 Thread Pablo Mouzo

Changes by Pablo Mouzo :


--
nosy: +gregory.p.smith

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



[issue6845] Restart support in binary upload for ftplib

2009-10-20 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

I think that a non-digit REST argument is an error. But I've tested some
ftp servers and they don't return an error code, they just set REST to 0
and return some OK code. Finally, ftplib doesn't check that, so if
someone accidentally passes a non-digit argument it could be a difficult
bug to spot.

--

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



[issue6845] Restart support in binary upload for ftplib

2009-11-09 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

Here is a new patch. It works with both ints and strings.

I'm working on a patch for py3k.

--
Added file: http://bugs.python.org/file15302/issue6845-trunk.diff

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



[issue6845] Restart support in binary upload for ftplib

2009-11-09 Thread Pablo Mouzo

Changes by Pablo Mouzo :


Removed file: http://bugs.python.org/file15027/issue6845.diff

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



[issue7326] SOLUTION pls? /usr/lib/python2.6/dist-packages/visual/__init__.py", line 59, in import cvisual AttributeError: 'Boost.Python.StaticProperty' object attribute '__doc__' is read-onl

2009-11-14 Thread pablo veloz

New submission from pablo veloz :

sorry for my english, but how can i reparer that problem? help me pls thank.

--
messages: 95273
nosy: pveloz
severity: normal
status: open
title: SOLUTION pls? /usr/lib/python2.6/dist-packages/visual/__init__.py", line 
59, in  import cvisual AttributeError: 
'Boost.Python.StaticProperty' object attribute '__doc__' is read-only
versions: Python 2.6

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



[issue6845] Restart support in binary upload for ftplib

2009-11-26 Thread Pablo Mouzo

Changes by Pablo Mouzo :


Removed file: http://bugs.python.org/file15302/issue6845-trunk.diff

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



[issue6845] Restart support in binary upload for ftplib

2009-11-26 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

Thanks Antoine, I'm attaching both patches. Now the test isn't failing.

--
Added file: http://bugs.python.org/file15401/issue6845-trunk.diff

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



[issue6845] Restart support in binary upload for ftplib

2009-11-26 Thread Pablo Mouzo

Changes by Pablo Mouzo :


Added file: http://bugs.python.org/file15402/issue6845-py3k.diff

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



[issue7484] smtplib: verify breaks with Postfix servers

2009-12-25 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

This patch solves the problem with the VRFY command, but I'm still 
wondering if this happens with other commands too.

--
keywords: +patch
nosy: +pablomouzo
Added file: http://bugs.python.org/file15674/issue7484-trunk.diff

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



[issue7484] smtplib: verify breaks with Postfix servers

2009-12-25 Thread Pablo Mouzo

Changes by Pablo Mouzo :


Added file: http://bugs.python.org/file15675/issue7484-py3k.diff

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



[issue7540] urllib2 request does not update content length after new add_data

2009-12-27 Thread Pablo Mouzo

Pablo Mouzo  added the comment:

The problem here is that the headers are not updated if they already 
exists. The solution is quite simple but breaks the tests because it 
"clobbers the existing headers".

You can do this:
...
req.add_data(some_data)
req.add_unredirected_header('Content-Length', len(some_data))
urllib2.urlopen(req)
...

But is risky because all the other headers are still outdated.

Is there any reason why you need to reuse the request object?

--
keywords: +patch
nosy: +pablomouzo
Added file: http://bugs.python.org/file15680/bad_fix.diff

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



[issue7675] help() doesn't accept unicode literals in built in docstrings

2010-01-11 Thread pablo stapff

New submission from pablo stapff :

We use umlaut in our docstrings and when we use the help() function to extract 
the documentation, the function reports an error:

UnicodeEncodeError: 'ascii' codec can't encode character

Our docstrings are specified as unicode literals and the source file contains 
the line:

# -*- coding: utf-8 -*-


just import the module and make:

 help(tudelut.tudelut)

--
components: Library (Lib)
files: tudelut.py
messages: 97584
nosy: psd
severity: normal
status: open
title: help() doesn't accept unicode literals in built in docstrings
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file15827/tudelut.py

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



[issue5673] Add timeout option to subprocess.Popen

2010-08-08 Thread Pablo Bitton

Changes by Pablo Bitton :


--
nosy: +Pablo.Bitton

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



[issue5673] Add timeout option to subprocess.Popen

2010-08-08 Thread Pablo Bitton

Pablo Bitton  added the comment:

I'd like to report a problem I encountered with the discussed use pattern using 
subprocess-timeout-v5.patch on linux. I don't have python3 installed at work, 
sorry.

When running:
p = subprocess.Popen("tcpdump -i eth0 > file &", stdin=subprocess.PIPE, 
stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, 
universal_newlines=True)
try:
out, err = p.communicate(timeout=1)
except subprocess.TimeoutExpired:
p.kill()
out, err = p.communicate()

After the timeout happens, the last line raises a ValueError: I/O operation on 
closed file.

The exception is thrown from the register_and_append call for self.stdout in 
_communicate_with_poll. I'm sorry again for not being able to attach the full 
traceback.

The problem doesn't reproduce without the '&' or the '> file', and doesn't 
reproduce with other executables I've tried.

--

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



[issue5673] Add timeout option to subprocess.Popen

2010-08-09 Thread Pablo Bitton

Pablo Bitton  added the comment:

I've been using the subprocess-timeout-v5.patch patch with 2.x. Isn't that 
version supposed to work with 2.x?

Other than the stated problem, the patched module generally works, and is very 
helpful.

--

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



[issue5673] Add timeout option to subprocess.Popen

2010-08-10 Thread Pablo Bitton

Pablo Bitton  added the comment:

I reproduced the problem with the latest patch, 
subprocess-timeout-py3k-v7.patch, on py3k on Linux.

Attached is the code to reproduce the problem and the resulting traceback.

--
Added file: http://bugs.python.org/file18468/tcpdump error.txt

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



[issue27537] Segfault Via Resource Exhaustion

2016-07-16 Thread pablo sacristan

New submission from pablo sacristan:

The code is very simple:
import sys
sys.setrecursionlimit(1<<20)
test=lambda test:test(test)
test(test)

It basically works by changing the recursion limit and then starting an 
infinite recursion, this quickly gives a segfault.
This can be used to crash python.

--
messages: 270611
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Segfault Via Resource Exhaustion
versions: Python 2.7

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



[issue27538] Segfault on error in code object checking

2016-07-16 Thread pablo sacristan

New submission from pablo sacristan:

The code is also simple on this one:
from types import CodeType as code
exec code(0, 2, 3, 0, "lol lolol", (), (), (), "", "", 0, "") 

The interpreter isn't checking if the code object is correct, therefore it is 
possible to segfault by putting wrong opcodes and more.

--
messages: 270612
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Segfault on error in code object checking
versions: Python 2.7

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



[issue27538] Segfault on error in code object checking

2016-07-17 Thread pablo sacristan

pablo sacristan added the comment:

I can also reproduce on 3.5 and on 3.4.
Thank you.

--
versions: +Python 3.4, Python 3.5

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



[issue27538] Segfault on error in code object checking

2016-07-17 Thread pablo sacristan

pablo sacristan added the comment:

I do agree it is not a very big problem, but it is still a problem. If a python 
program took user input (maybe HTTP server) took user input (POST values) and 
construct a code object with that input. It would be possible to crash it and 
that can be bad for the web application. Even though it is not the most 
important Python problem, it is still a problem which can cause moderate 
problems, and it can be exploited remotely if the HTTP server did what I said 
before. One vulnerable HTTP server is one too many ;)
Hope it helps :)

--
resolution: wont fix -> remind
status: closed -> open

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



[issue27538] Segfault on error in code object checking

2016-07-17 Thread pablo sacristan

pablo sacristan added the comment:

Yes, but it is possible to blacklist some bytecode (it may be possible to 
blacklist all or almost all malicious bytecode) and even more if the attacker 
just wants to crash the target then the segfault would be an easy crash. It is 
still an attack scenario that is possible.
Hope it helps :)

--

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



[issue27547] Integer Overflow Crash On float(array.array())

2016-07-17 Thread pablo sacristan

New submission from pablo sacristan:

There is an integer overflow because python doesn't check the length as it does 
with bytearray() and it still goes on, so by doing something like:
>>> import array
>>> float(array.array("L",b"a"*0xFFF+10**80))
It returns:
Python(2179,0x7fff7ad6a000) malloc: *** mach_vm_map(size=1152921504606851072) 
failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

And then it just crashes
Or you can skip the error and just do:
>>> import array
>>> float(array.array("L",b"a"*0xFFF**100**8))

That will just make python freeze until you restart it, which is as good as 
crashed.
The file would be:
import array
float(array.array("L",b"a"*0xFFF**100**8))

Hope it helps ;)

--
messages: 270700
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Integer Overflow Crash On float(array.array())
versions: Python 3.5, Python 3.6

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



[issue27549] Integer Overflow Crash On bytearray()

2016-07-17 Thread pablo sacristan

New submission from pablo sacristan:

There is an integer overflow because python doesn't check the length correctly 
on bytearray:
bytearray(0xFFF**100**8)
That will not return an overflow message, and even though my hex knowledge is 
very bad I do believe 0xFFF**100**8 is more 
than 0x which does return a overflow message.
Hope it helps ;)

--
messages: 270703
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Integer Overflow Crash On bytearray()
versions: Python 3.5, Python 3.6

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



[issue27548] Integer Overflow On bin()

2016-07-17 Thread pablo sacristan

New submission from pablo sacristan:

There is an integer overflow in bin() because python incorrectly checks the 
length of the input in bin().
bin(0xFFF+10**80)
That line will freeze python until you restart it, which basically is a crash 
because python stops working completely.
Hope it helps ;)

--
messages: 270702
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Integer Overflow On bin()
versions: Python 3.5, Python 3.6

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



[issue27551] Integer Overflow On print()

2016-07-17 Thread pablo sacristan

New submission from pablo sacristan:

There is an integer overflow because python doesn't check the length correctly 
on print() statements:
print(0xFFF**100**8)
That will overflow and python would stop working, so it would be as good as 
crashed :)
Hope it helps ;)

--
messages: 270705
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Integer Overflow On print()
versions: Python 3.5, Python 3.6

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



[issue27550] Integer Overflow Crash On Arithmetic Operations

2016-07-17 Thread pablo sacristan

New submission from pablo sacristan:

There is an integer overflow because python doesn't check the length correctly 
on arithmetic operations:
0xFFF**100**8

Just that line will freeze python, no oveflow message appears, no memory error, 
and python basically crashes because it just stops working.
Hope it helps ;)

--
messages: 270704
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Integer Overflow Crash On Arithmetic Operations
versions: Python 3.5, Python 3.6

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



[issue27552] Integer Overflow On min()

2016-07-17 Thread pablo sacristan

New submission from pablo sacristan:

There is an integer overflow on min() statements because python incorrectly 
checks the length to put the overflow message, so it is possible to overflow 
min()
min(0xFFF+10**80)
That line freezes python until you restart it, which is basically as if you 
were crashing it, the effect is the same, python stops working.
Hope it helps ;)

--
messages: 270706
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Integer Overflow On min()
versions: Python 3.5, Python 3.6

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



[issue27553] Integer Overflow On unicode()

2016-07-17 Thread pablo sacristan

New submission from pablo sacristan:

There is an integer overflow in unicode() because python incorrectly checks the 
length of unicode():
unicode(0xFFF+10**80)
That freezes python until you restart it which is basically the same effect as 
crashing python.
Hope it helps ;)

--
messages: 270707
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Integer Overflow On unicode()
versions: Python 3.5, Python 3.6

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



[issue27554] Integer Overflow On dir()

2016-07-17 Thread pablo sacristan

New submission from pablo sacristan:

There is an integer overflow in dir():
dir(0xFFF+10**80)
That line will freeze python until you restart it, which makes it have the same 
effect as a crash.
Hope it helps ;)

--
messages: 270708
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Integer Overflow On dir()
versions: Python 3.5, Python 3.6

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



[issue27555] Integer Overflow on oct()

2016-07-17 Thread pablo sacristan

New submission from pablo sacristan:

There is an integer overflow on oct() because of incorrectly checking the 
length.
oct(0xFFF+10**80)
That line will freeze python until you restart it, which is as good as crashed.
Hope it helps ;)

--
messages: 270709
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Integer Overflow on oct()
versions: Python 3.5, Python 3.6

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



[issue27556] Integer overflow on hex()

2016-07-17 Thread pablo sacristan

New submission from pablo sacristan:

There is an integer overflow on hex() because python incorrectly checks the 
length of the value to return overflow message if it were too big.
hex(0xFFF+10**80)
That line will freeze python until you restart it, which is the same thing as 
crashing python.
Hope it helps ;)

--
messages: 270710
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Integer overflow on hex()

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



[issue27557] Integer Overflow on int()

2016-07-17 Thread pablo sacristan

New submission from pablo sacristan:

There is an integer overflow on int() because python incorrectly checks the 
length of the input.
int(0xFFF+10**80)
That line of code will freeze python until you restart it, which is as annoying 
as if python had crashed.
Hope it helps ;)

--
messages: 270711
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Integer Overflow on int()
versions: Python 3.5, Python 3.6

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



[issue27559] Crash On bytearray()

2016-07-18 Thread pablo sacristan

New submission from pablo sacristan:

There is a crash on bytearray(), not really a crash but rather the process gets 
killed by the kernel, but that is a crash, and the keyboard interrupt stops 
working while bytearray is working, so you can either restart python or wait 
for python to get killed by the kernel. The biggest problem is that while 
bytearray() is trying to do something, you can't interrupt it just doesn't work 
for some reason.
This should be enough for bytearray to crash :
bytearray(0xFF)
It crashes after some time with a Killed: 9 error.

Hope it helps ;)

--
messages: 270731
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Crash On bytearray()
versions: Python 3.5, Python 3.6

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



[issue27560] zlib.compress() crash and keyboard interrupt stops working

2016-07-18 Thread pablo sacristan

New submission from pablo sacristan:

zlib.compress crashes when you put a lot of stuff into it and even when you try 
keyboard interrupts it doesn't work for some reason, and Python gets killed 
because trying to compress so much data gets the Python process get killed by 
the kernel. If you put a large amount of data in it will get killed quicker. A 
problem is that keyboard interrupts stop working while the program is running, 
which is usually around 5 - 15 seconds during which python stops working 
(including interrupts) until it gets killed by the kernel. This may be used to 
crash python remotely if a server takes user input and runs it through 
zlib.compress(b'variable' * 2**32) which is not very likely. You probably 
should set a limit for what you compress and how much it is.
The output is:
Killed: 9
Even though you try doing keyboard interrupt it doesn't work.

--
files: crash.py
messages: 270732
nosy: pabstersac
priority: normal
severity: normal
status: open
title: zlib.compress() crash and keyboard interrupt stops working
Added file: http://bugs.python.org/file43774/crash.py

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



[issue27559] Crash On bytearray()

2016-07-18 Thread pablo sacristan

pablo sacristan added the comment:

I know, but then shouldn't you try limiting the amount of data it allocates? Or 
maybe allow for keyboard interrupts to be used while the it is going on, 
because keyboard interrupts weren't working while it was working.

--
resolution: not a bug -> remind

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



[issue27560] zlib.compress() crash and keyboard interrupt stops working

2016-07-18 Thread pablo sacristan

pablo sacristan added the comment:

I'd like to but I don't have enough memory either, sorry.

--
versions: +Python 3.5, Python 3.6

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



[issue14787] pkgutil.walk_packages returns extra modules

2014-12-09 Thread Pablo Aguiar

Changes by Pablo Aguiar :


--
nosy: +scorphus

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



[issue26508] Infinite crash leading to DoS

2016-03-07 Thread pablo sacristan

New submission from pablo sacristan:

import ctypes, struct, sys, os
while 1:
os.system('python /Users/pabstersac/Desktop/Python\ Files/crash.py') 
#Change to your full path to the file
inner = ()
outer = (inner,)
c_outer = (ctypes.c_char * sys.getsizeof(outer)).from_address(id(outer))
inner_index = c_outer[:].find(struct.pack('P', id(inner)))
c_outer[inner_index:inner_index+struct.calcsize('P')] = struct.pack('P', 
id(outer))
print outer
#construct and print a self-referencing tuple
run it and wait around 10 sec for it to happen, but once it starts you will be 
forced to force it to shut because it will keep on crashing infinitely which is 
extremely annoying, and even while it says it crashed it still runs and keeps 
on running infinitely, which if you do on an unexpecting victim, they will 
probably shut down the computer directly.
There are basically two problems here, the way you construct and then print a 
self-referencing tuple, and the way you handle when it is put in an infinite 
loop with itself calling its own file (which if you wait long enough will see 
the effect goes quicker every second, it goes up exponentially) and you don't 
stop it correctly.

--
files: crash.py
messages: 261319
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Infinite crash leading to DoS
type: security
Added file: http://bugs.python.org/file42088/crash.py

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



[issue26508] Infinite crash leading to DoS

2016-03-08 Thread pablo sacristan

pablo sacristan added the comment:

Then it is no bug that it crashes python? You don't have to put it in a loop, 
but by looping it I am adding the part that makes it take more time but will 
keep on crashing infinitely, take away the while loop but not what it has 
inside and then also delete the os.system() and you get python to crash once. 
Is a crash not a bug?

--
resolution: not a bug -> works for me

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



[issue26508] Infinite crash leading to DoS

2016-03-08 Thread pablo sacristan

pablo sacristan added the comment:

New content for crash.py:

import ctypes, struct, sys, os
inner = ()
outer = (inner,)
c_outer = (ctypes.c_char * sys.getsizeof(outer)).from_address(id(outer))
inner_index = c_outer[:].find(struct.pack('P', id(inner)))
c_outer[inner_index:inner_index+struct.calcsize('P')] = struct.pack('P', 
id(outer))
print outer

--

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



[issue26508] Infinite crash leading to DoS

2016-03-08 Thread pablo sacristan

Changes by pablo sacristan :


--
status: closed -> open

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



[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Steve, could this be related to the changes in getpath?

--
nosy: +steve.dower

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



[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
priority: normal -> release blocker

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



[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Ned, are you able to bisect this or provide a simpler reproducer that doesn't 
involve tox?

--

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



[issue43931] Add the Python version to the API data.

2021-12-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



  1   2   3   4   5   6   7   8   9   10   >