[issue25278] Unexpected socket exception on SFTP 'STOR' command

2015-09-30 Thread Blanquier

New submission from Blanquier:

With Filezilla Server 0.9.53, SFTP activated (force SSL on login, allow 
explicit FTP over TLS). From the FTP client point of view: when I use 
ftp_id.storbinary( 'STOR file_name'...), a socket.error exception arrive 
sometime. It's a socket.error exception and the errno record value is 0 (zero). 
The full message is b'[Errno 0] Error'. If I want to obtain the real server 
answer, I MUST call ftp_id.getresp().
It looks like a desynchronisation between the command and the answer.

Could you correct it please ?

Best regards.

--
components: Library (Lib)
messages: 251933
nosy: blanquier
priority: normal
severity: normal
status: open
title: Unexpected socket exception on SFTP 'STOR' command
type: behavior
versions: Python 2.7

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



[issue25279] Unexpected ftplib.error_xxx exception on SFTP 'STOR' command

2015-09-30 Thread Blanquier

New submission from Blanquier:

activated (force SSL on login, allow explicit FTP over TLS). From the FTP 
client point of view: when I use ftp_id.storbinary( 'STOR file_name'...), a 
ftplib.error_xxx exception arrive someting. 

On the windows server:
(000336)30/09/2015 08:56:59 - nemo_pyc (135.238.179.15)> STOR Handle.exe
(000336)30/09/2015 08:56:59 - nemo_pyc (135.238.179.15)> 150 Opening data 
channel for file upload to server of "/Handle.exe"
(000336)30/09/2015 08:56:59 - nemo_pyc (135.238.179.15)> 550 can't access file.
(000336)30/09/2015 08:57:29 - nemo_pyc (135.238.179.15)> TYPE I
(000336)30/09/2015 08:57:29 - nemo_pyc (135.238.179.15)> 200 Type set to I
(000336)30/09/2015 08:57:59 - nemo_pyc (135.238.179.15)>  ×3DG}
(000336)30/09/2015 08:58:04 - nemo_pyc (135.238.179.15)> 'Y'jQÌ~.
¾0Žåà ×3DG~
(000336)30/09/2015 08:58:04 - nemo_pyc (135.238.179.15)> 500 Syntax error, 
command unrecognized.
(000336)30/09/2015 08:58:09 - nemo_pyc (135.238.179.15)> ͈Ï!x›dƒïæA—:•\ 
×3DG
...

could you fix the bug please ?
Best regards,

------
components: Library (Lib)
messages: 251934
nosy: blanquier
priority: normal
severity: normal
status: open
title: Unexpected ftplib.error_xxx exception on SFTP 'STOR' command
type: behavior
versions: Python 2.7

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



[issue25279] Unexpected ftplib.error_xxx exception on SFTP 'STOR' command

2015-09-30 Thread Blanquier

Blanquier added the comment:

With Filezilla Server 0.9.53, SFTP activated (force SSL on login, allow 
explicit FTP over TLS). From the FTP client point of view: when I use 
ftp_id.storbinary( 'STOR file_name'...), a ftplib.error_xxx exception arrive 
someting. 

On the windows server:
(000336)30/09/2015 08:56:59 - nemo_pyc (135.238.179.15)> STOR Handle.exe
(000336)30/09/2015 08:56:59 - nemo_pyc (135.238.179.15)> 150 Opening data 
channel for file upload to server of "/Handle.exe"
(000336)30/09/2015 08:56:59 - nemo_pyc (135.238.179.15)> 550 can't access file.
(000336)30/09/2015 08:57:29 - nemo_pyc (135.238.179.15)> TYPE I
(000336)30/09/2015 08:57:29 - nemo_pyc (135.238.179.15)> 200 Type set to I
(000336)30/09/2015 08:57:59 - nemo_pyc (135.238.179.15)>  ×3DG}
(000336)30/09/2015 08:58:04 - nemo_pyc (135.238.179.15)> 'Y'jQÌ~.
¾0Žåà ×3DG~
(000336)30/09/2015 08:58:04 - nemo_pyc (135.238.179.15)> 500 Syntax error, 
command unrecognized.
(000336)30/09/2015 08:58:09 - nemo_pyc (135.238.179.15)> ͈Ï!x›dƒïæA—:•\ 
×3DG
...

Could you fix the bug please ?
Best regards,

--

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



[issue25278] Unexpected socket exception on SFTP 'STOR' command

2015-09-30 Thread Blanquier

Blanquier added the comment:

Hi,

I send you the file as attached document.
I use the test_sftp_upload() as entry point.

Le 30/09/2015 16:43, R. David Murray a écrit :
> R. David Murray added the comment:
>
> As Eric said, we really can't diagnose this unless you show is your python 
> code (as code, not as a partial screenshot).
>
> --
>
> ___
> Python tracker 
> <http://bugs.python.org/issue25278>
> ___
>

--
Added file: http://bugs.python.org/file40630/gui_ftp.py

___
Python tracker 
<http://bugs.python.org/issue25278>
___# -*- coding: iso-8859-1 -*-
# ---
__file__ = "gui_ftp.py"
__doc__= "FTP functions for ul/downloading one or several server in parallele 
with multiple connections."
__author__ = "Philippe Blanquier"
__version__ = "v0.1"
__date__ = "24/06/2011"
__copyright__ = "Alcatel-Lucent"
__contact__ = "philippe.blanqu...@alcatel-lucent.com"
# ---

# Python include
import os,sys,ftplib,glob,time,threading,socket,copy

# Private include
import gui_common,gui_scenario_manager,gui_user

###  ###
### Private data ###
###  ###
_ftps_certificate_file_name = 
"C:"+os.sep+"Nemo_Pyc"+os.sep+"sftp_certificate.crt"  #: FTPS certificate for 
labo servers

_ftp_error_tag = "FTP"
_ftp_block_size = 64*gui_common.kilo_unit #: Maximum chunk size to read/write 
on the low-level socket object created to do the actual transfer
_ftp_repeat_nb = 10 #: Maximal command repeatition number before saying 'KO'...
_ftp_repeat_waiting_delay = 30.0 #: Delay between 2 repetition when a failure 
is detected

_upload_cmd   = "Upload"
_download_cmd = "Download"

_file_size_tag = "File size"

_ftp_posix_separator = '/' #: Normalized FTP directory separator ( UNIX POSIX !)
_ftp_dir_size = -1 #: Dummy FTP directory size

_ftp_create_dir_mutex = gui_common.nice_mutex( this_name = "FTP_Dir_Mutex") #: 
Internal directory creation protection

# see: http://en.wikipedia.org/wiki/List_of_FTP_server_return_codes
#
# FTP server return codes always have three digits, and each digit has a 
special meaning.
#
# The first digit denotes whether the response is good, bad or incomplete:
#   1xx Positive Preliminary reply
#   2xx Positive Completion reply
#   3xx Positive Intermediate reply
#   4xx Transient Negative Completion reply
#   5xx Permanent Negative Completion reply
#   6xx Protected reply
# The second digit is a grouping digit and encodes the following information:
#   x0x Syntax
#   x1x Information
#   x2x Connections
#   x3x Authentication and accounting
#   x4x Unspecified as of RFC 959.
#   x5x File system
### The requested action is being taken. Expect a reply before proceeding with 
a new command.
# 100   Series: The requested action is being initiated, expect another reply 
before proceeding with a new command.
# 110   Restart marker replay . In this case, the text is exact and not left to 
the particular implementation;
#   it must read: MARK  =  where  is User-process data stream 
marker, and  server's equivalent marker (note the spaces between markers 
and "=").
# 120   Service ready in nnn minutes.
# 125   Data connection already open; transfer starting.
# 150   File status okay; about to open data connection.
### The requested action has been successfully completed.
# 200   Command okay.
# 202   Command not implemented, superfluous at this site.
# 211   System status, or system help reply.
# 212   Directory status.
# 213   File status.
# 214   Help message.On how to use the server or the meaning of a particular 
non-standard command. This reply is useful only to the human user.
# 215   NAME system type. Where NAME is an official system name from the 
registry kept by IANA.
# 220   Service ready for new user.
# 221   Service closing control connection.
# 225   Data connection open; no transfer in progress.
# 226   Closing data connection. Requested file action successful (for example, 
file transfer or file abort).
# 227   Entering Passive Mode (h1,h2,h3,h4,p1,p2).
# 228   Entering Long Passive Mode (long address, port).
# 229   Entering Extended Passive Mode (|||port|).
# 230   User logged in, proceed. Logged out if appropriate.
# 231   User logged out; service terminated.
# 232   Logout command noted, will complete when transfer done.
# 250   Requested file action okay, completed.
# 257   "PATHNAME" created.
### The command has been accepted, but